www.mooseframework.org
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
PorousFlowJoiner Class Reference

Material designed to form a std::vector of property and derivatives of these wrt the nonlinear variables from the individual phase properties. More...

#include <PorousFlowJoiner.h>

Inheritance diagram for PorousFlowJoiner:
[legend]

Public Member Functions

 PorousFlowJoiner (const InputParameters &parameters)
 

Protected Member Functions

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

Protected Attributes

const std::string _pf_prop
 Name of material property to be joined. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
 Derivatives of porepressure variable wrt PorousFlow variables at the qps or nodes. More...
 
const MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
 Derivatives of saturation variable wrt PorousFlow variables at the qps or nodes. More...
 
const MaterialProperty< std::vector< Real > > & _dtemperature_dvar
 Derivatives of temperature variable wrt PorousFlow variables at the qps or nodes. More...
 
MaterialProperty< std::vector< Real > > & _property
 Computed property of the phase. More...
 
MaterialProperty< std::vector< std::vector< Real > > > & _dproperty_dvar
 d(property)/d(PorousFlow variable) More...
 
std::vector< const MaterialProperty< Real > * > _phase_property
 Property of each phase. More...
 
std::vector< const MaterialProperty< Real > * > _dphase_property_dp
 d(property of each phase)/d(pressure) More...
 
std::vector< const MaterialProperty< Real > * > _dphase_property_ds
 d(property of each phase)/d(saturation) More...
 
std::vector< const MaterialProperty< Real > * > _dphase_property_dt
 d(property of each phase)/d(temperature) 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

Material designed to form a std::vector of property and derivatives of these wrt the nonlinear variables from the individual phase properties.

Values at the quadpoint or the nodes are formed depending on _at_qps

Properties can be viscosities, densities, thermal conductivities , etc and the user specifies the property they are interested in using the pf_prop string.

Also, using d(property)/dP, d(property)/dS, etc, and dP/dvar, dS/dvar, etc, the matrix of derivatives of property with respect to the nonlinear Variables, var, are computed.

Only values at the nodes are used - not at the quadpoints

Definition at line 37 of file PorousFlowJoiner.h.

Constructor & Destructor Documentation

◆ PorousFlowJoiner()

PorousFlowJoiner::PorousFlowJoiner ( const InputParameters &  parameters)

Definition at line 29 of file PorousFlowJoiner.C.

30  : PorousFlowMaterialVectorBase(parameters),
31  _pf_prop(getParam<std::string>("material_property")),
32  _dporepressure_dvar(!_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
33  "dPorousFlow_porepressure_qp_dvar")
34  : getMaterialProperty<std::vector<std::vector<Real>>>(
35  "dPorousFlow_porepressure_nodal_dvar")),
36  _dsaturation_dvar(!_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
37  "dPorousFlow_saturation_qp_dvar")
38  : getMaterialProperty<std::vector<std::vector<Real>>>(
39  "dPorousFlow_saturation_nodal_dvar")),
41  !_nodal_material
42  ? getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar")
43  : getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")),
44  _property(declareProperty<std::vector<Real>>(_pf_prop)),
45  _dproperty_dvar(declareProperty<std::vector<std::vector<Real>>>("d" + _pf_prop + "_dvar"))
46 {
51 
52  for (unsigned int ph = 0; ph < _num_phases; ++ph)
53  {
54  std::string phase = Moose::stringify(ph);
55  _phase_property[ph] = &getMaterialProperty<Real>(_pf_prop + phase);
57  &getMaterialPropertyDerivative<Real>(_pf_prop + phase, _pressure_variable_name);
59  &getMaterialPropertyDerivative<Real>(_pf_prop + phase, _saturation_variable_name);
61  &getMaterialPropertyDerivative<Real>(_pf_prop + phase, _temperature_variable_name);
62  }
63 }
std::vector< const MaterialProperty< Real > * > _dphase_property_dt
d(property of each phase)/d(temperature)
const unsigned int _num_phases
Number of phases.
MaterialProperty< std::vector< Real > > & _property
Computed property of the phase.
const MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
Derivatives of porepressure variable wrt PorousFlow variables at the qps or nodes.
std::vector< const MaterialProperty< Real > * > _dphase_property_ds
d(property of each phase)/d(saturation)
const std::string _pf_prop
Name of material property to be joined.
PorousFlowMaterialVectorBase(const InputParameters &parameters)
std::vector< const MaterialProperty< Real > * > _phase_property
Property of each phase.
const MaterialProperty< std::vector< Real > > & _dtemperature_dvar
Derivatives of temperature variable wrt PorousFlow variables at the qps or nodes. ...
std::vector< const MaterialProperty< Real > * > _dphase_property_dp
d(property of each phase)/d(pressure)
MaterialProperty< std::vector< std::vector< Real > > > & _dproperty_dvar
d(property)/d(PorousFlow variable)
const MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
Derivatives of saturation variable wrt PorousFlow variables at the qps or nodes.

Member Function Documentation

◆ computeQpProperties()

void PorousFlowJoiner::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 75 of file PorousFlowJoiner.C.

76 {
78 
79  _dproperty_dvar[_qp].resize(_num_phases);
80  for (unsigned int ph = 0; ph < _num_phases; ++ph)
81  {
82  _dproperty_dvar[_qp][ph].resize(_num_var);
83  for (unsigned v = 0; v < _num_var; ++v)
84  {
85  // the "if" conditions in the following are because a nodal_material's derivatives might
86  // not have been defined. If that is the case, then DerivativeMaterial passes back a
87  // MaterialProperty with zeroes (for the derivatives), but that property will be sized
88  // by the number of quadpoints in the element, which may be smaller than the number of
89  // nodes!
90  _dproperty_dvar[_qp][ph][v] = 0.0;
91  if ((*_dphase_property_dp[ph]).size() > _qp)
92  _dproperty_dvar[_qp][ph][v] +=
93  (*_dphase_property_dp[ph])[_qp] * _dporepressure_dvar[_qp][ph][v];
94  if ((*_dphase_property_ds[ph]).size() > _qp)
95  _dproperty_dvar[_qp][ph][v] +=
96  (*_dphase_property_ds[ph])[_qp] * _dsaturation_dvar[_qp][ph][v];
97  if ((*_dphase_property_dt[ph]).size() > _qp)
98  _dproperty_dvar[_qp][ph][v] += (*_dphase_property_dt[ph])[_qp] * _dtemperature_dvar[_qp][v];
99  }
100  }
101 }
std::vector< const MaterialProperty< Real > * > _dphase_property_dt
d(property of each phase)/d(temperature)
const unsigned int _num_phases
Number of phases.
const MaterialProperty< std::vector< std::vector< Real > > > & _dporepressure_dvar
Derivatives of porepressure variable wrt PorousFlow variables at the qps or nodes.
std::vector< const MaterialProperty< Real > * > _dphase_property_ds
d(property of each phase)/d(saturation)
virtual void initQpStatefulProperties() override
const unsigned int _num_var
Number of PorousFlow variables.
const MaterialProperty< std::vector< Real > > & _dtemperature_dvar
Derivatives of temperature variable wrt PorousFlow variables at the qps or nodes. ...
std::vector< const MaterialProperty< Real > * > _dphase_property_dp
d(property of each phase)/d(pressure)
MaterialProperty< std::vector< std::vector< Real > > > & _dproperty_dvar
d(property)/d(PorousFlow variable)
const MaterialProperty< std::vector< std::vector< Real > > > & _dsaturation_dvar
Derivatives of saturation variable wrt PorousFlow variables at the qps or nodes.

◆ initQpStatefulProperties()

void PorousFlowJoiner::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 66 of file PorousFlowJoiner.C.

Referenced by computeQpProperties().

67 {
68  _property[_qp].resize(_num_phases);
69 
70  for (unsigned int ph = 0; ph < _num_phases; ++ph)
71  _property[_qp][ph] = (*_phase_property[ph])[_qp];
72 }
const unsigned int _num_phases
Number of phases.
MaterialProperty< std::vector< Real > > & _property
Computed property of the phase.
std::vector< const MaterialProperty< Real > * > _phase_property
Property of each phase.

Member Data Documentation

◆ _dphase_property_dp

std::vector<const MaterialProperty<Real> *> PorousFlowJoiner::_dphase_property_dp
protected

d(property of each phase)/d(pressure)

Definition at line 68 of file PorousFlowJoiner.h.

Referenced by computeQpProperties(), and PorousFlowJoiner().

◆ _dphase_property_ds

std::vector<const MaterialProperty<Real> *> PorousFlowJoiner::_dphase_property_ds
protected

d(property of each phase)/d(saturation)

Definition at line 71 of file PorousFlowJoiner.h.

Referenced by computeQpProperties(), and PorousFlowJoiner().

◆ _dphase_property_dt

std::vector<const MaterialProperty<Real> *> PorousFlowJoiner::_dphase_property_dt
protected

d(property of each phase)/d(temperature)

Definition at line 74 of file PorousFlowJoiner.h.

Referenced by computeQpProperties(), and PorousFlowJoiner().

◆ _dporepressure_dvar

const MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowJoiner::_dporepressure_dvar
protected

Derivatives of porepressure variable wrt PorousFlow variables at the qps or nodes.

Definition at line 50 of file PorousFlowJoiner.h.

Referenced by computeQpProperties().

◆ _dproperty_dvar

MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowJoiner::_dproperty_dvar
protected

d(property)/d(PorousFlow variable)

Definition at line 62 of file PorousFlowJoiner.h.

Referenced by computeQpProperties().

◆ _dsaturation_dvar

const MaterialProperty<std::vector<std::vector<Real> > >& PorousFlowJoiner::_dsaturation_dvar
protected

Derivatives of saturation variable wrt PorousFlow variables at the qps or nodes.

Definition at line 53 of file PorousFlowJoiner.h.

Referenced by computeQpProperties().

◆ _dtemperature_dvar

const MaterialProperty<std::vector<Real> >& PorousFlowJoiner::_dtemperature_dvar
protected

Derivatives of temperature variable wrt PorousFlow variables at the qps or nodes.

Definition at line 56 of file PorousFlowJoiner.h.

Referenced by computeQpProperties().

◆ _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

◆ _pf_prop

const std::string PorousFlowJoiner::_pf_prop
protected

Name of material property to be joined.

Definition at line 47 of file PorousFlowJoiner.h.

Referenced by PorousFlowJoiner().

◆ _phase_property

std::vector<const MaterialProperty<Real> *> PorousFlowJoiner::_phase_property
protected

Property of each phase.

Definition at line 65 of file PorousFlowJoiner.h.

Referenced by initQpStatefulProperties(), and PorousFlowJoiner().

◆ _property

MaterialProperty<std::vector<Real> >& PorousFlowJoiner::_property
protected

Computed property of the phase.

Definition at line 59 of file PorousFlowJoiner.h.

Referenced by initQpStatefulProperties().


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