https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowPorosityConst.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{
21 "porosity",
22 "The porosity (assumed indepenent of porepressure, temperature, "
23 "strain, etc, for this material). This should be a real number, or "
24 "a constant monomial variable (not a linear lagrange or other kind of variable).");
25 params.addClassDescription("This Material calculates the porosity assuming it is constant");
26 return params;
27}
28
29template <bool is_ad>
31 const InputParameters & parameters)
32 : PorousFlowPorosityBaseTempl<is_ad>(parameters), _input_porosity(coupledValue("porosity"))
33{
34}
35
36template <bool is_ad>
37void
39{
40 // note the [0] below: _phi0 is a constant monomial and we use [0] regardless of _nodal_material
41 _porosity[_qp] = _input_porosity[0];
42}
43
44template <bool is_ad>
45void
47{
48 initQpStatefulProperties();
49
50 if (!is_ad)
51 {
52 // The derivatives are zero for all time
53 (*_dporosity_dvar)[_qp].assign(_num_var, 0.0);
54 (*_dporosity_dgradvar)[_qp].assign(_num_var, RealGradient());
55 }
56}
57
registerMooseObject("PorousFlowApp", PorousFlowPorosityConst)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
Base class Material designed to provide the porosity.
static InputParameters validParams()
Material to provide a constant value of porosity.
PorousFlowPorosityConstTempl(const InputParameters &parameters)
static InputParameters validParams()
virtual void computeQpProperties() override
virtual void initQpStatefulProperties() override