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 "PorousFlowFluidStateMultiComponentBase.h" 11 : 12 : InputParameters 13 746 : PorousFlowFluidStateMultiComponentBase::validParams() 14 : { 15 746 : InputParameters params = PorousFlowFluidStateFlash::validParams(); 16 1492 : params.addParam<unsigned int>( 17 1492 : "liquid_fluid_component", 0, "The fluid component number of the primary liquid component"); 18 1492 : params.addParam<unsigned int>("salt_component", 2, "The component number of salt"); 19 746 : params.addClassDescription("Base class for multiple component fluid state classes"); 20 746 : return params; 21 0 : } 22 : 23 373 : PorousFlowFluidStateMultiComponentBase::PorousFlowFluidStateMultiComponentBase( 24 373 : const InputParameters & parameters) 25 : : PorousFlowFluidStateFlash(parameters), 26 373 : _aqueous_fluid_component(getParam<unsigned int>("liquid_fluid_component")), 27 746 : _salt_component(getParam<unsigned int>("salt_component")), 28 373 : _pidx(0), 29 373 : _Zidx(1), 30 373 : _Tidx(2), 31 373 : _Xidx(3) 32 : { 33 373 : } 34 : 35 : void 36 734518 : PorousFlowFluidStateMultiComponentBase::phaseState(Real Zi, 37 : Real Xi, 38 : Real Yi, 39 : FluidStatePhaseEnum & phase_state) const 40 : { 41 734518 : if (Zi <= Xi) 42 : { 43 : // In this case, there is not enough component i to form a gas phase, 44 : // so only a liquid phase is present 45 656282 : phase_state = FluidStatePhaseEnum::LIQUID; 46 : } 47 78236 : else if (Zi > Xi && Zi < Yi) 48 : { 49 : // Two phases are present 50 65187 : phase_state = FluidStatePhaseEnum::TWOPHASE; 51 : } 52 : else // (Zi >= Yi) 53 : { 54 : // In this case, there is not enough water to form a liquid 55 : // phase, so only a gas phase is present 56 13049 : phase_state = FluidStatePhaseEnum::GAS; 57 : } 58 734518 : }