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>
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
110 
117  void
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>
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> &
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 
227  std::vector<std::string> temperature_plugin_names;
228 
234  std::vector<std::string> heat_flux_plugin_names;
235 
239  std::list<std::unique_ptr<aspect::BoundaryTemperature::Interface<dim>>> temperature_plugin_objects;
240 
244  std::list<std::unique_ptr<aspect::BoundaryHeatFlux::Interface<dim>>> heat_flux_plugin_objects;
245  };
246 
247 
255 #define ASPECT_REGISTER_BOUNDARY_CONVECTIVE_HEATING_MODEL(classname, name, description) \
256  template class classname<2>; \
257  template class classname<3>; \
258  namespace ASPECT_REGISTER_BOUNDARY_CONVECTIVE_HEATING_MODEL_ ## classname \
259  { \
260  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryConvectiveHeating::Interface<2>,classname<2>> \
261  dummy_ ## classname ## _2d (&aspect::BoundaryConvectiveHeating::Manager<2>::register_boundary_convective_heating, \
262  name, description); \
263  aspect::internal::Plugins::RegisterHelper<aspect::BoundaryConvectiveHeating::Interface<3>,classname<3>> \
264  dummy_ ## classname ## _3d (&aspect::BoundaryConvectiveHeating::Manager<3>::register_boundary_convective_heating, \
265  name, description); \
266  }
267  }
268 }
269 
270 
271 #endif
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
static void write_plugin_graph(std::ostream &output_stream)
static void register_boundary_heat_flux(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< BoundaryHeatFlux::Interface< dim >>(*factory_function)())
static void declare_parameters(ParameterHandler &prm)
std::list< std::unique_ptr< aspect::BoundaryTemperature::Interface< dim > > > temperature_plugin_objects
Definition: interface.h:239
void parse_parameters(ParameterHandler &prm) override
std::set< types::boundary_id > convective_heating_boundary_indicators
Definition: interface.h:220
DeclException1(ExcBoundaryConvectiveHeatingNameNotFound, std::string,<< "Could not find entry <"<< arg1<< "> among the names of registered boundary convective heating objects.")
double boundary_temperature(const types::boundary_id boundary_indicator, const Point< dim > &position) const
std::vector< std::string > heat_flux_plugin_names
Definition: interface.h:234
std::vector< Tensor< 1, dim > > heat_flux(const types::boundary_id boundary_indicator, const MaterialModel::MaterialModelInputs< dim > &material_model_inputs, const MaterialModel::MaterialModelOutputs< dim > &material_model_outputs, const std::vector< Tensor< 1, dim >> &normal_vectors) const
std::vector< std::string > temperature_plugin_names
Definition: interface.h:227
static void register_boundary_convective_heating(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< Interface< dim >>(*factory_function)())
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
static void register_boundary_temperature(const std::string &name, const std::string &description, void(*declare_parameters_function)(ParameterHandler &), std::unique_ptr< BoundaryTemperature::Interface< dim >>(*factory_function)())
const std::set< types::boundary_id > & get_convective_heating_boundary_indicators() const
std::list< std::unique_ptr< aspect::BoundaryHeatFlux::Interface< dim > > > heat_flux_plugin_objects
Definition: interface.h:244
unsigned int boundary_id