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 VariableName _pressure_variable_name
 Name of (dummy) pressure variable. More...
 
const VariableName _saturation_variable_name
 Name of (dummy) saturation variable. More...
 
const VariableName _temperature_variable_name
 Name of (dummy) temperature variable. More...
 
const VariableName _mass_fraction_variable_name
 Name of (dummy) mass fraction variable. More...
 
const std::string _pf_prop
 Name of material property to be joined. More...
 
const bool _include_old
 Whether to include old variables. 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.

Old values are included if include_old=true 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 ( const InputParameters &  parameters)

Definition at line 26 of file PorousFlowJoiner.C.

27  : PorousFlowMaterialVectorBase(parameters),
28 
29  _pressure_variable_name(_dictator.pressureVariableNameDummy()),
30  _saturation_variable_name(_dictator.saturationVariableNameDummy()),
31  _temperature_variable_name(_dictator.temperatureVariableNameDummy()),
32  _mass_fraction_variable_name(_dictator.massFractionVariableNameDummy()),
33  _pf_prop(getParam<std::string>("material_property")),
34  _include_old(getParam<bool>("include_old")),
35 
36  _dporepressure_dvar(!_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
37  "dPorousFlow_porepressure_qp_dvar")
38  : getMaterialProperty<std::vector<std::vector<Real>>>(
39  "dPorousFlow_porepressure_nodal_dvar")),
40  _dsaturation_dvar(!_nodal_material ? getMaterialProperty<std::vector<std::vector<Real>>>(
41  "dPorousFlow_saturation_qp_dvar")
42  : getMaterialProperty<std::vector<std::vector<Real>>>(
43  "dPorousFlow_saturation_nodal_dvar")),
45  !_nodal_material
46  ? getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_qp_dvar")
47  : getMaterialProperty<std::vector<Real>>("dPorousFlow_temperature_nodal_dvar")),
48 
49  _property(declareProperty<std::vector<Real>>(_pf_prop)),
50  _dproperty_dvar(declareProperty<std::vector<std::vector<Real>>>("d" + _pf_prop + "_dvar"))
51 {
56 
57  for (unsigned int ph = 0; ph < _num_phases; ++ph)
58  {
59  std::string phase = Moose::stringify(ph);
60  _phase_property[ph] = &getMaterialProperty<Real>(_pf_prop + phase);
62  &getMaterialPropertyDerivative<Real>(_pf_prop + phase, _pressure_variable_name);
64  &getMaterialPropertyDerivative<Real>(_pf_prop + phase, _saturation_variable_name);
66  &getMaterialPropertyDerivative<Real>(_pf_prop + phase, _temperature_variable_name);
67  }
68 }
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 VariableName _mass_fraction_variable_name
Name of (dummy) mass fraction variable.
const std::string _pf_prop
Name of material property to be joined.
const VariableName _pressure_variable_name
Name of (dummy) pressure variable.
const bool _include_old
Whether to include old variables.
const VariableName _saturation_variable_name
Name of (dummy) saturation variable.
PorousFlowMaterialVectorBase(const InputParameters &parameters)
std::vector< const MaterialProperty< Real > * > _phase_property
property of each phase
const VariableName _temperature_variable_name
Name of (dummy) temperature variable.
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

void PorousFlowJoiner::computeQpProperties ( )
overrideprotectedvirtual

Definition at line 80 of file PorousFlowJoiner.C.

81 {
83 
84  _dproperty_dvar[_qp].resize(_num_phases);
85  for (unsigned int ph = 0; ph < _num_phases; ++ph)
86  {
87  _dproperty_dvar[_qp][ph].resize(_num_var);
88  for (unsigned v = 0; v < _num_var; ++v)
89  {
90  // the "if" conditions in the following are because a nodal_material's derivatives might
91  // not have been defined. If that is the case, then DerivativeMaterial passes back a
92  // MaterialProperty with zeroes (for the derivatives), but that property will be sized
93  // by the number of quadpoints in the element, which may be smaller than the number of
94  // nodes!
95  _dproperty_dvar[_qp][ph][v] = 0.0;
96  if ((*_dphase_property_dp[ph]).size() > _qp)
97  _dproperty_dvar[_qp][ph][v] +=
98  (*_dphase_property_dp[ph])[_qp] * _dporepressure_dvar[_qp][ph][v];
99  if ((*_dphase_property_ds[ph]).size() > _qp)
100  _dproperty_dvar[_qp][ph][v] +=
101  (*_dphase_property_ds[ph])[_qp] * _dsaturation_dvar[_qp][ph][v];
102  if ((*_dphase_property_dt[ph]).size() > _qp)
103  _dproperty_dvar[_qp][ph][v] += (*_dphase_property_dt[ph])[_qp] * _dtemperature_dvar[_qp][v];
104  }
105  }
106 }
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.
void PorousFlowJoiner::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 71 of file PorousFlowJoiner.C.

Referenced by computeQpProperties().

72 {
73  _property[_qp].resize(_num_phases);
74 
75  for (unsigned int ph = 0; ph < _num_phases; ++ph)
76  _property[_qp][ph] = (*_phase_property[ph])[_qp];
77 }
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

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

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

Definition at line 83 of file PorousFlowJoiner.h.

Referenced by computeQpProperties(), and PorousFlowJoiner().

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

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

Definition at line 86 of file PorousFlowJoiner.h.

Referenced by computeQpProperties(), and PorousFlowJoiner().

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

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

Definition at line 89 of file PorousFlowJoiner.h.

Referenced by computeQpProperties(), and PorousFlowJoiner().

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 65 of file PorousFlowJoiner.h.

Referenced by computeQpProperties().

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

d(property)/d(PorousFlow variable)

Definition at line 77 of file PorousFlowJoiner.h.

Referenced by computeQpProperties().

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 68 of file PorousFlowJoiner.h.

Referenced by computeQpProperties().

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

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

Definition at line 71 of file PorousFlowJoiner.h.

Referenced by computeQpProperties().

const bool PorousFlowJoiner::_include_old
protected

Whether to include old variables.

Definition at line 62 of file PorousFlowJoiner.h.

const VariableName PorousFlowJoiner::_mass_fraction_variable_name
protected

Name of (dummy) mass fraction variable.

Definition at line 56 of file PorousFlowJoiner.h.

const unsigned int PorousFlowMaterialVectorBase::_num_components
protectedinherited
const unsigned int PorousFlowMaterialVectorBase::_num_phases
protectedinherited
const unsigned int PorousFlowMaterialVectorBase::_num_var
protectedinherited
const std::string PorousFlowJoiner::_pf_prop
protected

Name of material property to be joined.

Definition at line 59 of file PorousFlowJoiner.h.

Referenced by PorousFlowJoiner().

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

property of each phase

Definition at line 80 of file PorousFlowJoiner.h.

Referenced by initQpStatefulProperties(), and PorousFlowJoiner().

const VariableName PorousFlowJoiner::_pressure_variable_name
protected

Name of (dummy) pressure variable.

Definition at line 47 of file PorousFlowJoiner.h.

Referenced by PorousFlowJoiner().

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

computed property of the phase

Definition at line 74 of file PorousFlowJoiner.h.

Referenced by initQpStatefulProperties().

const VariableName PorousFlowJoiner::_saturation_variable_name
protected

Name of (dummy) saturation variable.

Definition at line 50 of file PorousFlowJoiner.h.

Referenced by PorousFlowJoiner().

const VariableName PorousFlowJoiner::_temperature_variable_name
protected

Name of (dummy) temperature variable.

Definition at line 53 of file PorousFlowJoiner.h.

Referenced by PorousFlowJoiner().


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