Skip to content

Commit

Permalink
Merge pull request idaholab#12 from cpgr/por_flow_initial_6740
Browse files Browse the repository at this point in the history
Changes to use derivative material interface properly
  • Loading branch information
WilkAndy committed Apr 18, 2016
2 parents a74f3a4 + 3cfaa22 commit 11aed4f
Show file tree
Hide file tree
Showing 58 changed files with 1,297 additions and 325 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class PorousFlowMaterial1PhaseMD_Gaussian : public DerivativeMaterialInterface<M

protected:

virtual void initQpStatefulProperties();
virtual void computeQpProperties();

/// number of phases (=1 for this class)
const unsigned int _num_ph;

Expand Down Expand Up @@ -65,6 +68,12 @@ class PorousFlowMaterial1PhaseMD_Gaussian : public DerivativeMaterialInterface<M

/// Moose variable number of the mass-density
const unsigned int _md_varnum;
/// Nodal value of temperature
const VariableValue & _temperature_var;
/// Quadpoint value of temperature
const VariableValue & _temperature_qp_var;
/// Moose variable number of the phase0 temperature
const unsigned int _temperature_varnum;

/// The variable names UserObject for the Porous-Flow variables
const PorousFlowDictator & _dictator_UO;
Expand Down Expand Up @@ -116,10 +125,17 @@ class PorousFlowMaterial1PhaseMD_Gaussian : public DerivativeMaterialInterface<M

/// d(grad saturation)/d(porflow variable)
MaterialProperty<std::vector<std::vector<RealGradient> > > & _dgrads_dv;
/// Nodal values of the temperature of the phases
MaterialProperty<std::vector<Real> > & _temperature;
/// quadpoint values of the temperature of the phases
MaterialProperty<std::vector<Real> > & _temperature_qp;
/// d(nodal temperature)/d(nodal porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dtemperature_dvar;
/// d(quadpoint temperature)/d(quadpoint porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dtemperature_qp_dvar;



virtual void initQpStatefulProperties();
virtual void computeQpProperties();

private:
void buildPS();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ class PorousFlowMaterial1PhaseP_VG : public DerivativeMaterialInterface<Material

/// Moose variable number of the porepressure
const unsigned int _porepressure_varnum;
/// Nodal value of temperature
const VariableValue & _temperature_var;
/// Quadpoint value of temperature
const VariableValue & _temperature_qp_var;
/// Moose variable number of the phase0 temperature
const unsigned int _temperature_varnum;

/// The variable names UserObject for the Porous-Flow variables
const PorousFlowDictator & _porflow_name_UO;
Expand Down Expand Up @@ -103,6 +109,14 @@ class PorousFlowMaterial1PhaseP_VG : public DerivativeMaterialInterface<Material

/// d(grad saturation)/d(porflow variable)
MaterialProperty<std::vector<std::vector<RealGradient> > > & _dgrads_dv;
/// Nodal values of the temperature of the phases
MaterialProperty<std::vector<Real> > & _temperature;
/// quadpoint values of the temperature of the phases
MaterialProperty<std::vector<Real> > & _temperature_qp;
/// d(nodal temperature)/d(nodal porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dtemperature_dvar;
/// d(quadpoint temperature)/d(quadpoint porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dtemperature_qp_dvar;


virtual void initQpStatefulProperties();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class PorousFlowMaterial2PhasePP_VG : public DerivativeMaterialInterface<Materia

protected:

virtual void initQpStatefulProperties();
virtual void computeQpProperties();

/// number of phases (=2 for this class)
const unsigned int _num_ph;
/// vanGenuchten alpha
const Real _al;

Expand Down Expand Up @@ -61,6 +66,12 @@ class PorousFlowMaterial2PhasePP_VG : public DerivativeMaterialInterface<Materia
/// Moose variable number of the phase1 porepressure
const unsigned int _phase1_porepressure_varnum;

/// Nodal value of temperature
const VariableValue & _phase0_temperature;
/// Quadpoint value of temperature
const VariableValue & _phase0_temperature_qp;
/// Moose variable number of the phase0 temperature
const unsigned int _phase0_temperature_varnum;
/// The variable names UserObject for the Porous-Flow variables
const PorousFlowDictator & _porflow_name_UO;

Expand Down Expand Up @@ -111,9 +122,16 @@ class PorousFlowMaterial2PhasePP_VG : public DerivativeMaterialInterface<Materia

/// d(grad saturation)/d(porflow variable)
MaterialProperty<std::vector<std::vector<RealGradient> > > & _dgrads_dv;
/// Nodal values of the temperature of the phases
MaterialProperty<std::vector<Real> > & _temperature;
/// quadpoint values of the temperature of the phases
MaterialProperty<std::vector<Real> > & _temperature_qp;
/// d(nodal temperature)/d(nodal porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dtemperature_dvar;
/// d(quadpoint temperature)/d(quadpoint porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dtemperature_qp_dvar;


virtual void initQpStatefulProperties();
virtual void computeQpProperties();

private:
void buildQpPPSS();
Expand Down
46 changes: 20 additions & 26 deletions modules/porous_flow/include/materials/PorousFlowMaterial2PhasePS.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,83 +30,77 @@ class PorousFlowMaterial2PhasePS : public DerivativeMaterialInterface<Material>

protected:

virtual void initQpStatefulProperties();
virtual void computeQpProperties();

/// number of phases (=2 for this class)
const unsigned int _num_ph;
/// Nodal value of porepressure of the zero phase (eg, the gas phase)
const VariableValue & _phase0_porepressure;

/// Quadpoint value of porepressure of the zero phase (eg, the gas phase)
const VariableValue & _phase0_qp_porepressure;

/// Gradient(phase0_porepressure)
const VariableGradient & _phase0_gradp;

/// Moose variable number of the phase0 porepressure
const unsigned int _phase0_porepressure_varnum;

/// Nodal value of saturation of the one phase (eg, the water phase)
const VariableValue & _phase1_saturation;

/// Quadpoint value of saturation of the one phase (eg, the water phase)
const VariableValue & _phase1_qp_saturation;

/// Gradient(phase1_saturation)
const VariableGradient & _phase1_grads;

/// Moose variable number of the phase1 saturation
const unsigned int _phase1_saturation_varnum;

/// Nodal value of temperature
const VariableValue & _phase0_temperature;
/// Quadpoint value of temperature
const VariableValue & _phase0_temperature_qp;
/// Moose variable number of the phase0 temperature
const unsigned int _phase0_temperature_varnum;
/// The variable names UserObject for the Porous-Flow variables
const PorousFlowDictator & _porflow_name_UO;

/// nodal porepressure of the phases
MaterialProperty<std::vector<Real> > & _porepressure;

/// old value of nodal porepressure of the phases
MaterialProperty<std::vector<Real> > & _porepressure_old;

/// quadpoint porepressure of the phases
MaterialProperty<std::vector<Real> > & _porepressure_qp;

/// grad(p)
MaterialProperty<std::vector<RealGradient> > & _gradp;

/// d(nodal porepressure)/d(nodal porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dporepressure_dvar;

/// d(quadpoint porepressure)/d(quadpoint porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dporepressure_qp_dvar;

/// d(grad porepressure)/d(grad porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dgradp_dgradv;

/// d(grad porepressure)/d(porflow variable)
MaterialProperty<std::vector<std::vector<RealGradient> > > & _dgradp_dv;

/// nodal saturation of the phases
MaterialProperty<std::vector<Real> > & _saturation;

/// old value of nodal saturation of the phases
MaterialProperty<std::vector<Real> > & _saturation_old;

/// quadpoint saturation of the phases
MaterialProperty<std::vector<Real> > & _saturation_qp;

/// grad(s)
MaterialProperty<std::vector<RealGradient> > & _grads;

/// d(nodal saturation)/d(nodal porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dsaturation_dvar;

/// d(quadpoint saturation)/d(quadpoint porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dsaturation_qp_dvar;

/// d(grad saturation)/d(grad porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dgrads_dgradv;
/// Nodal values of the temperature of the phases
MaterialProperty<std::vector<Real> > & _temperature;
/// quadpoint values of the temperature of the phases
MaterialProperty<std::vector<Real> > & _temperature_qp;
/// d(nodal temperature)/d(nodal porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dtemperature_dvar;
/// d(quadpoint temperature)/d(quadpoint porflow variable)
MaterialProperty<std::vector<std::vector<Real> > > & _dtemperature_qp_dvar;

virtual void initQpStatefulProperties();
virtual void computeQpProperties();

private:
void buildQpPPSS();
void buildQpPPSSTT();
};

#endif //PORFLOWMATERIAL2PHASEPS_H
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/


#ifndef POROUSFLOWMATERIALCAPILLARYPRESSUREBASE_H
#define POROUSFLOWMATERIALCAPILLARYPRESSUREBASE_H

#include "DerivativeMaterialInterface.h"
#include "Material.h"
#include "PorousFlowDictator.h"

class PorousFlowMaterialCapillaryPressureBase;

template<>
InputParameters validParams<PorousFlowMaterialCapillaryPressureBase>();

/**
* Base class for relative permeability materials
*/
class PorousFlowMaterialCapillaryPressureBase : public DerivativeMaterialInterface<Material>
{
public:
PorousFlowMaterialCapillaryPressureBase(const InputParameters & parameters);

protected:

virtual void computeQpProperties();

/// Phase number of fluid that this relative permeability relates to
const unsigned int _phase_num;
/// Saturation material property
const MaterialProperty<std::vector<Real> > & _saturation;
/// Name of (dummy) saturation primary variable
VariableName _saturation_variable_name;
/// Capillary pressure material property
MaterialProperty<Real> & _capillary_pressure;
/// Derivative of capillary pressure wrt phase saturation
MaterialProperty<Real> & _dcapillary_pressure_ds;
/// The PorousFlowDictator UserObject
const PorousFlowDictator & _dictator_UO;
};

#endif //POROUSFLOWMATERIALCAPILLARYPRESSUREBASE_H
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/


#ifndef POROUSFLOWMATERIALCAPILLARYPRESSURECONSTANT_H
#define POROUSFLOWMATERIALCAPILLARYPRESSURECONSTANT_H

#include "PorousFlowMaterialCapillaryPressureBase.h"

class PorousFlowMaterialCapillaryPressureConstant;

template<>
InputParameters validParams<PorousFlowMaterialCapillaryPressureConstant>();

/**
* Returns a constant capillary pressure as specified in the input file
*/
class PorousFlowMaterialCapillaryPressureConstant : public PorousFlowMaterialCapillaryPressureBase
{
public:
PorousFlowMaterialCapillaryPressureConstant(const InputParameters & parameters);

protected:

virtual void computeQpProperties();
/// The capillary pressure (Pa)
Real _pc;
};

#endif //POROUSFLOWMATERIALCAPILLARYPRESSURECONSTANT_H
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/****************************************************************/
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* All contents are licensed under LGPL V2.1 */
/* See LICENSE for full restrictions */
/****************************************************************/


#ifndef POROUSFLOWMATERIALCAPILLARYPRESSURELINEAR_H
#define POROUSFLOWMATERIALCAPILLARYPRESSURELINEAR_H

#include "PorousFlowMaterialCapillaryPressureBase.h"

//Forward Declarations
class PorousFlowMaterialCapillaryPressureLinear;

template<>
InputParameters validParams<PorousFlowMaterialCapillaryPressureLinear>();

/**
* Linear capillary pressure (equal to the phase saturation)
*/
class PorousFlowMaterialCapillaryPressureLinear : public PorousFlowMaterialCapillaryPressureBase
{
public:
PorousFlowMaterialCapillaryPressureLinear(const InputParameters & parameters);

protected:

virtual void computeQpProperties();
/// The maximum value of the capillary pressure
Real _pc_max;
};

#endif //POROUSFLOWMATERIALCAPILLARYPRESSURELINEAR_H
Loading

0 comments on commit 11aed4f

Please sign in to comment.