https://mooseframework.inl.gov
PINSFEFluidVelocityTimeDerivative.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  PMFluidVelocityTimeDerivative,
15  "02/01/2024 00:00",
17 
20 {
22  params.addParam<bool>("conservative_form", false, "if conservative form is used");
23  params.addRequiredCoupledVar("pressure", "coupled pressure");
24  params.addRequiredCoupledVar("temperature", "coupled temperature");
25  params.addRequiredParam<UserObjectName>("eos", "The name of equation of state object to use.");
26  params.addClassDescription("Add the transient term for one component of the porous media "
27  "momentum conservation equation");
28 
29  return params;
30 }
31 
33  const InputParameters & parameters)
34  : TimeDerivative(parameters),
35  _conservative_form(getParam<bool>("conservative_form")),
36  _pressure(coupledValue("pressure")),
37  _temperature(coupledValue("temperature")),
38  _temperature_dot(coupledDot("temperature")),
39  _pressure_dot(coupledDot("pressure")),
40  _rho(getMaterialProperty<Real>("rho_fluid")),
41  _eos(getUserObject<SinglePhaseFluidProperties>("eos"))
42 {
43 }
44 
45 Real
47 {
50  {
51  Real rho, drho_dp, drho_dT;
52  _eos.rho_from_p_T(_pressure[_qp], _temperature[_qp], rho, drho_dp, drho_dT);
53  Real drho_dt = drho_dT * _temperature_dot[_qp] + drho_dp * _pressure_dot[_qp];
54  res += _u[_qp] * drho_dt * _test[_i][_qp];
55  }
56 
57  return res;
58 }
59 
60 Real
62 {
65  {
66  Real rho, drho_dp, drho_dT;
67  _eos.rho_from_p_T(_pressure[_qp], _temperature[_qp], rho, drho_dp, drho_dT);
68  Real drho_dt = drho_dT * _temperature_dot[_qp] + drho_dp * _pressure_dot[_qp];
69  jac += _phi[_j][_qp] * drho_dt * _test[_i][_qp];
70  }
71 
72  return jac;
73 }
virtual Real computeQpResidual() override
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
registerMooseObjectRenamed("NavierStokesApp", PMFluidVelocityTimeDerivative, "02/01/2024 00:00", PINSFEFluidVelocityTimeDerivative)
static InputParameters validParams()
PINSFEFluidVelocityTimeDerivative(const InputParameters &parameters)
void addRequiredParam(const std::string &name, const std::string &doc_string)
Implements the time derivative term for a momentum component in a porous medium.
registerMooseObject("NavierStokesApp", PINSFEFluidVelocityTimeDerivative)
const VariableTestValue & _test
virtual Real computeQpJacobian() override
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
const VariableValue & _u
unsigned int _qp