https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowMatrixInternalEnergyTempl< is_ad > Class Template Reference

This material computes internal energy (J/m^3) for a rock matrix assuming constant grain density, specific heat capacity, and a linear relationship with temperature. More...

#include <PorousFlowMatrixInternalEnergy.h>

Inheritance diagram for PorousFlowMatrixInternalEnergyTempl< is_ad >:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 PorousFlowMatrixInternalEnergyTempl (const InputParameters &parameters)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 
virtual void computeQpProperties () override
 

Protected Attributes

const Real _cp
 Specific heat capacity of rock grains. More...
 
const Real _density
 Density of rock grains (equals the density of the matrix if porosity=0) More...
 
const Real _heat_cap
 Heat capacity = _cp * _density. More...
 
const GenericMaterialProperty< Real, is_ad > & _temperature
 Temperature at the nodes. More...
 
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
 d(temperature at the nodes)/d(PorousFlow variable) More...
 
GenericMaterialProperty< Real, is_ad > & _energy
 Matrix internal_energy at the nodes. More...
 
MaterialProperty< std::vector< Real > > *const _denergy_dvar
 d(matrix internal energy)/d(PorousFlow variable) More...
 
const unsigned int _num_phases
 Number of phases. More...
 
const unsigned int _num_components
 Number of fluid components. More...
 
const unsigned int _num_var
 Number of PorousFlow variables. More...
 

Detailed Description

template<bool is_ad>
class PorousFlowMatrixInternalEnergyTempl< is_ad >

This material computes internal energy (J/m^3) for a rock matrix assuming constant grain density, specific heat capacity, and a linear relationship with temperature.

To get the volumetric heat capacity of the rock in a rock-fluid system, the result must be multiplied by (1 - porosity).

Definition at line 22 of file PorousFlowMatrixInternalEnergy.h.

Constructor & Destructor Documentation

◆ PorousFlowMatrixInternalEnergyTempl()

template<bool is_ad>
PorousFlowMatrixInternalEnergyTempl< is_ad >::PorousFlowMatrixInternalEnergyTempl ( const InputParameters parameters)

Definition at line 33 of file PorousFlowMatrixInternalEnergy.C.

35  : PorousFlowMaterialVectorBase(parameters),
36  _cp(getParam<Real>("specific_heat_capacity")),
37  _density(getParam<Real>("density")),
39  _temperature(is_ad ? getGenericMaterialProperty<Real, is_ad>("PorousFlow_temperature_qp")
40  : getGenericMaterialProperty<Real, is_ad>("PorousFlow_temperature_nodal")),
42  is_ad ? nullptr
43  : &getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")),
44  _energy(declareGenericProperty<Real, is_ad>("PorousFlow_matrix_internal_energy_nodal")),
45  _denergy_dvar(is_ad ? nullptr
46  : &declareProperty<std::vector<Real>>(
47  "dPorousFlow_matrix_internal_energy_nodal_dvar"))
48 {
49  if (!is_ad && _nodal_material != true)
50  mooseError("PorousFlowMatrixInternalEnergy classes are only defined for at_nodes = true");
51 }
const Real _heat_cap
Heat capacity = _cp * _density.
void mooseError(Args &&... args)
MaterialProperty< std::vector< Real > > *const _denergy_dvar
d(matrix internal energy)/d(PorousFlow variable)
const Real _density
Density of rock grains (equals the density of the matrix if porosity=0)
GenericMaterialProperty< Real, is_ad > & _energy
Matrix internal_energy at the nodes.
const GenericMaterialProperty< Real, is_ad > & _temperature
Temperature at the nodes.
PorousFlowMaterialVectorBase(const InputParameters &parameters)
const MaterialProperty< std::vector< Real > > *const _dtemperature_dvar
d(temperature at the nodes)/d(PorousFlow variable)
const Real _cp
Specific heat capacity of rock grains.

Member Function Documentation

◆ computeQpProperties()

template<bool is_ad>
void PorousFlowMatrixInternalEnergyTempl< is_ad >::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 62 of file PorousFlowMatrixInternalEnergy.C.

63 {
64  _energy[_qp] = _heat_cap * _temperature[_qp];
65 
66  if constexpr (!is_ad)
67  {
68  (*_denergy_dvar)[_qp].assign(_num_var, 0.0);
69  for (unsigned v = 0; v < _num_var; ++v)
70  (*_denergy_dvar)[_qp][v] = _heat_cap * (*_dtemperature_dvar)[_qp][v];
71  }
72 }
const Real _heat_cap
Heat capacity = _cp * _density.
MaterialProperty< std::vector< Real > > *const _denergy_dvar
d(matrix internal energy)/d(PorousFlow variable)
const unsigned int _num_var
Number of PorousFlow variables.
GenericMaterialProperty< Real, is_ad > & _energy
Matrix internal_energy at the nodes.
const GenericMaterialProperty< Real, is_ad > & _temperature
Temperature at the nodes.
static const std::string v
Definition: NS.h:84

◆ initQpStatefulProperties()

template<bool is_ad>
void PorousFlowMatrixInternalEnergyTempl< is_ad >::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 55 of file PorousFlowMatrixInternalEnergy.C.

56 {
57  _energy[_qp] = _heat_cap * _temperature[_qp];
58 }
const Real _heat_cap
Heat capacity = _cp * _density.
GenericMaterialProperty< Real, is_ad > & _energy
Matrix internal_energy at the nodes.
const GenericMaterialProperty< Real, is_ad > & _temperature
Temperature at the nodes.

◆ validParams()

template<bool is_ad>
InputParameters PorousFlowMatrixInternalEnergyTempl< is_ad >::validParams ( )
static

Definition at line 17 of file PorousFlowMatrixInternalEnergy.C.

18 {
20  params.addRequiredParam<Real>("specific_heat_capacity",
21  "Specific heat capacity of the rock grains (J/kg/K).");
22  params.addRequiredParam<Real>("density", "Density of the rock grains");
23  params.set<bool>("at_nodes") = is_ad ? false : true;
24  params.addPrivateParam<std::string>("pf_material_type", "matrix_internal_energy");
25  params.addClassDescription("This Material calculates the internal energy of solid rock grains, "
26  "which is specific_heat_capacity * density * temperature. Kernels "
27  "multiply this by (1 - porosity) to find the energy density of the "
28  "porous rock in a rock-fluid system");
29  return params;
30 }
void addPrivateParam(const std::string &name, const T &value)
T & set(const std::string &name, bool quiet_mode=false)
void addRequiredParam(const std::string &name, const std::string &doc_string)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _cp

template<bool is_ad>
const Real PorousFlowMatrixInternalEnergyTempl< is_ad >::_cp
protected

Specific heat capacity of rock grains.

Definition at line 34 of file PorousFlowMatrixInternalEnergy.h.

◆ _denergy_dvar

template<bool is_ad>
MaterialProperty<std::vector<Real> >* const PorousFlowMatrixInternalEnergyTempl< is_ad >::_denergy_dvar
protected

d(matrix internal energy)/d(PorousFlow variable)

Definition at line 52 of file PorousFlowMatrixInternalEnergy.h.

◆ _density

template<bool is_ad>
const Real PorousFlowMatrixInternalEnergyTempl< is_ad >::_density
protected

Density of rock grains (equals the density of the matrix if porosity=0)

Definition at line 37 of file PorousFlowMatrixInternalEnergy.h.

◆ _dtemperature_dvar

template<bool is_ad>
const MaterialProperty<std::vector<Real> >* const PorousFlowMatrixInternalEnergyTempl< is_ad >::_dtemperature_dvar
protected

d(temperature at the nodes)/d(PorousFlow variable)

Definition at line 46 of file PorousFlowMatrixInternalEnergy.h.

◆ _energy

template<bool is_ad>
GenericMaterialProperty<Real, is_ad>& PorousFlowMatrixInternalEnergyTempl< is_ad >::_energy
protected

Matrix internal_energy at the nodes.

Definition at line 49 of file PorousFlowMatrixInternalEnergy.h.

◆ _heat_cap

template<bool is_ad>
const Real PorousFlowMatrixInternalEnergyTempl< is_ad >::_heat_cap
protected

Heat capacity = _cp * _density.

Definition at line 40 of file PorousFlowMatrixInternalEnergy.h.

◆ _num_components

const unsigned int PorousFlowMaterialVectorBase::_num_components
protectedinherited

◆ _num_phases

const unsigned int PorousFlowMaterialVectorBase::_num_phases
protectedinherited

◆ _num_var

const unsigned int PorousFlowMaterialVectorBase::_num_var
protectedinherited

◆ _temperature

template<bool is_ad>
const GenericMaterialProperty<Real, is_ad>& PorousFlowMatrixInternalEnergyTempl< is_ad >::_temperature
protected

Temperature at the nodes.

Definition at line 43 of file PorousFlowMatrixInternalEnergy.h.


The documentation for this class was generated from the following files: