https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PINSFEFluidTemperatureTimeDerivative.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
14 PMFluidTemperatureTimeDerivative,
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("porosity", "porosity");
25 params.addRequiredParam<UserObjectName>("eos", "The name of equation of state object to use.");
27 "Adds the transient term of the porous media energy 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 _pressure_dot(coupledDot("pressure")),
38 _porosity(coupledValue("porosity")),
39 _rho(getMaterialProperty<Real>("rho_fluid")),
40 _cp(getMaterialProperty<Real>("cp_fluid")),
41 _eos(getUserObject<SinglePhaseFluidProperties>("eos"))
42{
43}
44
45Real
47{
48 Real res = _porosity[_qp] * _rho[_qp] * _cp[_qp] * _u_dot[_qp] * _test[_i][_qp];
50 {
51 Real rho, drho_dp, drho_dT;
52 _eos.rho_from_p_T(_pressure[_qp], _u[_qp], rho, drho_dp, drho_dT);
53 Real drho_dt = drho_dT * _u_dot[_qp] + drho_dp * _pressure_dot[_qp];
54 res += _porosity[_qp] * _cp[_qp] * _u[_qp] * drho_dt * _test[_i][_qp];
55 }
56
57 return res;
58}
59
60Real
62{
65 {
66 Real rho, drho_dp, drho_dT;
67 _eos.rho_from_p_T(_pressure[_qp], _u[_qp], rho, drho_dp, drho_dT);
68 Real drho_dt = drho_dT * _u_dot[_qp] + drho_dp * _pressure_dot[_qp];
69 jac += _porosity[_qp] * _cp[_qp] * _phi[_j][_qp] * drho_dt * _test[_i][_qp];
70 }
71
72 return jac;
73}
const double rho
registerMooseObject("NavierStokesApp", PINSFEFluidTemperatureTimeDerivative)
registerMooseObjectRenamed("NavierStokesApp", PMFluidTemperatureTimeDerivative, "02/01/2024 00:00", PINSFEFluidTemperatureTimeDerivative)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
unsigned int _qp
unsigned int _j
unsigned int _i
const VariablePhiValue & _phi
const VariableTestValue & _test
const VariableValue & _u
Implements the time derivative term for fluid energy in a porous medium.
PINSFEFluidTemperatureTimeDerivative(const InputParameters &parameters)
Common class for single phase fluid properties.
virtual Real computeQpJacobian() override
static InputParameters validParams()
const VariableValue & _u_dot