https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PorousFlowFluidStateIC.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#include "PorousFlowDictator.h"
13
15
18{
20 params.addRequiredCoupledVar("gas_porepressure",
21 "Variable that is the porepressure of the gas phase");
22 params.addRequiredCoupledVar("temperature", "Variable that is the fluid temperature");
23 MooseEnum unit_choice("Kelvin=0 Celsius=1", "Kelvin");
24 params.addParam<MooseEnum>(
25 "temperature_unit", unit_choice, "The unit of the temperature variable");
26 params.addCoupledVar("saturation", 0.0, "Gas saturation");
27 params.addRequiredParam<UserObjectName>("fluid_state", "Name of the FluidState UserObject");
28 params.addCoupledVar("xnacl", 0, "The salt mass fraction in the brine (kg/kg)");
29 params.addRequiredParam<UserObjectName>(
30 "PorousFlowDictator", "The UserObject that holds the list of PorousFlow variable names");
31 params.addClassDescription("An initial condition to calculate z from saturation");
32 return params;
33}
34
36 : InitialCondition(parameters),
37 _gas_porepressure(coupledValue("gas_porepressure")),
38 _temperature(coupledValue("temperature")),
39 _Xnacl(coupledValue("xnacl")),
40 _saturation(coupledValue("saturation")),
41 _T_c2k(getParam<MooseEnum>("temperature_unit") == 0 ? 0.0 : 273.15),
42 _dictator(getUserObject<PorousFlowDictator>("PorousFlowDictator")),
43 _fs(getUserObject<PorousFlowFluidStateMultiComponentBase>("fluid_state"))
44{
45}
46
47Real
49{
50 // The fluid state user object needs temperature in K
51 const Real Tk = _temperature[_qp] + _T_c2k;
52
53 // The total mass fraction corresponding to the input saturation
55}
registerMooseObject("PorousFlowApp", PorousFlowFluidStateIC)
static InputParameters validParams()
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)
void addCoupledVar(const std::string &name, const std::string &doc_string)
This holds maps between the nonlinear variables used in a PorousFlow simulation and the variable numb...
PorousFlowFluidStateIC calculates an initial value for the total mass fraction of a component summed ...
static InputParameters validParams()
PorousFlowFluidStateIC(const InputParameters &parameters)
const VariableValue & _Xnacl
NaCl mass fraction (kg/kg)
const VariableValue & _saturation
Gas saturation (-)
const PorousFlowFluidStateMultiComponentBase & _fs
FluidState UserObject.
const VariableValue & _temperature
Fluid temperature (C or K)
const VariableValue & _gas_porepressure
Gas porepressure (Pa)
virtual Real value(const Point &p) override
const Real _T_c2k
Conversion from degrees Celsius to degrees Kelvin.
Compositional flash routines for miscible multiphase flow classes with multiple fluid components.
virtual Real totalMassFraction(Real pressure, Real temperature, Real Xnacl, Real saturation, unsigned int qp) const =0
Total mass fraction of fluid component summed over all phases in the two-phase state for a specified ...