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 .flags_add(in_time_term);
216 *
this+=solid_heat_capacity
217 .name(
"solid_heat_capacity")
218 .description(
"Heat capacity of solid (rock).")
220 .flags_add(in_time_term);
222 *
this+=solid_heat_conductivity
223 .name(
"solid_heat_conductivity")
224 .description(
"Heat conductivity of solid (rock).")
226 .flags_add(in_main_matrix)
231 .description(
"Longitudinal heat dispersivity in fluid.")
233 .input_default(
"0.0")
234 .flags_add(in_main_matrix);
238 .description(
"Transverse heat dispersivity in fluid.")
240 .input_default(
"0.0")
241 .flags_add(in_main_matrix);
243 *
this+=fluid_thermal_source
244 .name(
"fluid_thermal_source")
245 .description(
"Density of thermal source in fluid.")
247 .input_default(
"0.0")
250 *
this+=solid_thermal_source
251 .name(
"solid_thermal_source")
252 .description(
"Density of thermal source in solid.")
254 .input_default(
"0.0")
257 *
this+=fluid_heat_exchange_rate
258 .name(
"fluid_heat_exchange_rate")
259 .description(
"Heat exchange rate of source in fluid.")
261 .input_default(
"0.0")
264 *
this+=solid_heat_exchange_rate
265 .name(
"solid_heat_exchange_rate")
266 .description(
"Heat exchange rate of source in solid.")
268 .input_default(
"0.0")
271 *
this+=fluid_ref_temperature
272 .name(
"fluid_ref_temperature")
273 .description(
"Reference temperature of source in fluid.")
275 .input_default(
"0.0")
278 *
this+=solid_ref_temperature
279 .name(
"solid_ref_temperature")
280 .description(
"Reference temperature in solid.")
282 .input_default(
"0.0")
286 .name(
"cross_section")
287 .units(
UnitSI().m(3).md() )
288 .flags(input_copy & in_time_term & in_main_matrix);
292 .description(
"Temperature solution.")
294 .flags(equation_result);
298 *
this += v_norm.name(
"v_norm")
299 .description(
"Velocity norm field.")
300 .input_default(
"0.0")
301 .units(
UnitSI().m().s(-1) );
303 *
this += mass_matrix_coef.name(
"mass_matrix_coef")
304 .description(
"Matrix coefficients computed by model in mass assemblation.")
305 .input_default(
"0.0")
306 .units(
UnitSI().m(3).md() );
308 *
this += retardation_coef.name(
"retardation_coef")
309 .description(
"Retardation coefficients computed by model in mass assemblation.")
310 .input_default(
"0.0")
311 .units(
UnitSI().m(3).md() );
313 *
this += sources_conc_out.name(
"sources_conc_out")
314 .description(
"Concentration sources output.")
315 .input_default(
"0.0")
316 .units(
UnitSI().kg().m(-3) );
318 *
this += sources_density_out.name(
"sources_density_out")
319 .description(
"Concentration sources output - density of substance source, only positive part is used..")
320 .input_default(
"0.0")
321 .units(
UnitSI().kg().s(-1).md() );
323 *
this += sources_sigma_out.name(
"sources_sigma_out")
324 .description(
"Concentration sources - Robin type, in_flux = sources_sigma * (sources_conc - mobile_conc).")
325 .input_default(
"0.0")
326 .units(
UnitSI().s(-1).m(3).md() );
328 *
this += advection_coef.name(
"advection_coef")
329 .description(
"Advection coefficients model.")
330 .input_default(
"0.0")
331 .units(
UnitSI().m().s(-1) );
333 *
this += diffusion_coef.name(
"diffusion_coef")
334 .description(
"Diffusion coefficients model.")
335 .input_default(
"0.0")
336 .units(
UnitSI().m(2).s(-1) );
344 mass_matrix_coef.set(
346 fn_heat_mass_matrix(), cross_section, porosity, fluid_density, fluid_heat_capacity, solid_density, solid_heat_capacity
351 sources_density_out.set(
355 sources_sigma_out.set(
357 fn_heat_sources_sigma(), cross_section, porosity, fluid_density, fluid_heat_capacity, fluid_heat_exchange_rate, solid_density,
358 solid_heat_capacity, solid_heat_exchange_rate
362 sources_conc_out.set(
364 fn_heat_sources_conc(), cross_section, porosity, fluid_density, fluid_heat_capacity, fluid_heat_exchange_rate, fluid_ref_temperature,
365 solid_density, solid_heat_capacity, solid_heat_exchange_rate, solid_ref_temperature, sources_sigma_out
372 fn_heat_diff_coef(), flow_flux, v_norm, fluid_density, disp_l, disp_t, fluid_heat_conductivity, solid_heat_conductivity, cross_section, porosity
380 return Selection(
"Heat_BC_Type",
"Types of boundary conditions for heat transfer model.")
382 "Default heat transfer boundary condition.\n"
383 "On water inflow (($(q_w \\le 0)$)), total energy flux is given by the reference temperature 'bc_temperature'. "
384 "On water outflow we prescribe zero diffusive flux, "
385 "i.e. the energy flows out only due to advection.")
387 "Dirichlet boundary condition (($T = T_D $)).\n"
388 "The prescribed temperature (($T_D$)) is specified by the field 'bc_temperature'.")
390 "Total energy flux boundary condition.\n"
391 "The prescribed incoming total flux can have the general form (($\\delta(f_N+\\sigma_R(T_R-T) )$)), "
392 "where the absolute flux (($f_N$)) is specified by the field 'bc_flux', "
393 "the transition parameter (($\\sigma_R$)) by 'bc_robin_sigma', "
394 "and the reference temperature (($T_R$)) by 'bc_temperature'.")
395 .
add_value(bc_diffusive_flux,
"diffusive_flux",
396 "Diffusive flux boundary condition.\n"
397 "The prescribed incoming energy flux due to diffusion can have the general form (($\\delta(f_N+\\sigma_R(T_R-T) )$)), "
398 "where the absolute flux (($f_N$)) is specified by the field 'bc_flux', "
399 "the transition parameter (($\\sigma_R$)) by 'bc_robin_sigma', "
400 "and the reference temperature (($T_R$)) by 'bc_temperature'.")
410 std::string(ModelEqData::name()) +
"_DG_output_fields",
411 "Selection of output fields for Heat Transfer DG model.");
419 std::string(ModelEqData::name()) +
"_" + implementation,
420 description +
" for heat transfer.")
424 "Settings for computing balance.")
426 "Parameters of output stream.");