40 return Selection(
"Heat_BC_Type",
"Types of boundary conditions for heat transfer model.")
42 "Default heat transfer boundary condition.\n" 43 "On water inflow (($(q_w \\le 0)$)), total energy flux is given by the reference temperature 'bc_temperature'. " 44 "On water outflow we prescribe zero diffusive flux, " 45 "i.e. the energy flows out only due to advection.")
47 "Dirichlet boundary condition (($T = T_D $)).\n" 48 "The prescribed temperature (($T_D$)) is specified by the field 'bc_temperature'.")
50 "Total energy flux boundary condition.\n" 51 "The prescribed incoming total flux can have the general form (($\\delta(f_N+\\sigma_R(T_R-T) )$)), " 52 "where the absolute flux (($f_N$)) is specified by the field 'bc_flux', " 53 "the transition parameter (($\\sigma_R$)) by 'bc_robin_sigma', " 54 "and the reference temperature (($T_R$)) by 'bc_temperature'.")
55 .
add_value(bc_diffusive_flux,
"diffusive_flux",
56 "Diffusive flux boundary condition.\n" 57 "The prescribed incoming energy flux due to diffusion can have the general form (($\\delta(f_N+\\sigma_R(T_R-T) )$)), " 58 "where the absolute flux (($f_N$)) is specified by the field 'bc_flux', " 59 "the transition parameter (($\\sigma_R$)) by 'bc_robin_sigma', " 60 "and the reference temperature (($T_R$)) by 'bc_temperature'.")
70 "Type of boundary condition.")
72 .input_default(
"\"inflow\"")
73 .input_selection( get_bc_type_selection() )
75 *
this+=bc_dirichlet_value
76 .name(
"bc_temperature")
77 .description(
"Boundary value of temperature.")
82 .disable_where(bc_type, { bc_dirichlet, bc_inflow })
84 .description(
"Flux in Neumann boundary condition.")
85 .units(
UnitSI().kg().m().s(-1).md() )
89 .disable_where(bc_type, { bc_dirichlet, bc_inflow })
90 .name(
"bc_robin_sigma")
91 .description(
"Conductivity coefficient in Robin boundary condition.")
92 .units(
UnitSI().m(4).s(-1).md() )
96 *
this+=init_temperature
97 .name(
"init_temperature")
98 .description(
"Initial temperature.")
100 .input_default(
"0.0");
104 .description(
"Porosity.")
106 .input_default(
"1.0")
107 .flags_add(in_main_matrix & in_time_term)
111 .name(
"water_content")
113 .input_default(
"1.0")
114 .flags_add(input_copy & in_main_matrix & in_time_term);
117 .name(
"fluid_density")
118 .description(
"Density of fluid.")
119 .units(
UnitSI().kg().m(-3) )
120 .input_default(
"1000")
121 .flags_add(in_main_matrix & in_time_term);
123 *
this+=fluid_heat_capacity
124 .name(
"fluid_heat_capacity")
125 .description(
"Heat capacity of fluid.")
127 .flags_add(in_main_matrix & in_time_term);
129 *
this+=fluid_heat_conductivity
130 .name(
"fluid_heat_conductivity")
131 .description(
"Heat conductivity of fluid.")
133 .flags_add(in_main_matrix)
138 .name(
"solid_density")
139 .description(
"Density of solid (rock).")
140 .units(
UnitSI().kg().m(-3) )
141 .flags_add(in_time_term);
143 *
this+=solid_heat_capacity
144 .name(
"solid_heat_capacity")
145 .description(
"Heat capacity of solid (rock).")
147 .flags_add(in_time_term);
149 *
this+=solid_heat_conductivity
150 .name(
"solid_heat_conductivity")
151 .description(
"Heat conductivity of solid (rock).")
153 .flags_add(in_main_matrix)
158 .description(
"Longitudal heat dispersivity in fluid.")
160 .input_default(
"0.0")
161 .flags_add(in_main_matrix);
165 .description(
"Transversal heat dispersivity in fluid.")
167 .input_default(
"0.0")
168 .flags_add(in_main_matrix);
170 *
this+=fluid_thermal_source
171 .name(
"fluid_thermal_source")
172 .description(
"Density of thermal source in fluid.")
174 .input_default(
"0.0")
177 *
this+=solid_thermal_source
178 .name(
"solid_thermal_source")
179 .description(
"Density of thermal source in solid.")
181 .input_default(
"0.0")
184 *
this+=fluid_heat_exchange_rate
185 .name(
"fluid_heat_exchange_rate")
186 .description(
"Heat exchange rate of source in fluid.")
188 .input_default(
"0.0")
191 *
this+=solid_heat_exchange_rate
192 .name(
"solid_heat_exchange_rate")
193 .description(
"Heat exchange rate of source in solid.")
195 .input_default(
"0.0")
198 *
this+=fluid_ref_temperature
199 .name(
"fluid_ref_temperature")
200 .description(
"Reference temperature of source in fluid.")
202 .input_default(
"0.0")
205 *
this+=solid_ref_temperature
206 .name(
"solid_ref_temperature")
207 .description(
"Reference temperature in solid.")
209 .input_default(
"0.0")
213 .name(
"cross_section")
214 .units(
UnitSI().m(3).md() )
215 .flags(input_copy & in_time_term & in_main_matrix);
220 .flags(equation_result);
228 std::string(ModelEqData::name()) +
"_" + implementation,
229 description +
" for heat transfer.")
232 "Time governor setting for the secondary equation.")
234 "Settings for computing balance.")
236 "Parameters of output stream.");
245 std::string(ModelEqData::name()) +
"_DG_output_fields",
246 "Selection of output fields for Heat Transfer DG model.");
280 por(point_list.size()),
281 f_rho(point_list.size()),
282 s_rho(point_list.size()),
283 f_c(point_list.size()),
284 s_c(point_list.size());
293 for (
unsigned int i=0; i<point_list.size(); i++)
294 mm_coef[i] = elem_csec[i]*(por[i]*f_rho[i]*f_c[i] + (1.-por[i])*s_rho[i]*s_c[i]);
304 const unsigned int qsize = point_list.size();
306 s_cond(qsize), por(qsize), csection(qsize), disp_l(qsize), disp_t(qsize);
317 for (
unsigned int k=0; k<qsize; k++) {
318 ad_coef[0][k] = velocity[k]*f_rho[k]*f_cap[k];
323 double vnorm = arma::norm(velocity[k], 2);
325 for (
int i=0; i<3; i++)
326 for (
int j=0; j<3; j++)
327 dif_coef[0][k](i,j) = ((velocity[k][i]/vnorm)*(velocity[k][j]/vnorm)*(disp_l[k]-disp_t[k]) + disp_t[k]*(i==j?1:0))
328 *vnorm*f_rho[k]*f_cond[k];
330 dif_coef[0][k].zeros();
333 dif_coef[0][k] += csection[k]*(por[k]*f_cond[k] + (1.-por[k])*s_cond[k])*arma::eye(3,3);
347 arma::uvec &bc_types)
367 for (
auto f : bc_flux) f = -f;
385 const unsigned int qsize = point_list.size();
386 std::vector<double> por(qsize), csection(qsize), f_rho(qsize), s_rho(qsize), f_cap(qsize), s_cap(qsize),
387 f_source(qsize), s_source(qsize), f_sigma(qsize), s_sigma(qsize), f_temp(qsize), s_temp(qsize);
401 sources_density[0].resize(point_list.size());
402 sources_sigma[0].resize(point_list.size());
403 sources_value[0].resize(point_list.size());
404 for (
unsigned int k=0; k<point_list.size(); k++)
406 sources_density[0][k] = csection[k]*(por[k]*f_source[k] + (1.-por[k])*s_source[k]);
407 sources_sigma[0][k] = csection[k]*(por[k]*f_rho[k]*f_cap[k]*f_sigma[k] + (1.-por[k])*s_rho[k]*s_cap[k]*s_sigma[k]);
409 sources_value[0][k] = csection[k]*(por[k]*f_rho[k]*f_cap[k]*f_sigma[k]*f_temp[k]
410 + (1.-por[k])*s_rho[k]*s_cap[k]*s_sigma[k]*s_temp[k])/sources_sigma[0][k];
412 sources_value[0][k] = 0;
421 const unsigned int qsize = point_list.size();
422 std::vector<double> por(qsize), csection(qsize), f_rho(qsize), s_rho(qsize), f_cap(qsize), s_cap(qsize),
423 f_source(qsize), s_source(qsize), f_sigma(qsize), s_sigma(qsize), f_temp(qsize), s_temp(qsize);
432 sources_sigma[0].resize(point_list.size());
433 for (
unsigned int k=0; k<point_list.size(); k++)
435 sources_sigma[0][k] = csection[k]*(por[k]*f_rho[k]*f_cap[k]*f_sigma[k] + (1.-por[k])*s_rho[k]*s_cap[k]*s_sigma[k]);
vector< unsigned int > subst_idx
List of indices used to call balance methods for a set of quantities.
Field< 3, FieldValue< 3 >::Scalar > solid_heat_capacity
Heat capacity of solid.
static const Input::Type::Record & get_input_type()
Main balance input record type.
Field< 3, FieldValue< 3 >::Scalar > fluid_density
Density of fluid.
static constexpr Mask in_main_matrix
A field is part of main "stiffness matrix" of the equation.
Field< 3, FieldValue< 3 >::Scalar > disp_t
Transversal heat dispersivity.
Field< 3, FieldValue< 3 >::Scalar > cross_section
Pointer to DarcyFlow field cross_section.
static const Input::Type::Record & get_input_type()
The specification of output stream.
static IT::Selection get_output_selection()
void initialize(const Input::Array &in_array)
Read from input array.
Field< 3, FieldValue< 3 >::Scalar > fluid_heat_exchange_rate
Heat exchange rate in fluid.
Field< 3, FieldValue< 3 >::Scalar > solid_heat_exchange_rate
Heat exchange rate in solid.
BCMultiField< 3, FieldValue< 3 >::Scalar > bc_dirichlet_value
Dirichlet boundary condition for temperature.
BCField< 3, FieldValue< 3 >::Enum > bc_type
Type of boundary condition (see also BC_Type)
static const Input::Type::Selection & get_bc_type_selection()
Field< 3, FieldValue< 3 >::Scalar > fluid_heat_capacity
Heat capacity of fluid.
Basic time management functionality for unsteady (and steady) solvers (class Equation).
BCField< 3, FieldValue< 3 >::Scalar > bc_flux
Flux value in total/diffusive flux b.c.
void get_bc_type(const ElementAccessor< 3 > &ele_acc, arma::uvec &bc_types) override
virtual void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list) const
Field< 3, FieldValue< 3 >::Scalar > porosity
Porosity of solid.
Field< 3, FieldValue< 3 >::Scalar > fluid_thermal_source
Thermal source in fluid.
Field< 3, FieldValue< 3 >::Scalar > fluid_heat_conductivity
Heat conductivity of fluid.
void get_flux_bc_sigma(unsigned int index, const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< double > &bc_sigma) override
Return transition coefficient for flux b.c.
static Input::Type::Abstract & get_input_type()
Common specification of the input record for secondary equations.
Field< 3, FieldValue< 3 >::Scalar > fluid_ref_temperature
Reference temperature in fluid.
void get_flux_bc_data(unsigned int index, const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< double > &bc_flux, std::vector< double > &bc_sigma, std::vector< double > &bc_ref_value) override
Return data for diffusive or total flux b.c.
Field< 3, FieldValue< 3 >::Scalar > init_temperature
Initial temperature.
Field< 3, FieldValue< 3 >::Scalar > solid_thermal_source
Thermal source in solid.
void compute_mass_matrix_coefficient(const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< double > &mm_coef) override
static UnitSI & W()
Returns Watt.
static UnitSI & J()
Returns Joule.
virtual Value::return_type const & value(const Point &p, const ElementAccessor< spacedim > &elm) const
std::shared_ptr< Balance > balance_
object for calculation and writing the mass balance to file.
Field< 3, FieldValue< 3 >::Scalar > solid_heat_conductivity
Heat conductivity of solid.
SubstanceList substances_
Transported substances.
static constexpr Mask in_rhs
A field is part of the right hand side of the equation.
static std::shared_ptr< OutputTime > create_output_stream(const std::string &equation_name, Mesh &mesh, const Input::Record &in_rec)
This method delete all object instances of class OutputTime stored in output_streams vector...
Field< 3, FieldValue< 3 >::Scalar > solid_ref_temperature
Reference temperature in solid.
virtual ModelEqData & data()=0
Derived class should implement getter for ModelEqData instance.
void compute_init_cond(const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &init_values) override
void compute_advection_diffusion_coefficients(const std::vector< arma::vec3 > &point_list, const std::vector< arma::vec3 > &velocity, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< arma::vec3 > > &ad_coef, std::vector< std::vector< arma::mat33 > > &dif_coef) override
static const Input::Type::Record & get_input_type()
~HeatTransferModel() override
Field< 3, FieldValue< 3 >::Scalar > solid_density
Density of solid.
Discontinuous Galerkin method for equation of transport with dispersion.
arma::vec::fixed< spacedim > centre() const
HeatTransferModel(Mesh &mesh, const Input::Record in_rec)
void compute_sources_sigma(const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &sources_sigma) override
BCField< 3, FieldValue< 3 >::Scalar > bc_robin_sigma
Transition coefficient in total/diffusive flux b.c.
std::shared_ptr< OutputTime > output_stream_
Class for representation SI units of Fields.
static UnitSI & dimensionless()
Returns dimensionless unit.
void compute_source_coefficients(const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &sources_conc, std::vector< std::vector< double > > &sources_density, std::vector< std::vector< double > > &sources_sigma) override
void output_data() override
Write computed fields.
Field< 3, FieldValue< 3 >::Scalar > disp_l
Longitudal heat dispersivity.