www.mooseframework.org
PorousFlowPorosityConst.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
15 template <bool is_ad>
18 {
20  params.addRequiredCoupledVar(
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 
29 template <bool is_ad>
31  const InputParameters & parameters)
32  : PorousFlowPorosityBaseTempl<is_ad>(parameters), _input_porosity(coupledValue("porosity"))
33 {
34 }
35 
36 template <bool is_ad>
37 void
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 
44 template <bool is_ad>
45 void
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 
virtual void initQpStatefulProperties() override
static InputParameters validParams()
static InputParameters validParams()
Base class Material designed to provide the porosity.
registerMooseObject("PorousFlowApp", PorousFlowPorosityConst)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
PorousFlowPorosityConstTempl(const InputParameters &parameters)
Material to provide a constant value of porosity.
void addClassDescription(const std::string &doc_string)
virtual void computeQpProperties() override