ASPECT
interface.h
Go to the documentation of this file.
1 // ------------------------------------------------------
2 //
3 // SPDX-License-Identifier: GPL-2.0-or-later
4 //
5 // SPDX-FileCopyrightText: Copyright (C) 2025-2026 by the ASPECT authors.
6 //
7 // This file is part of ASPECT.
8 //
9 // Detailed license information governing the source code and
10 // contributions can be found in the folder LICENSES and in
11 // LICENSE and CONTRIBUTING.md at the top level directory.
12 //
13 // ------------------------------------------------------
14 
15 
16 #ifndef _aspect_boundary_convective_heating_interface_h
17 #define _aspect_boundary_convective_heating_interface_h
18 
19 #include <aspect/plugins.h>
23 #include <aspect/utilities.h>
24 
25 namespace aspect
26 {
27  template <int dim> class SimulatorAccess;
28 
35  namespace BoundaryConvectiveHeating
36  {
42  template <int dim>
43  class Interface : public Plugins::InterfaceBase
44  {
45  public:
74  virtual
75  std::vector<double>
76  heat_transfer_coefficient (const types::boundary_id boundary_indicator,
77  const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
78  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs) const = 0;
79  };
80 
81 
82 
93  template <int dim>
94  class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
95  {
96  public:
101  static
102  void
104 
111  void
112  parse_parameters (ParameterHandler &prm) override;
113 
118  double
119  boundary_temperature (const types::boundary_id boundary_indicator,
120  const Point<dim> &position) const;
121 
126  std::vector<Tensor<1,dim>>
127  heat_flux (const types::boundary_id boundary_indicator,
128  const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
129  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs,
130  const std::vector<Tensor<1,dim>> &normal_vectors) const;
131 
136  std::vector<double>
137  heat_transfer_coefficient (const types::boundary_id boundary_indicator,
138  const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
139  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs) const;
140 
160  static
161  void
162  register_boundary_convective_heating (const std::string &name,
163  const std::string &description,
164  void (*declare_parameters_function) (ParameterHandler &),
165  std::unique_ptr<Interface<dim>> (*factory_function) ());
166 
167  static
168  void
169  register_boundary_temperature (const std::string &name,
170  const std::string &description,
171  void (*declare_parameters_function) (ParameterHandler &),
172  std::unique_ptr<BoundaryTemperature::Interface<dim>> (*factory_function) ());
173 
174  static
175  void
176  register_boundary_heat_flux (const std::string &name,
177  const std::string &description,
178  void (*declare_parameters_function) (ParameterHandler &),
179  std::unique_ptr<BoundaryHeatFlux::Interface<dim>> (*factory_function) ());
180 
181  /*
182  * Return a set of boundary indicators for which convective heating
183  * is prescribed.
184  */
185  const std::set<types::boundary_id> &
186  get_convective_heating_boundary_indicators() const;
187 
197  static
198  void
199  write_plugin_graph (std::ostream &output_stream);
200 
204  DeclException1 (ExcBoundaryConvectiveHeatingNameNotFound,
205  std::string,
206  << "Could not find entry <"
207  << arg1
208  << "> among the names of registered boundary convective heating objects.");
209  private:
214  std::set<types::boundary_id> convective_heating_boundary_indicators;
215 
221  std::vector<std::string> temperature_plugin_names;
222 
228  std::vector<std::string> heat_flux_plugin_names;
229 
233  std::list<std::unique_ptr<aspect::BoundaryTemperature::Interface<dim>>> temperature_plugin_objects;
234 
238  std::list<std::unique_ptr<aspect::BoundaryHeatFlux::Interface<dim>>> heat_flux_plugin_objects;
239  };
240 
241 
249 #define ASPECT_REGISTER_BOUNDARY_CONVECTIVE_HEATING_MODEL(classname, name, description) \
250  template class classname<2>; \
251  template class classname<3>; \
252  namespace ASPECT_REGISTER_BOUNDARY_CONVECTIVE_HEATING_MODEL_ ## classname \
253  { \
254  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryConvectiveHeating::Interface<2>,classname<2>> \
255  dummy_ ## classname ## _2d (&aspect::BoundaryConvectiveHeating::Manager<2>::register_boundary_convective_heating, \
256  name, description); \
257  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryConvectiveHeating::Interface<3>,classname<3>> \
258  dummy_ ## classname ## _3d (&aspect::BoundaryConvectiveHeating::Manager<3>::register_boundary_convective_heating, \
259  name, description); \
260  }
261  }
262 }
263 
264 
265 #endif
virtual void parse_parameters(ParameterHandler &prm)
std::vector< std::string > temperature_plugin_names
Definition: interface.h:221
std::list< std::unique_ptr< aspect::BoundaryTemperature::Interface< dim > > > temperature_plugin_objects
Definition: interface.h:233
std::vector< std::string > heat_flux_plugin_names
Definition: interface.h:228
void write_plugin_graph(std::ostream &output_stream)
virtual std::vector< double > heat_transfer_coefficient(const types::boundary_id boundary_indicator, const MaterialModel::MaterialModelInputs< dim > &material_model_inputs, const MaterialModel::MaterialModelOutputs< dim > &material_model_outputs) const =0
std::set< types::boundary_id > convective_heating_boundary_indicators
Definition: interface.h:214
void register_boundary_heat_flux(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
std::list< std::unique_ptr< aspect::BoundaryHeatFlux::Interface< dim > > > heat_flux_plugin_objects
Definition: interface.h:238
unsigned int boundary_id
static void declare_parameters(ParameterHandler &prm)
DeclException1(ProbabilityFunctionNegative, Point< dim >,<< "Your probability density function in the particle generator " "returned a negative probability density for the following position: "<< arg1<< ". Please check your function expression.")