www.mooseframework.org
PorousFlowHeatAdvection.C
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 
11 
13 
16 {
18  params.addClassDescription("Fully-upwinded heat flux, advected by the fluid");
19  return params;
20 }
21 
23  : PorousFlowDarcyBase(parameters),
24  _enthalpy(getMaterialProperty<std::vector<Real>>("PorousFlow_fluid_phase_enthalpy_nodal")),
25  _denthalpy_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
26  "dPorousFlow_fluid_phase_enthalpy_nodal_dvar")),
27  _relative_permeability(
28  getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal")),
29  _drelative_permeability_dvar(getMaterialProperty<std::vector<std::vector<Real>>>(
30  "dPorousFlow_relative_permeability_nodal_dvar"))
31 {
32 }
33 
34 Real
35 PorousFlowHeatAdvection::mobility(unsigned nodenum, unsigned phase) const
36 {
37  return _enthalpy[nodenum][phase] * _fluid_density_node[nodenum][phase] *
38  _relative_permeability[nodenum][phase] / _fluid_viscosity[nodenum][phase];
39 }
40 
41 Real
42 PorousFlowHeatAdvection::dmobility(unsigned nodenum, unsigned phase, unsigned pvar) const
43 {
44  Real dm = _denthalpy_dvar[nodenum][phase][pvar] * _fluid_density_node[nodenum][phase] *
45  _relative_permeability[nodenum][phase] / _fluid_viscosity[nodenum][phase];
46  dm += _enthalpy[nodenum][phase] * _dfluid_density_node_dvar[nodenum][phase][pvar] *
47  _relative_permeability[nodenum][phase] / _fluid_viscosity[nodenum][phase];
48  dm += _enthalpy[nodenum][phase] * _fluid_density_node[nodenum][phase] *
49  _drelative_permeability_dvar[nodenum][phase][pvar] / _fluid_viscosity[nodenum][phase];
50  dm -= _enthalpy[nodenum][phase] * _fluid_density_node[nodenum][phase] *
51  _relative_permeability[nodenum][phase] * _dfluid_viscosity_dvar[nodenum][phase][pvar] /
52  std::pow(_fluid_viscosity[nodenum][phase], 2);
53  return dm;
54 }
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) ...
const MaterialProperty< std::vector< Real > > & _fluid_viscosity
Viscosity of each component in each phase.
Darcy advective flux.
virtual Real mobility(unsigned nodenum, unsigned phase) const override
The mobility of the fluid.
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< Real > > & _enthalpy
Enthalpy of each phase.
const MaterialProperty< std::vector< std::vector< Real > > > & _drelative_permeability_dvar
Derivative of relative permeability of each phase wrt PorousFlow variables.
const MaterialProperty< std::vector< std::vector< Real > > > & _dfluid_viscosity_dvar
Derivative of the fluid viscosity for each phase wrt PorousFlow variables.
static InputParameters validParams()
registerMooseObject("PorousFlowApp", PorousFlowHeatAdvection)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MaterialProperty< std::vector< Real > > & _relative_permeability
Relative permeability of each phase.
Advection of heat via flux of component k in fluid phase alpha.
PorousFlowHeatAdvection(const InputParameters &parameters)
void addClassDescription(const std::string &doc_string)
static InputParameters validParams()
MooseUnits pow(const MooseUnits &, int)
const MaterialProperty< std::vector< Real > > & _fluid_density_node
Fluid density for each phase (at the node)
const MaterialProperty< std::vector< std::vector< Real > > > & _denthalpy_dvar
Derivative of the enthalpy wrt PorousFlow variables.