https://mooseframework.inl.gov
PorousFlowFullySaturatedUpwindHeatAdvection.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 
16 {
18  params.addClassDescription("Heat advection by a fluid. The fluid is assumed to have a single "
19  "phase, and the advection is fully upwinded");
20  return params;
21 }
22 
24  const InputParameters & parameters)
25  : PorousFlowDarcyBase(parameters),
26  _enthalpy(getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_enthalpy_nodal")),
27  _denthalpy_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
28  "dPorousFlow_fluid_phase_enthalpy_nodal_dvar"))
29 {
30  if (_dictator.numPhases() != 1)
31  mooseError("PorousFlowFullySaturatedUpwindHeatAdvection should not be used for multi-phase "
32  "scenarios as it does not include relative-permeability effects");
33 }
34 
35 Real
36 PorousFlowFullySaturatedUpwindHeatAdvection::mobility(unsigned nodenum, unsigned phase) const
37 {
38  return _enthalpy[nodenum][phase] * _fluid_density_node[nodenum][phase] /
39  _fluid_viscosity[nodenum][phase];
40 }
41 
42 Real
44  unsigned phase,
45  unsigned pvar) const
46 {
47  Real dm = _denthalpy_dvar[nodenum][phase][pvar] * _fluid_density_node[nodenum][phase] /
48  _fluid_viscosity[nodenum][phase];
49  dm += _enthalpy[nodenum][phase] * _dfluid_density_node_dvar[nodenum][phase][pvar] /
50  _fluid_viscosity[nodenum][phase];
51  dm -= _enthalpy[nodenum][phase] * _fluid_density_node[nodenum][phase] *
52  _dfluid_viscosity_dvar[nodenum][phase][pvar] /
53  Utility::pow<2>(_fluid_viscosity[nodenum][phase]);
54  return dm;
55 }
virtual Real dmobility(unsigned nodenum, unsigned phase, unsigned pvar) const override
The derivative of mobility with respect to PorousFlow variable pvar.
const MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_density_node_dvar
Derivative of the fluid density for each phase wrt PorousFlow variables (at the node) ...
registerMooseObject("PorousFlowApp", PorousFlowFullySaturatedUpwindHeatAdvection)
Advection of heat via flux of a single-phase fluid.
const MaterialProperty< std::vector< Real > > & _fluid_viscosity
Viscosity of each component in each phase.
Darcy advective flux.
PetscErrorCode PetscOptionItems *PetscErrorCode DM dm
const MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_viscosity_dvar
Derivative of the fluid viscosity for each phase wrt PorousFlow variables.
virtual Real mobility(unsigned nodenum, unsigned phase) const override
The mobility of the fluid.
static InputParameters validParams()
const PorousFlowDictator & _dictator
PorousFlowDictator UserObject.
const MaterialProperty< std::vector< std::vector< Real > > > & _denthalpy_dvar
Derivative of the enthalpy wrt PorousFlow variables.
unsigned int numPhases() const
The number of fluid phases.
const MaterialProperty< std::vector< Real > > & _enthalpy
Enthalpy of each phase.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
const MaterialProperty< std::vector< Real > > & _fluid_density_node
Fluid density for each phase (at the node)