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);
116 *
this += flow_flux.name(
"flow_flux")
118 .flags_add(in_time_term & in_main_matrix & in_rhs);
121 .name(
"fluid_density")
122 .description(
"Density of fluid.")
123 .units(
UnitSI().kg().m(-3) )
124 .input_default(
"1000")
125 .flags_add(in_main_matrix & in_time_term);
127 *
this+=fluid_heat_capacity
128 .name(
"fluid_heat_capacity")
129 .description(
"Heat capacity of fluid.")
131 .flags_add(in_main_matrix & in_time_term);
133 *
this+=fluid_heat_conductivity
134 .name(
"fluid_heat_conductivity")
135 .description(
"Heat conductivity of fluid.")
137 .flags_add(in_main_matrix)
142 .name(
"solid_density")
143 .description(
"Density of solid (rock).")
144 .units(
UnitSI().kg().m(-3) )
145 .flags_add(in_time_term);
147 *
this+=solid_heat_capacity
148 .name(
"solid_heat_capacity")
149 .description(
"Heat capacity of solid (rock).")
151 .flags_add(in_time_term);
153 *
this+=solid_heat_conductivity
154 .name(
"solid_heat_conductivity")
155 .description(
"Heat conductivity of solid (rock).")
157 .flags_add(in_main_matrix)
162 .description(
"Longitudinal heat dispersivity in fluid.")
164 .input_default(
"0.0")
165 .flags_add(in_main_matrix);
169 .description(
"Transverse heat dispersivity in fluid.")
171 .input_default(
"0.0")
172 .flags_add(in_main_matrix);
174 *
this+=fluid_thermal_source
175 .name(
"fluid_thermal_source")
176 .description(
"Density of thermal source in fluid.")
178 .input_default(
"0.0")
181 *
this+=solid_thermal_source
182 .name(
"solid_thermal_source")
183 .description(
"Density of thermal source in solid.")
185 .input_default(
"0.0")
188 *
this+=fluid_heat_exchange_rate
189 .name(
"fluid_heat_exchange_rate")
190 .description(
"Heat exchange rate of source in fluid.")
192 .input_default(
"0.0")
195 *
this+=solid_heat_exchange_rate
196 .name(
"solid_heat_exchange_rate")
197 .description(
"Heat exchange rate of source in solid.")
199 .input_default(
"0.0")
202 *
this+=fluid_ref_temperature
203 .name(
"fluid_ref_temperature")
204 .description(
"Reference temperature of source in fluid.")
206 .input_default(
"0.0")
209 *
this+=solid_ref_temperature
210 .name(
"solid_ref_temperature")
211 .description(
"Reference temperature in solid.")
213 .input_default(
"0.0")
217 .name(
"cross_section")
218 .units(
UnitSI().m(3).md() )
219 .flags(input_copy & in_time_term & in_main_matrix);
223 .description(
"Temperature solution.")
225 .flags(equation_result);
233 std::string(ModelEqData::name()) +
"_" + implementation,
234 description +
" for heat transfer.")
238 "Settings for computing balance.")
240 "Parameters of output stream.");
249 std::string(ModelEqData::name()) +
"_DG_output_fields",
250 "Selection of output fields for Heat Transfer DG model.");
283 por(point_list.
size()),
284 f_rho(point_list.
size()),
285 s_rho(point_list.
size()),
286 f_c(point_list.
size()),
287 s_c(point_list.
size());
296 for (
unsigned int i=0; i<point_list.
size(); i++)
297 mm_coef[i] = elem_csec[i]*(por[i]*f_rho[i]*f_c[i] + (1.-por[i])*s_rho[i]*s_c[i]);
307 const unsigned int qsize = point_list.
size();
309 s_cond(qsize), por(qsize), csection(qsize), disp_l(qsize), disp_t(qsize);
320 for (
unsigned int k=0; k<qsize; k++) {
321 ad_coef[0][k] = velocity[k]*f_rho[k]*f_cap[k];
326 double vnorm = arma::norm(velocity[k], 2);
328 for (
int i=0; i<3; i++)
329 for (
int j=0; j<3; j++)
330 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))
331 *vnorm*f_rho[k]*f_cond[k];
333 dif_coef[0][k].zeros();
336 dif_coef[0][k] += csection[k]*(por[k]*f_cond[k] + (1.-por[k])*s_cond[k])*arma::eye(3,3);
350 arma::uvec &bc_types)
370 for (
auto f : bc_flux) f = -f;
388 const unsigned int qsize = point_list.
size();
389 std::vector<double> por(qsize), csection(qsize), f_rho(qsize), s_rho(qsize), f_cap(qsize), s_cap(qsize),
390 f_source(qsize), s_source(qsize), f_sigma(qsize), s_sigma(qsize), f_temp(qsize), s_temp(qsize);
404 sources_density[0].resize(point_list.
size());
405 sources_sigma[0].resize(point_list.
size());
406 sources_value[0].resize(point_list.
size());
407 for (
unsigned int k=0; k<point_list.
size(); k++)
409 sources_density[0][k] = csection[k]*(por[k]*f_source[k] + (1.-por[k])*s_source[k]);
410 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]);
411 if (fabs(sources_sigma[0][k]) > numeric_limits<double>::epsilon())
412 sources_value[0][k] = csection[k]*(por[k]*f_rho[k]*f_cap[k]*f_sigma[k]*f_temp[k]
413 + (1.-por[k])*s_rho[k]*s_cap[k]*s_sigma[k]*s_temp[k])/sources_sigma[0][k];
415 sources_value[0][k] = 0;
424 const unsigned int qsize = point_list.
size();
425 std::vector<double> por(qsize), csection(qsize), f_rho(qsize), s_rho(qsize), f_cap(qsize), s_cap(qsize),
426 f_source(qsize), s_source(qsize), f_sigma(qsize), s_sigma(qsize), f_temp(qsize), s_temp(qsize);
435 sources_sigma[0].resize(point_list.
size());
436 for (
unsigned int k=0; k<point_list.
size(); k++)
438 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.
unsigned int size() const
void compute_advection_diffusion_coefficients(const Armor::array &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 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.
void get_flux_bc_sigma(unsigned int index, const Armor::array &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< double > &bc_sigma) override
Return transition coefficient for flux b.c.
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.
#define ASSERT(expr)
Allow use shorter versions of macro names if these names is not used with external library...
BCField< 3, FieldValue< 3 >::Enum > bc_type
Type of boundary condition (see also BC_Type)
void compute_init_cond(const Armor::array &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &init_values) override
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
Field< 3, FieldValue< 3 >::Scalar > porosity
Porosity of solid.
Field< 3, FieldValue< 3 >::Scalar > fluid_thermal_source
Thermal source in fluid.
static Input::Type::Record & record_template()
Template Record with common keys for derived equations.
void compute_source_coefficients(const Armor::array &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
arma::vec::fixed< spacedim > centre() const
Computes the barycenter.
Field< 3, FieldValue< 3 >::Scalar > fluid_heat_conductivity
Heat conductivity of fluid.
static Input::Type::Abstract & get_input_type()
Common specification of the input record for secondary equations.
void compute_mass_matrix_coefficient(const Armor::array &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< double > &mm_coef) override
Field< 3, FieldValue< 3 >::Scalar > fluid_ref_temperature
Reference temperature in fluid.
void get_flux_bc_data(unsigned int index, const Armor::array &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.
static constexpr Mask input_copy
Field< 3, FieldValue< 3 >::Scalar > init_temperature
Initial temperature.
Field< 3, FieldValue< 3 >::Scalar > solid_thermal_source
Thermal source in solid.
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.
virtual void value_list(const Armor::array &point_list, const ElementAccessor< spacedim > &elm, std::vector< typename Value::return_type > &value_list) const
void compute_sources_sigma(const Armor::array &point_list, const ElementAccessor< 3 > &ele_acc, std::vector< std::vector< double > > &sources_sigma) override
Field< 3, FieldValue< 3 >::Scalar > solid_ref_temperature
Reference temperature in solid.
virtual ModelEqData & data()=0
Derived class should implement getter for ModelEqData instance.
~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)
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.