https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowThermalConductivityFromPorosity.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
11
14
15template <bool is_ad>
18{
20 params.addRequiredParam<RealTensorValue>("lambda_s",
21 "The thermal conductivity of the solid matrix material");
22 params.addRequiredParam<RealTensorValue>("lambda_f",
23 "The thermal conductivity of the single fluid phase");
24 params.addClassDescription("This Material calculates rock-fluid combined thermal conductivity "
25 "for the single phase, fully saturated case by using a linear "
26 "weighted average. "
27 "Thermal conductivity = phi * lambda_f + (1 - phi) * lambda_s, "
28 "where phi is porosity, and lambda_f, lambda_s are "
29 "thermal conductivities of the fluid and solid (assumed constant)");
30 return params;
31}
32
33template <bool is_ad>
36 : PorousFlowThermalConductivityBaseTempl<is_ad>(parameters),
37 _la_s(this->template getParam<RealTensorValue>("lambda_s")),
38 _la_f(this->template getParam<RealTensorValue>("lambda_f")),
39 _porosity_qp(this->template getGenericMaterialProperty<Real, is_ad>("PorousFlow_porosity_qp")),
40 _dporosity_qp_dvar(is_ad ? nullptr
41 : &this->template getMaterialProperty<std::vector<Real>>(
42 "dPorousFlow_porosity_qp_dvar"))
43{
44 if (_num_phases != 1)
45 this->paramError("fluid_phase",
46 "The Dictator proclaims that the number of phases is ",
47 _dictator.numPhases(),
48 " whereas this material can only be used for single phase "
49 "simulations. Be aware that the Dictator has noted your mistake.");
50}
51
52template <bool is_ad>
53void
55{
56 _la_qp[_qp] = _la_s * (1.0 - _porosity_qp[_qp]) + _la_f * _porosity_qp[_qp];
57
58 if constexpr (!is_ad)
59 {
60 (*_dla_qp_dvar)[_qp].assign(_num_var, RealTensorValue());
61 for (const auto v : make_range(_num_var))
62 (*_dla_qp_dvar)[_qp][v] = (_la_f - _la_s) * (*_dporosity_qp_dvar)[_qp][v];
63 }
64}
65
const double v
registerMooseObject("PorousFlowApp", PorousFlowThermalConductivityFromPorosity)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
const unsigned int _num_phases
Number of phases.
Base class for materials that provide thermal conducitivity.
This Material calculates rock-fluid combined thermal conductivity for the single phase,...