https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowTotalGravitationalDensityFullySaturatedFromPorosity.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
13
16{
19 "rho_s", "rho_s >= 0", "The density of the solid matrix");
21 "This Material calculates the porous medium density from the porosity, solid density "
22 "(assumed constant) and fluid density, for the fully-saturated single fluid phase case, "
23 "using a linear weighted average. "
24 "density = phi * rho_f + (1 - phi) * rho_s, where phi is porosity and rho_f, rho_s are "
25 "the densities of the fluid and solid phases.");
26 return params;
27}
28
31 const InputParameters & parameters)
33 _rho_s(getParam<Real>("rho_s")),
34 _rho_f_qp(getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_density_qp")),
35 _porosity_qp(getMaterialProperty<Real>("PorousFlow_porosity_qp")),
36 _drho_f_qp_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
37 "dPorousFlow_fluid_phase_density_qp_dvar")),
38 _dporosity_qp_dvar(getMaterialProperty<std::vector<Real>>("dPorousFlow_porosity_qp_dvar"))
39{
40 if (_num_phases != 1)
41 mooseError("The Dictator proclaims that the number of phases is ",
42 _dictator.numPhases(),
43 " whereas PorousFlowThermalConductivityFromPorosity can only be used for 1-phase "
44 "simulations. Be aware that the Dictator has noted your mistake.");
45
46 if (_nodal_material == true)
47 mooseError("PorousFlowTotalGravitationalDensityFullySaturatedFromPorosity is only defined for "
48 "at_nodes = false");
49}
50
51void
57
58void
60{
61 const unsigned ph = 0;
62 _gravdensity[_qp] = _rho_s * (1.0 - _porosity_qp[_qp]) + _rho_f_qp[_qp][ph] * _porosity_qp[_qp];
63
65 for (unsigned int v = 0; v < _num_var; ++v)
66 {
67 _dgravdensity_dvar[_qp][v] = _dporosity_qp_dvar[_qp][v] * (_rho_f_qp[_qp][ph] - _rho_s) +
68 _drho_f_qp_dvar[_qp][ph][v] * _porosity_qp[_qp];
69 }
70}
const double v
void mooseError(Args &&... args)
registerMooseObject("PorousFlowApp", PorousFlowTotalGravitationalDensityFullySaturatedFromPorosity)
void addRequiredRangeCheckedParam(const std::string &name, const std::string &parsed_function, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
virtual void resize(const std::size_t size) override final
const unsigned int _num_phases
Number of phases.
const unsigned int _num_var
Number of PorousFlow variables.
Base class Material designed to provide the density of the porous medium.
MaterialProperty< std::vector< Real > > & _dgravdensity_dvar
d(density)/d(PorousFlow variable)
MaterialProperty< Real > & _gravdensity
Computed density at quadpoints.
Material designed to provide the density of the porous medium for the fully-saturated case.
const MaterialProperty< std::vector< std::vector< Real > > > & _drho_f_qp_dvar
d(rho_f)/d(PorousFlow variable)
const MaterialProperty< std::vector< Real > > & _dporosity_qp_dvar
d(porosity)/d(PorousFlow variable)