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]);