https://mooseframework.inl.gov
PINSFEFluidPressureTimeDerivative.C
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 
11 
13 registerMooseObjectRenamed("NavierStokesApp",
14  PMFluidPressureTimeDerivative,
15  "02/01/2024 00:00",
17 
20 {
22  params.addClassDescription(
23  "Adds the transient term of the porous-media mass conservation equation");
24  params.addRequiredCoupledVar("temperature", "coupled temperature");
25  params.addRequiredCoupledVar("porosity", "porosity");
26  params.addRequiredParam<UserObjectName>("eos", "The name of equation of state object to use.");
27 
28  return params;
29 }
30 
32  const InputParameters & parameters)
33  : TimeKernel(parameters),
34  _temperature(coupledValue("temperature")),
35  _temperature_dot(coupledDot("temperature")),
36  _d_temperaturedot_du(coupledDotDu("temperature")),
37  _temperature_var_number(coupled("temperature")),
38  _porosity(coupledValue("porosity")),
39  _eos(getUserObject<SinglePhaseFluidProperties>("eos"))
40 {
41 }
42 
43 Real
45 {
46  Real rho, drho_dp, drho_dT;
47  _eos.rho_from_p_T(_u[_qp], _temperature[_qp], rho, drho_dp, drho_dT);
48  return _porosity[_qp] * (drho_dT * _temperature_dot[_qp] + drho_dp * _u_dot[_qp]) *
49  _test[_i][_qp];
50 }
51 
52 Real
54 {
55  Real rho, drho_dp, drho_dT;
56  _eos.rho_from_p_T(_u[_qp], _temperature[_qp], rho, drho_dp, drho_dT);
57  return _porosity[_qp] * drho_dp * _du_dot_du[_qp] * _phi[_j][_qp] * _test[_i][_qp];
58 }
59 
60 Real
62 {
63  if (jvar == _temperature_var_number)
64  {
65  Real rho, drho_dp, drho_dT;
66  _eos.rho_from_p_T(_u[_qp], _temperature[_qp], rho, drho_dp, drho_dT);
67  return _porosity[_qp] * drho_dT * _d_temperaturedot_du[_qp] * _phi[_j][_qp] * _test[_i][_qp];
68  }
69  else
70  return 0;
71 }
const VariableValue & _u_dot
PINSFEFluidPressureTimeDerivative(const InputParameters &parameters)
The transient term of the porous-media mass conservation equation.
registerMooseObjectRenamed("NavierStokesApp", PMFluidPressureTimeDerivative, "02/01/2024 00:00", PINSFEFluidPressureTimeDerivative)
void addRequiredParam(const std::string &name, const std::string &doc_string)
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
registerMooseObject("NavierStokesApp", PINSFEFluidPressureTimeDerivative)
const VariableTestValue & _test
Common class for single phase fluid properties.
unsigned int _i
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
unsigned int _j
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void addClassDescription(const std::string &doc_string)
const VariablePhiValue & _phi
static InputParameters validParams()
const VariableValue & _du_dot_du
const VariableValue & _u
unsigned int _qp