https://mooseframework.inl.gov
PorousFlowFluidStateBaseMaterial.h
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 
10 #pragma once
11 
12 #include "PorousFlowVariableBase.h"
14 
16 
21 template <bool is_ad>
23 {
24 public:
26 
28 
29 protected:
30  virtual void initQpStatefulProperties() override;
31  virtual void computeQpProperties() override;
32 
34  virtual void setMaterialVectorSize() const;
35 
40  virtual void thermophysicalProperties() = 0;
41 
49 
51  const Real _T_c2k;
53  bool _is_initqp;
55  std::vector<FluidStateProperties> _fsp;
59  const std::string _sfx;
60 
83 
87 };
88 
89 #define usingPorousFlowFluidStateBaseMaterialMembers \
90  usingPorousFlowVariableBaseMembers; \
91  using Coupleable::coupledComponents; \
92  using Coupleable::getFieldVar; \
93  using Coupleable::isCoupled; \
94  using PorousFlowVariableBaseTempl<is_ad>::name; \
95  using PorousFlowVariableBaseTempl<is_ad>::_num_components; \
96  using PorousFlowVariableBaseTempl<is_ad>::_num_pf_vars; \
97  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_T_c2k; \
98  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_fsp; \
99  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_sfx; \
100  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_pc; \
101  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_is_initqp; \
102  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::genericValue; \
103  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::setMaterialVectorSize; \
104  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_mass_frac; \
105  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_grad_mass_frac_qp; \
106  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_fluid_density; \
107  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_fluid_viscosity; \
108  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_fluid_enthalpy; \
109  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_fluid_internal_energy
110 
111 #define usingPorousFlowFluidStateBaseMaterialDerivativeMembers \
112  usingPorousFlowFluidStateBaseMaterialMembers; \
113  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_dmass_frac_dvar; \
114  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_dfluid_density_dvar; \
115  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_dfluid_viscosity_dvar; \
116  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_dfluid_enthalpy_dvar; \
117  using PorousFlowFluidStateBaseMaterialTempl<is_ad>::_dfluid_internal_energy_dvar
MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_internal_energy_dvar
Derivative of the fluid internal energy for each phase wrt PorousFlow variables.
const PorousFlowCapillaryPressure & _pc
Capillary pressure UserObject.
Moose::GenericType< Real, is_ad > GenericReal
GenericMaterialProperty< std::vector< Real >, is_ad > & _fluid_viscosity
Viscosity of each phase.
const Real _T_c2k
Conversion from degrees Celsius to degrees Kelvin.
MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_viscosity_dvar
Derivative of the fluid viscosity for each phase wrt PorousFlow variables.
virtual void thermophysicalProperties()=0
Calculates all required thermophysical properties and derivatives for each phase and fluid component...
GenericReal< is_ad > genericValue(const ADReal &value)
Templated method that takes an ADReal value, and returns the raw value when is_ad = false...
GenericMaterialProperty< std::vector< Real >, is_ad > & _fluid_internal_energy
Internal energy of each phase.
GenericMaterialProperty< std::vector< std::vector< Real > >, is_ad > & _mass_frac
Mass fraction matrix (indexing is fluid component in fluid phase)
GenericMaterialProperty< std::vector< std::vector< RealGradient > >, is_ad > *const _grad_mass_frac_qp
Gradient of the mass fraction matrix (only defined at the qps)
Base class for capillary pressure for multiphase flow in porous media.
MaterialProperty< std::vector< std::vector< std::vector< Real > > > > *const _dmass_frac_dvar
Derivative of the mass fraction matrix with respect to the Porous Flow variables. ...
Base class for thermophysical variable materials, which assemble materials for primary variables such...
virtual void setMaterialVectorSize() const
Size material property vectors and initialise with zeros.
const std::string _sfx
Suffix to append to material property names (either qp or nodal as required)
Real value(unsigned n, unsigned alpha, unsigned beta, Real x)
typename GenericMaterialPropertyStruct< T, is_ad >::type GenericMaterialProperty
MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_enthalpy_dvar
Derivative of the fluid enthalpy for each phase wrt PorousFlow variables.
GenericMaterialProperty< std::vector< Real >, is_ad > & _fluid_density
Fluid density of each phase.
Fluid state base class using a persistent set of primary variables for multiphase, single and multicomponent cases.
bool _is_initqp
Flag to indicate whether stateful properties should be computed.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
GenericMaterialProperty< std::vector< Real >, is_ad > & _fluid_enthalpy
Enthalpy of each phase.
std::vector< FluidStateProperties > _fsp
FluidStateProperties data for each fluid component in each fluid phase.
PorousFlowFluidStateBaseMaterialTempl(const InputParameters &parameters)
MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables.