41 return Selection(
"Heat_BC_Type",
"Types of boundary conditions for heat transfer model.")
43 "Default heat transfer boundary condition.\n" 44 "On water inflow (($(q_w \\le 0)$)), total energy flux is given by the reference temperature 'bc_temperature'. " 45 "On water outflow we prescribe zero diffusive flux, " 46 "i.e. the energy flows out only due to advection.")
48 "Dirichlet boundary condition (($T = T_D $)).\n" 49 "The prescribed temperature (($T_D$)) is specified by the field 'bc_temperature'.")
51 "Total energy flux boundary condition.\n" 52 "The prescribed incoming total flux can have the general form (($\\delta(f_N+\\sigma_R(T_R-T) )$)), " 53 "where the absolute flux (($f_N$)) is specified by the field 'bc_flux', " 54 "the transition parameter (($\\sigma_R$)) by 'bc_robin_sigma', " 55 "and the reference temperature (($T_R$)) by 'bc_temperature'.")
56 .
add_value(bc_diffusive_flux,
"diffusive_flux",
57 "Diffusive flux boundary condition.\n" 58 "The prescribed incoming energy flux due to diffusion can have the general form (($\\delta(f_N+\\sigma_R(T_R-T) )$)), " 59 "where the absolute flux (($f_N$)) is specified by the field 'bc_flux', " 60 "the transition parameter (($\\sigma_R$)) by 'bc_robin_sigma', " 61 "and the reference temperature (($T_R$)) by 'bc_temperature'.")
71 "Type of boundary condition.")
73 .input_default(
"\"inflow\"")
74 .input_selection( get_bc_type_selection() )
76 *
this+=bc_dirichlet_value
77 .name(
"bc_temperature")
78 .description(
"Boundary value of temperature.")
83 .disable_where(bc_type, { bc_dirichlet, bc_inflow })
85 .description(
"Flux in Neumann boundary condition.")
86 .units(
UnitSI().kg().m().s(-1).md() )
90 .disable_where(bc_type, { bc_dirichlet, bc_inflow })
91 .name(
"bc_robin_sigma")
92 .description(
"Conductivity coefficient in Robin boundary condition.")
93 .units(
UnitSI().m(4).s(-1).md() )
97 *
this+=init_temperature
98 .name(
"init_temperature")
99 .description(
"Initial temperature.")
101 .input_default(
"0.0");
105 .description(
"Porosity.")
107 .input_default(
"1.0")
108 .flags_add(in_main_matrix & in_time_term)
112 .name(
"water_content")
114 .input_default(
"1.0")
115 .flags_add(input_copy & in_main_matrix & in_time_term);
118 .name(
"fluid_density")
119 .description(
"Density of fluid.")
120 .units(
UnitSI().kg().m(-3) )
121 .input_default(
"1000")
122 .flags_add(in_main_matrix & in_time_term);
124 *
this+=fluid_heat_capacity
125 .name(
"fluid_heat_capacity")
126 .description(
"Heat capacity of fluid.")
128 .flags_add(in_main_matrix & in_time_term);
130 *
this+=fluid_heat_conductivity
131 .name(
"fluid_heat_conductivity")
132 .description(
"Heat conductivity of fluid.")
134 .flags_add(in_main_matrix)
139 .name(
"solid_density")
140 .description(
"Density of solid (rock).")
141 .units(
UnitSI().kg().m(-3) )
142 .flags_add(in_time_term);
144 *
this+=solid_heat_capacity
145 .name(
"solid_heat_capacity")
146 .description(
"Heat capacity of solid (rock).")
148 .flags_add(in_time_term);
150 *
this+=solid_heat_conductivity
151 .name(
"solid_heat_conductivity")
152 .description(
"Heat conductivity of solid (rock).")
154 .flags_add(in_main_matrix)
159 .description(
"Longitudinal heat dispersivity in fluid.")
161 .input_default(
"0.0")
162 .flags_add(in_main_matrix);
166 .description(
"Transverse heat dispersivity in fluid.")
168 .input_default(
"0.0")
169 .flags_add(in_main_matrix);
171 *
this+=fluid_thermal_source
172 .name(
"fluid_thermal_source")
173 .description(
"Density of thermal source in fluid.")
175 .input_default(
"0.0")
178 *
this+=solid_thermal_source
179 .name(
"solid_thermal_source")
180 .description(
"Density of thermal source in solid.")
182 .input_default(
"0.0")
185 *
this+=fluid_heat_exchange_rate
186 .name(
"fluid_heat_exchange_rate")
187 .description(
"Heat exchange rate of source in fluid.")
189 .input_default(
"0.0")
192 *
this+=solid_heat_exchange_rate
193 .name(
"solid_heat_exchange_rate")
194 .description(
"Heat exchange rate of source in solid.")
196 .input_default(
"0.0")
199 *
this+=fluid_ref_temperature
200 .name(
"fluid_ref_temperature")
201 .description(
"Reference temperature of source in fluid.")
203 .input_default(
"0.0")
206 *
this+=solid_ref_temperature
207 .name(
"solid_ref_temperature")
208 .description(
"Reference temperature in solid.")
210 .input_default(
"0.0")
214 .name(
"cross_section")
215 .units(
UnitSI().m(3).md() )
216 .flags(input_copy & in_time_term & in_main_matrix);
220 .description(
"Temperature solution.")
222 .flags(equation_result);
230 std::string(ModelEqData::name()) +
"_" + implementation,
231 description +
" for heat transfer.")
234 "Time governor setting for the secondary equation.")
236 "Settings for computing balance.")
238 "Parameters of output stream.");
247 std::string(ModelEqData::name()) +
"_DG_output_fields",
248 "Selection of output fields for Heat Transfer DG model.");
282 por(point_list.size()),
283 f_rho(point_list.size()),
284 s_rho(point_list.size()),
285 f_c(point_list.size()),
286 s_c(point_list.size());
295 for (
unsigned int i=0; i<point_list.size(); i++)
296 mm_coef[i] = elem_csec[i]*(por[i]*f_rho[i]*f_c[i] + (1.-por[i])*s_rho[i]*s_c[i]);
306 const unsigned int qsize = point_list.size();
308 s_cond(qsize), por(qsize), csection(qsize), disp_l(qsize), disp_t(qsize);
319 for (
unsigned int k=0; k<qsize; k++) {
320 ad_coef[0][k] = velocity[k]*f_rho[k]*f_cap[k];
325 double vnorm = arma::norm(velocity[k], 2);
327 for (
int i=0; i<3; i++)
328 for (
int j=0; j<3; j++)
329 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))
330 *vnorm*f_rho[k]*f_cond[k];
332 dif_coef[0][k].zeros();
335 dif_coef[0][k] += csection[k]*(por[k]*f_cond[k] + (1.-por[k])*s_cond[k])*arma::eye(3,3);
349 arma::uvec &bc_types)
369 for (
auto f : bc_flux) f = -f;
387 const unsigned int qsize = point_list.size();
388 std::vector<double> por(qsize), csection(qsize), f_rho(qsize), s_rho(qsize), f_cap(qsize), s_cap(qsize),
389 f_source(qsize), s_source(qsize), f_sigma(qsize), s_sigma(qsize), f_temp(qsize), s_temp(qsize);
403 sources_density[0].resize(point_list.size());
404 sources_sigma[0].resize(point_list.size());
405 sources_value[0].resize(point_list.size());
406 for (
unsigned int k=0; k<point_list.size(); k++)
408 sources_density[0][k] = csection[k]*(por[k]*f_source[k] + (1.-por[k])*s_source[k]);
409 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]);
410 if (fabs(sources_sigma[0][k]) > numeric_limits<double>::epsilon())
411 sources_value[0][k] = csection[k]*(por[k]*f_rho[k]*f_cap[k]*f_sigma[k]*f_temp[k]
412 + (1.-por[k])*s_rho[k]*s_cap[k]*s_sigma[k]*s_temp[k])/sources_sigma[0][k];
414 sources_value[0][k] = 0;
423 const unsigned int qsize = point_list.size();
424 std::vector<double> por(qsize), csection(qsize), f_rho(qsize), s_rho(qsize), f_cap(qsize), s_cap(qsize),
425 f_source(qsize), s_source(qsize), f_sigma(qsize), s_sigma(qsize), f_temp(qsize), s_temp(qsize);
434 sources_sigma[0].resize(point_list.size());
435 for (
unsigned int k=0; k<point_list.size(); k++)
437 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.
static std::shared_ptr< OutputTime > create_output_stream(const std::string &equation_name, const Input::Record &in_rec, std::string unit_str)
This method delete all object instances of class OutputTime stored in output_streams vector...
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.
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.
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.
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.
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.