www.mooseframework.org
PorousFlowEnergyTimeDerivative.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "TimeDerivative.h"
13 #include "PorousFlowDictator.h"
14 
16 
17 template <>
19 
24 class PorousFlowEnergyTimeDerivative : public TimeKernel
25 {
26 public:
27  PorousFlowEnergyTimeDerivative(const InputParameters & parameters);
28 
29 protected:
30  virtual Real computeQpResidual() override;
31  virtual Real computeQpJacobian() override;
32  virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
33 
36 
38  const bool _var_is_porflow_var;
39 
41  const unsigned int _num_phases;
42 
44  const bool _fluid_present;
45 
48 
50  const MaterialProperty<Real> & _porosity;
51 
53  const MaterialProperty<Real> & _porosity_old;
54 
56  const MaterialProperty<std::vector<Real>> & _dporosity_dvar;
57 
59  const MaterialProperty<std::vector<RealGradient>> & _dporosity_dgradvar;
60 
62  const MaterialProperty<unsigned int> * const _nearest_qp;
63 
65  const MaterialProperty<Real> & _rock_energy_nodal;
66 
68  const MaterialProperty<Real> & _rock_energy_nodal_old;
69 
71  const MaterialProperty<std::vector<Real>> & _drock_energy_nodal_dvar;
72 
74  const MaterialProperty<std::vector<Real>> * const _fluid_density;
75 
77  const MaterialProperty<std::vector<Real>> * const _fluid_density_old;
78 
80  const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_density_dvar;
81 
83  const MaterialProperty<std::vector<Real>> * const _fluid_saturation_nodal;
84 
86  const MaterialProperty<std::vector<Real>> * const _fluid_saturation_nodal_old;
87 
89  const MaterialProperty<std::vector<std::vector<Real>>> * const _dfluid_saturation_nodal_dvar;
90 
92  const MaterialProperty<std::vector<Real>> * const _energy_nodal;
93 
95  const MaterialProperty<std::vector<Real>> * const _energy_nodal_old;
96 
98  const MaterialProperty<std::vector<std::vector<Real>>> * const _denergy_nodal_dvar;
99 
105  Real computeQpJac(unsigned int pvar) const;
106 };
107 
PorousFlowDictator.h
PorousFlowEnergyTimeDerivative::_fluid_saturation_nodal
const MaterialProperty< std::vector< Real > > *const _fluid_saturation_nodal
Nodal fluid saturation.
Definition: PorousFlowEnergyTimeDerivative.h:83
PorousFlowEnergyTimeDerivative::_dporosity_dvar
const MaterialProperty< std::vector< Real > > & _dporosity_dvar
d(porosity)/d(PorousFlow variable) - these derivatives will be wrt variables at the nodes
Definition: PorousFlowEnergyTimeDerivative.h:56
PorousFlowEnergyTimeDerivative::_fluid_present
const bool _fluid_present
Whether _num_phases > 0 (ie. there is a fluid present)
Definition: PorousFlowEnergyTimeDerivative.h:44
PorousFlowEnergyTimeDerivative::_energy_nodal
const MaterialProperty< std::vector< Real > > *const _energy_nodal
Internal energy of the phases, evaluated at the nodes.
Definition: PorousFlowEnergyTimeDerivative.h:92
PorousFlowEnergyTimeDerivative::_fluid_density_old
const MaterialProperty< std::vector< Real > > *const _fluid_density_old
Old value of nodal fluid density.
Definition: PorousFlowEnergyTimeDerivative.h:77
PorousFlowEnergyTimeDerivative::_porosity
const MaterialProperty< Real > & _porosity
Porosity at the nodes, but it can depend on grad(variables) which are actually evaluated at the qps.
Definition: PorousFlowEnergyTimeDerivative.h:50
PorousFlowEnergyTimeDerivative::_dfluid_density_dvar
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_density_dvar
d(nodal fluid density)/d(PorousFlow variable)
Definition: PorousFlowEnergyTimeDerivative.h:80
PorousFlowEnergyTimeDerivative::_denergy_nodal_dvar
const MaterialProperty< std::vector< std::vector< Real > > > *const _denergy_nodal_dvar
d(internal energy)/d(PorousFlow variable)
Definition: PorousFlowEnergyTimeDerivative.h:98
PorousFlowEnergyTimeDerivative
Kernel = (heat_energy - heat_energy_old)/dt It is lumped to the nodes.
Definition: PorousFlowEnergyTimeDerivative.h:24
PorousFlowEnergyTimeDerivative::_dfluid_saturation_nodal_dvar
const MaterialProperty< std::vector< std::vector< Real > > > *const _dfluid_saturation_nodal_dvar
d(nodal fluid saturation)/d(PorousFlow variable)
Definition: PorousFlowEnergyTimeDerivative.h:89
PorousFlowEnergyTimeDerivative::_rock_energy_nodal
const MaterialProperty< Real > & _rock_energy_nodal
Nodal rock energy density.
Definition: PorousFlowEnergyTimeDerivative.h:65
validParams< PorousFlowEnergyTimeDerivative >
InputParameters validParams< PorousFlowEnergyTimeDerivative >()
Definition: PorousFlowEnergyTimeDerivative.C:18
PorousFlowDictator
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
Definition: PorousFlowDictator.h:71
PorousFlowEnergyTimeDerivative::_nearest_qp
const MaterialProperty< unsigned int > *const _nearest_qp
The nearest qp to the node.
Definition: PorousFlowEnergyTimeDerivative.h:62
PorousFlowEnergyTimeDerivative::computeQpJac
Real computeQpJac(unsigned int pvar) const
Derivative of residual with respect to PorousFlow variable number pvar This is used by both computeQp...
Definition: PorousFlowEnergyTimeDerivative.C:119
PorousFlowEnergyTimeDerivative::_rock_energy_nodal_old
const MaterialProperty< Real > & _rock_energy_nodal_old
Old value of nodal rock energy density.
Definition: PorousFlowEnergyTimeDerivative.h:68
PorousFlowEnergyTimeDerivative::computeQpResidual
virtual Real computeQpResidual() override
Definition: PorousFlowEnergyTimeDerivative.C:85
PorousFlowEnergyTimeDerivative::_porosity_old
const MaterialProperty< Real > & _porosity_old
Old value of porosity.
Definition: PorousFlowEnergyTimeDerivative.h:53
PorousFlowEnergyTimeDerivative::_dporosity_dgradvar
const MaterialProperty< std::vector< RealGradient > > & _dporosity_dgradvar
d(porosity)/d(grad PorousFlow variable) - remember these derivatives will be wrt grad(vars) at qps
Definition: PorousFlowEnergyTimeDerivative.h:59
PorousFlowEnergyTimeDerivative::_num_phases
const unsigned int _num_phases
Number of fluid phases.
Definition: PorousFlowEnergyTimeDerivative.h:41
PorousFlowEnergyTimeDerivative::_var_is_porflow_var
const bool _var_is_porflow_var
Whether the Variable for this Kernel is a PorousFlow variable according to the Dictator.
Definition: PorousFlowEnergyTimeDerivative.h:38
PorousFlowEnergyTimeDerivative::_strain_at_nearest_qp
const bool _strain_at_nearest_qp
Whether the porosity uses the volumetric strain at the closest quadpoint.
Definition: PorousFlowEnergyTimeDerivative.h:47
PorousFlowEnergyTimeDerivative::computeQpOffDiagJacobian
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
Definition: PorousFlowEnergyTimeDerivative.C:110
PorousFlowEnergyTimeDerivative::PorousFlowEnergyTimeDerivative
PorousFlowEnergyTimeDerivative(const InputParameters &parameters)
Definition: PorousFlowEnergyTimeDerivative.C:34
PorousFlowEnergyTimeDerivative::_energy_nodal_old
const MaterialProperty< std::vector< Real > > *const _energy_nodal_old
Old value of internal energy of the phases, evaluated at the nodes.
Definition: PorousFlowEnergyTimeDerivative.h:95
PorousFlowEnergyTimeDerivative::_dictator
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
Definition: PorousFlowEnergyTimeDerivative.h:35
PorousFlowEnergyTimeDerivative::_fluid_saturation_nodal_old
const MaterialProperty< std::vector< Real > > *const _fluid_saturation_nodal_old
Old value of fluid saturation.
Definition: PorousFlowEnergyTimeDerivative.h:86
PorousFlowEnergyTimeDerivative::_fluid_density
const MaterialProperty< std::vector< Real > > *const _fluid_density
Nodal fluid density.
Definition: PorousFlowEnergyTimeDerivative.h:74
PorousFlowEnergyTimeDerivative::computeQpJacobian
virtual Real computeQpJacobian() override
Definition: PorousFlowEnergyTimeDerivative.C:101
PorousFlowEnergyTimeDerivative::_drock_energy_nodal_dvar
const MaterialProperty< std::vector< Real > > & _drock_energy_nodal_dvar
d(nodal rock energy density)/d(PorousFlow variable)
Definition: PorousFlowEnergyTimeDerivative.h:71