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);
110 .name(
"water_content")
112 .input_default(
"1.0")
113 .flags_add(input_copy & in_main_matrix & in_time_term);
116 .name(
"fluid_density")
117 .description(
"Density of fluid.")
118 .units(
UnitSI().kg().m(-3) )
119 .flags_add(in_main_matrix & in_time_term);
121 *
this+=fluid_heat_capacity
122 .name(
"fluid_heat_capacity")
123 .description(
"Heat capacity of fluid.")
125 .flags_add(in_main_matrix & in_time_term);
127 *
this+=fluid_heat_conductivity
128 .name(
"fluid_heat_conductivity")
129 .description(
"Heat conductivity of fluid.")
131 .flags_add(in_main_matrix);
135 .name(
"solid_density")
136 .description(
"Density of solid (rock).")
137 .units(
UnitSI().kg().m(-3) )
138 .flags_add(in_time_term);
140 *
this+=solid_heat_capacity
141 .name(
"solid_heat_capacity")
142 .description(
"Heat capacity of solid (rock).")
144 .flags_add(in_time_term);
146 *
this+=solid_heat_conductivity
147 .name(
"solid_heat_conductivity")
148 .description(
"Heat conductivity of solid (rock).")
150 .flags_add(in_main_matrix);
154 .description(
"Longitudal heat dispersivity in fluid.")
156 .input_default(
"0.0")
157 .flags_add(in_main_matrix);
161 .description(
"Transversal heat dispersivity in fluid.")
163 .input_default(
"0.0")
164 .flags_add(in_main_matrix);
166 *
this+=fluid_thermal_source
167 .name(
"fluid_thermal_source")
168 .description(
"Thermal source density in fluid.")
170 .input_default(
"0.0")
173 *
this+=solid_thermal_source
174 .name(
"solid_thermal_source")
175 .description(
"Thermal source density in solid.")
177 .input_default(
"0.0")
180 *
this+=fluid_heat_exchange_rate
181 .name(
"fluid_heat_exchange_rate")
182 .description(
"Heat exchange rate in fluid.")
184 .input_default(
"0.0")
187 *
this+=solid_heat_exchange_rate
188 .name(
"solid_heat_exchange_rate")
189 .description(
"Heat exchange rate of source in solid.")
191 .input_default(
"0.0")
194 *
this+=fluid_ref_temperature
195 .name(
"fluid_ref_temperature")
196 .description(
"Reference temperature of source in fluid.")
198 .input_default(
"0.0")
201 *
this+=solid_ref_temperature
202 .name(
"solid_ref_temperature")
203 .description(
"Reference temperature in solid.")
205 .input_default(
"0.0")
209 .name(
"cross_section")
210 .units(
UnitSI().m(3).md() )
211 .flags(input_copy & in_time_term & in_main_matrix);
216 .flags(equation_result);
224 std::string(ModelEqData::name()) +
"_" + implementation,
225 description +
" for heat transfer.")
228 "Time governor setting for the secondary equation.")
230 "Settings for computing balance.")
232 "Parameters of output stream.");
241 std::string(ModelEqData::name()) +
"_DG_output_fields",
242 "Selection of output fields for Heat Transfer DG model.");
286 por(point_list.size()),
287 f_rho(point_list.size()),
288 s_rho(point_list.size()),
289 f_c(point_list.size()),
290 s_c(point_list.size());
299 for (
unsigned int i=0; i<point_list.size(); i++)
300 mm_coef[i] = elem_csec[i]*(por[i]*f_rho[i]*f_c[i] + (1.-por[i])*s_rho[i]*s_c[i]);
310 const unsigned int qsize = point_list.size();
312 s_cond(qsize), por(qsize), csection(qsize), disp_l(qsize), disp_t(qsize);
323 for (
unsigned int k=0; k<qsize; k++) {
324 ad_coef[0][k] = velocity[k]*f_rho[k]*f_cap[k];
329 double vnorm = arma::norm(velocity[k], 2);
331 for (
int i=0; i<3; i++)
332 for (
int j=0; j<3; j++)
333 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))
334 *vnorm*f_rho[k]*f_cond[k];
336 dif_coef[0][k].zeros();
339 dif_coef[0][k] += csection[k]*(por[k]*f_cond[k] + (1.-por[k])*s_cond[k])*arma::eye(3,3);
350 for (
unsigned int i=0; i<point_list.size(); i++)
351 init_values[i] = init_value[i];
356 arma::uvec &bc_types)
376 for (
auto f : bc_flux) f = -f;
394 const unsigned int qsize = point_list.size();
395 std::vector<double> por(qsize), csection(qsize), f_rho(qsize), s_rho(qsize), f_cap(qsize), s_cap(qsize),
396 f_source(qsize), s_source(qsize), f_sigma(qsize), s_sigma(qsize), f_temp(qsize), s_temp(qsize);
410 for (
unsigned int k=0; k<point_list.size(); k++)
412 sources_density[k].resize(1);
413 sources_sigma[k].resize(1);
414 sources_value[k].resize(1);
416 sources_density[k][0] = csection[k]*(por[k]*f_source[k] + (1.-por[k])*s_source[k]);
417 sources_sigma[k][0] = 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]);
419 sources_value[k][0] = csection[k]*(por[k]*f_rho[k]*f_cap[k]*f_sigma[k]*f_temp[k]
420 + (1.-por[k])*s_rho[k]*s_cap[k]*s_sigma[k]*s_temp[k])/sources_sigma[k][0];
422 sources_value[k][0] = 0;
431 const unsigned int qsize = point_list.size();
432 std::vector<double> por(qsize), csection(qsize), f_rho(qsize), s_rho(qsize), f_cap(qsize), s_cap(qsize),
433 f_source(qsize), s_source(qsize), f_sigma(qsize), s_sigma(qsize), f_temp(qsize), s_temp(qsize);
442 for (
unsigned int k=0; k<point_list.size(); k++)
444 sources_sigma[k].resize(1);
445 sources_sigma[k][0] = 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.
void compute_sources_sigma(const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< arma::vec > &sources_sigma) override
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.
void compute_init_cond(const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< arma::vec > &init_values) override
const TimeStep & step(int index=-1) const
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.
virtual void calculate_instant_balance()=0
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_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_source_coefficients(const std::vector< arma::vec3 > &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< arma::vec > &sources_conc, std::vector< arma::vec > &sources_density, std::vector< arma::vec > &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 output_data() override
Write computed fields.
Field< 3, FieldValue< 3 >::Scalar > disp_l
Longitudal heat dispersivity.
virtual void value_list(const std::vector< Point > &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename MultiFieldValue::return_type > &value_list) const