Line data Source code
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 : 10 : #include "PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat.h" 11 : 12 : registerMooseObject("PorousFlowApp", PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat); 13 : 14 : InputParameters 15 41 : PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat::validParams() 16 : { 17 41 : InputParameters params = PorousFlowAdvectiveFluxCalculatorSaturatedHeat::validParams(); 18 41 : params.addClassDescription( 19 : "Computes the advective flux of heat energy in a given phase, assuming unsaturated " 20 : "conditions. Hence this UserObject is only relevant to single-phase situations, or " 21 : "multi-phase situations where each fluid component appears in one phase only. Explicitly, " 22 : "the UserObject computes (density * enthalpy * relative_permeability / viscosity) * (- " 23 : "permeability * (grad(P) - density * gravity)), using the Kuzmin-Turek FEM-TVD " 24 : "multidimensional stabilization scheme"); 25 41 : return params; 26 0 : } 27 : 28 22 : PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat::PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat( 29 22 : const InputParameters & parameters) 30 : : PorousFlowAdvectiveFluxCalculatorSaturatedHeat(parameters), 31 22 : _relative_permeability( 32 44 : getMaterialProperty<std::vector<Real>>("PorousFlow_relative_permeability_nodal")), 33 44 : _drelative_permeability_dvar(getMaterialProperty<std::vector<std::vector<Real>>>( 34 22 : "dPorousFlow_relative_permeability_nodal_dvar")) 35 : { 36 22 : } 37 : 38 : Real 39 1840 : PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat::computeU(unsigned i) const 40 : { 41 1840 : return _relative_permeability[i][_phase] * 42 1840 : PorousFlowAdvectiveFluxCalculatorSaturatedHeat::computeU(i); 43 : } 44 : 45 : Real 46 9200 : PorousFlowAdvectiveFluxCalculatorUnsaturatedHeat::computedU_dvar(unsigned i, unsigned pvar) const 47 : { 48 9200 : Real du = _drelative_permeability_dvar[i][_phase][pvar] * 49 9200 : PorousFlowAdvectiveFluxCalculatorSaturatedHeat::computeU(i); 50 9200 : du += _relative_permeability[i][_phase] * 51 9200 : PorousFlowAdvectiveFluxCalculatorSaturatedHeat::computedU_dvar(i, pvar); 52 9200 : return du; 53 : }