45 return arma::norm(vel, 2);
55 return csec * (por*f_rho*f_c + (1.-por)*s_rho*s_c);
65 return csec * (por * f_source + (1.-por) * s_source);
75 return csec * (por * f_rho * f_cap * f_sigma + (1.-por) * s_rho * s_cap * s_sigma);
84 inline Sclr operator() (
Sclr csec,
Sclr por,
Sclr f_rho,
Sclr f_cap,
Sclr f_sigma,
Sclr f_temp,
Sclr s_rho,
Sclr s_cap,
Sclr s_sigma,
Sclr s_temp,
Sclr sigma) {
85 if (fabs(sigma) > numeric_limits<double>::epsilon())
86 return csec * (por * f_rho * f_cap * f_sigma * f_temp + (1.-por) * s_rho * s_cap * s_sigma * s_temp);
99 return velocity * f_rho * f_cap;
114 if ( fabs(v_norm) > 0 )
115 for (
int i=0; i<3; i++)
116 for (
int j=0; j<3; j++)
117 dif_coef(i,j) = ( (velocity(i)/v_norm) * (velocity(j)/v_norm) * (disp_l-disp_t) + disp_t*(i==j?1:0))*v_norm*f_rho*f_cond;
122 dif_coef += c_sec * (por*f_cond + (1.-por)*s_cond) * arma::eye(3,3);
139 "Type of boundary condition.")
141 .input_default(
"\"inflow\"")
142 .input_selection( get_bc_type_selection() )
144 *
this+=bc_dirichlet_value
145 .name(
"bc_temperature")
146 .description(
"Boundary value of temperature.")
148 .input_default(
"0.0")
151 .disable_where(bc_type, { bc_dirichlet, bc_inflow })
153 .description(
"Flux in Neumann boundary condition.")
154 .units(
UnitSI().kg().m().s(-1).md() )
155 .input_default(
"0.0")
157 *
this+=bc_robin_sigma
158 .disable_where(bc_type, { bc_dirichlet, bc_inflow })
159 .name(
"bc_robin_sigma")
160 .description(
"Conductivity coefficient in Robin boundary condition.")
161 .units(
UnitSI().m(4).s(-1).md() )
162 .input_default(
"0.0")
165 *
this+=init_condition
166 .name(
"init_temperature")
167 .description(
"Initial temperature.")
169 .input_default(
"0.0");
173 .description(
"Porosity.")
175 .input_default(
"1.0")
176 .flags_add(in_main_matrix & in_time_term)
180 .name(
"water_content")
182 .input_default(
"1.0")
183 .flags_add(input_copy & in_main_matrix & in_time_term);
185 *
this += flow_flux.name(
"flow_flux")
187 .flags_add(in_time_term & in_main_matrix & in_rhs);
190 .name(
"fluid_density")
191 .description(
"Density of fluid.")
192 .units(
UnitSI().kg().m(-3) )
193 .input_default(
"1000")
194 .flags_add(in_main_matrix & in_time_term);
196 *
this+=fluid_heat_capacity
197 .name(
"fluid_heat_capacity")
198 .description(
"Heat capacity of fluid.")
200 .flags_add(in_main_matrix & in_time_term);
202 *
this+=fluid_heat_conductivity
203 .name(
"fluid_heat_conductivity")
204 .description(
"Heat conductivity of fluid.")
206 .flags_add(in_main_matrix)
211 .name(
"solid_density")
212 .description(
"Density of solid (rock).")
213 .units(
UnitSI().kg().m(-3) )
214 .input_default(
"0.0")
215 .flags_add(in_time_term);
217 *
this+=solid_heat_capacity
218 .name(
"solid_heat_capacity")
219 .description(
"Heat capacity of solid (rock).")
221 .input_default(
"0.0")
222 .flags_add(in_time_term);
224 *
this+=solid_heat_conductivity
225 .name(
"solid_heat_conductivity")
226 .description(
"Heat conductivity of solid (rock).")
228 .input_default(
"0.0")
229 .flags_add(in_main_matrix)
234 .description(
"Longitudinal heat dispersivity in fluid.")
236 .input_default(
"0.0")
237 .flags_add(in_main_matrix);
241 .description(
"Transverse heat dispersivity in fluid.")
243 .input_default(
"0.0")
244 .flags_add(in_main_matrix);
246 *
this+=fluid_thermal_source
247 .name(
"fluid_thermal_source")
248 .description(
"Density of thermal source in fluid.")
250 .input_default(
"0.0")
253 *
this+=solid_thermal_source
254 .name(
"solid_thermal_source")
255 .description(
"Density of thermal source in solid.")
257 .input_default(
"0.0")
260 *
this+=fluid_heat_exchange_rate
261 .name(
"fluid_heat_exchange_rate")
262 .description(
"Heat exchange rate of source in fluid.")
264 .input_default(
"0.0")
267 *
this+=solid_heat_exchange_rate
268 .name(
"solid_heat_exchange_rate")
269 .description(
"Heat exchange rate of source in solid.")
271 .input_default(
"0.0")
274 *
this+=fluid_ref_temperature
275 .name(
"fluid_ref_temperature")
276 .description(
"Reference temperature of source in fluid.")
278 .input_default(
"0.0")
281 *
this+=solid_ref_temperature
282 .name(
"solid_ref_temperature")
283 .description(
"Reference temperature in solid.")
285 .input_default(
"0.0")
289 .name(
"cross_section")
290 .units(
UnitSI().m(3).md() )
291 .flags(input_copy & in_time_term & in_main_matrix);
295 .description(
"Temperature solution.")
297 .flags(equation_result);
301 *
this += v_norm.name(
"v_norm")
302 .description(
"Velocity norm field.")
303 .input_default(
"0.0")
304 .units(
UnitSI().m().s(-1) );
306 *
this += mass_matrix_coef.name(
"mass_matrix_coef")
307 .description(
"Matrix coefficients computed by model in mass assemblation.")
308 .input_default(
"0.0")
309 .units(
UnitSI().m(3).md() );
311 *
this += retardation_coef.name(
"retardation_coef")
312 .description(
"Retardation coefficients computed by model in mass assemblation.")
313 .input_default(
"0.0")
314 .units(
UnitSI().m(3).md() );
316 *
this += sources_conc_out.name(
"sources_conc_out")
317 .description(
"Concentration sources output.")
318 .input_default(
"0.0")
319 .units(
UnitSI().kg().m(-3) );
321 *
this += sources_density_out.name(
"sources_density_out")
322 .description(
"Concentration sources output - density of substance source, only positive part is used..")
323 .input_default(
"0.0")
324 .units(
UnitSI().kg().s(-1).md() );
326 *
this += sources_sigma_out.name(
"sources_sigma_out")
327 .description(
"Concentration sources - Robin type, in_flux = sources_sigma * (sources_conc - mobile_conc).")
328 .input_default(
"0.0")
329 .units(
UnitSI().s(-1).m(3).md() );
331 *
this += advection_coef.name(
"advection_coef")
332 .description(
"Advection coefficients model.")
333 .input_default(
"0.0")
334 .units(
UnitSI().m().s(-1) );
336 *
this += diffusion_coef.name(
"diffusion_coef")
337 .description(
"Diffusion coefficients model.")
338 .input_default(
"0.0")
339 .units(
UnitSI().m(2).s(-1) );
347 mass_matrix_coef.set(
349 fn_heat_mass_matrix(), cross_section, porosity, fluid_density, fluid_heat_capacity, solid_density, solid_heat_capacity
354 sources_density_out.set(
358 sources_sigma_out.set(
360 fn_heat_sources_sigma(), cross_section, porosity, fluid_density, fluid_heat_capacity, fluid_heat_exchange_rate, solid_density,
361 solid_heat_capacity, solid_heat_exchange_rate
365 sources_conc_out.set(
367 fn_heat_sources_conc(), cross_section, porosity, fluid_density, fluid_heat_capacity, fluid_heat_exchange_rate, fluid_ref_temperature,
368 solid_density, solid_heat_capacity, solid_heat_exchange_rate, solid_ref_temperature, sources_sigma_out
375 fn_heat_diff_coef(), flow_flux, v_norm, fluid_density, disp_l, disp_t, fluid_heat_conductivity, solid_heat_conductivity, cross_section, porosity
383 return Selection(
"Heat_BC_Type",
"Types of boundary conditions for heat transfer model.")
385 "Default heat transfer boundary condition.\n"
386 "On water inflow (($(q_w \\le 0)$)), total energy flux is given by the reference temperature 'bc_temperature'. "
387 "On water outflow we prescribe zero diffusive flux, "
388 "i.e. the energy flows out only due to advection.")
390 "Dirichlet boundary condition (($T = T_D $)).\n"
391 "The prescribed temperature (($T_D$)) is specified by the field 'bc_temperature'.")
393 "Total energy flux boundary condition.\n"
394 "The prescribed incoming total flux can have the general form (($\\delta(f_N+\\sigma_R(T_R-T) )$)), "
395 "where the absolute flux (($f_N$)) is specified by the field 'bc_flux', "
396 "the transition parameter (($\\sigma_R$)) by 'bc_robin_sigma', "
397 "and the reference temperature (($T_R$)) by 'bc_temperature'.")
398 .
add_value(bc_diffusive_flux,
"diffusive_flux",
399 "Diffusive flux boundary condition.\n"
400 "The prescribed incoming energy flux due to diffusion can have the general form (($\\delta(f_N+\\sigma_R(T_R-T) )$)), "
401 "where the absolute flux (($f_N$)) is specified by the field 'bc_flux', "
402 "the transition parameter (($\\sigma_R$)) by 'bc_robin_sigma', "
403 "and the reference temperature (($T_R$)) by 'bc_temperature'.")
413 std::string(ModelEqData::name()) +
"_DG_output_fields",
414 "Selection of output fields for Heat Transfer DG model.");
422 std::string(ModelEqData::name()) +
"_" + implementation,
423 description +
" for heat transfer.")
427 "Settings for computing balance.")
429 "Parameters of output stream.");
static Input::Type::Abstract & get_input_type()
Common specification of the input record for secondary equations.
static const Input::Type::Record & get_input_type()
Main balance input record type.
static Input::Type::Record & record_template()
Template Record with common keys for derived equations.
std::shared_ptr< Balance > balance_
object for calculation and writing the mass balance to file.
static constexpr Mask input_copy
static constexpr Mask in_rhs
A field is part of the right hand side of the equation.
static constexpr Mask in_main_matrix
A field is part of main "stiffness matrix" of the equation.
static IT::Selection get_output_selection()
vector< unsigned int > subst_idx_
List of indices used to call balance methods for a set of quantities.
static const Input::Type::Selection & get_bc_type_selection()
void init_balance(const Input::Record &in_rec)
~HeatTransferModel() override
HeatTransferModel(Mesh &mesh, const Input::Record in_rec)
std::shared_ptr< OutputTime > output_stream_
virtual ModelEqData & eq_data()=0
Derived class should implement getter for ModelEqData instance.
static const Input::Type::Record & get_input_type()
The specification of output stream.
static std::shared_ptr< OutputTime > create_output_stream(const std::string &equation_name, const Input::Record &in_rec, const std::shared_ptr< TimeUnitConversion > &time_unit_conv)
This method delete all object instances of class OutputTime stored in output_streams vector.
Basic time management functionality for unsteady (and steady) solvers (class Equation).
Class for representation SI units of Fields.
static UnitSI & J()
Returns Joule.
static UnitSI & W()
Returns Watt.
static UnitSI & dimensionless()
Returns dimensionless unit.
Discontinuous Galerkin method for equation of transport with dispersion.