ASPECT
interface.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2025 - by the authors of the ASPECT code.
3 
4  This file is part of ASPECT.
5 
6  ASPECT is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2, or (at your option)
9  any later version.
10 
11  ASPECT is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with ASPECT; see the file LICENSE. If not see
18  <http://www.gnu.org/licenses/>.
19 */
20 
21 
22 #ifndef _aspect_boundary_convective_heating_interface_h
23 #define _aspect_boundary_convective_heating_interface_h
24 
25 #include <aspect/plugins.h>
29 #include <aspect/utilities.h>
30 
31 namespace aspect
32 {
33  template <int dim> class SimulatorAccess;
34 
41  namespace BoundaryConvectiveHeating
42  {
48  template <int dim>
49  class Interface : public Plugins::InterfaceBase
50  {
51  public:
80  virtual
81  std::vector<double>
82  heat_transfer_coefficient (const types::boundary_id boundary_indicator,
83  const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
84  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs) const = 0;
85  };
86 
87 
88 
99  template <int dim>
100  class Manager : public Plugins::ManagerBase<Interface<dim>>, public SimulatorAccess<dim>
101  {
102  public:
107  static
108  void
109  declare_parameters (ParameterHandler &prm);
110 
117  void
118  parse_parameters (ParameterHandler &prm) override;
119 
124  double
125  boundary_temperature (const types::boundary_id boundary_indicator,
126  const Point<dim> &position) const;
127 
132  std::vector<Tensor<1,dim>>
133  heat_flux (const types::boundary_id boundary_indicator,
134  const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
135  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs,
136  const std::vector<Tensor<1,dim>> &normal_vectors) const;
137 
142  std::vector<double>
143  heat_transfer_coefficient (const types::boundary_id boundary_indicator,
144  const MaterialModel::MaterialModelInputs<dim> &material_model_inputs,
145  const MaterialModel::MaterialModelOutputs<dim> &material_model_outputs) const;
146 
166  static
167  void
168  register_boundary_convective_heating (const std::string &name,
169  const std::string &description,
170  void (*declare_parameters_function) (ParameterHandler &),
171  std::unique_ptr<Interface<dim>> (*factory_function) ());
172 
173  static
174  void
175  register_boundary_temperature (const std::string &name,
176  const std::string &description,
177  void (*declare_parameters_function) (ParameterHandler &),
178  std::unique_ptr<BoundaryTemperature::Interface<dim>> (*factory_function) ());
179 
180  static
181  void
182  register_boundary_heat_flux (const std::string &name,
183  const std::string &description,
184  void (*declare_parameters_function) (ParameterHandler &),
185  std::unique_ptr<BoundaryHeatFlux::Interface<dim>> (*factory_function) ());
186 
187  /*
188  * Return a set of boundary indicators for which convective heating
189  * is prescribed.
190  */
191  const std::set<types::boundary_id> &
192  get_convective_heating_boundary_indicators() const;
193 
203  static
204  void
205  write_plugin_graph (std::ostream &output_stream);
206 
210  DeclException1 (ExcBoundaryConvectiveHeatingNameNotFound,
211  std::string,
212  << "Could not find entry <"
213  << arg1
214  << "> among the names of registered boundary convective heating objects.");
215  private:
220  std::set<types::boundary_id> convective_heating_boundary_indicators;
221 
225  std::vector<std::string> temperature_plugin_names;
226 
230  std::vector<std::string> heat_flux_plugin_names;
231 
235  std::list<std::unique_ptr<aspect::BoundaryTemperature::Interface<dim>>> temperature_plugin_objects;
236 
240  std::list<std::unique_ptr<aspect::BoundaryHeatFlux::Interface<dim>>> heat_flux_plugin_objects;
241  };
242 
243 
251 #define ASPECT_REGISTER_BOUNDARY_CONVECTIVE_HEATING_MODEL(classname, name, description) \
252  template class classname<2>; \
253  template class classname<3>; \
254  namespace ASPECT_REGISTER_BOUNDARY_CONVECTIVE_HEATING_MODEL_ ## classname \
255  { \
256  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryConvectiveHeating::Interface<2>,classname<2>> \
257  dummy_ ## classname ## _2d (&aspect::BoundaryConvectiveHeating::Manager<2>::register_boundary_convective_heating, \
258  name, description); \
259  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryConvectiveHeating::Interface<3>,classname<3>> \
260  dummy_ ## classname ## _3d (&aspect::BoundaryConvectiveHeating::Manager<3>::register_boundary_convective_heating, \
261  name, description); \
262  }
263  }
264 }
265 
266 
267 #endif
virtual void parse_parameters(ParameterHandler &prm)
std::vector< std::string > temperature_plugin_names
Definition: interface.h:225
std::list< std::unique_ptr< aspect::BoundaryTemperature::Interface< dim > > > temperature_plugin_objects
Definition: interface.h:235
std::vector< std::string > heat_flux_plugin_names
Definition: interface.h:230
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:220
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:240
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.")