RASPA3 3.0.12
A molecular simulation code for computing adsorption and diffusion in nanoporous materials
Loading...
Searching...
No Matches
EquationOfState Struct Referenceexport

Represents the equation of state for fluid mixtures in the simulation. More...

Public Types

enum class  Type : int { PengRobinson = 0 , PengRobinsonGasem = 1 , SoaveRedlichKwong = 2 }
 Enumeration of supported equations of state. More...
 
enum class  MultiComponentMixingRules : int { VanDerWaals = 0 }
 Enumeration of mixing rules for multi-component systems. More...
 
enum class  FluidState : int {
  Unknown = 0 , SuperCriticalFluid = 1 , Vapor = 2 , Liquid = 3 ,
  VaporLiquid = 4
}
 Enumeration of possible fluid states. More...
 

Public Member Functions

 EquationOfState ()=default
 Default constructor for the EquationOfState struct.
 
 EquationOfState (EquationOfState::Type type, EquationOfState::MultiComponentMixingRules multiComponentMixingRules, double temperature, double pressure, const SimulationBox &simulationBox, double heliumVoidFraction, std::vector< Component > &components)
 Constructs an EquationOfState with specified parameters.
 
void computeComponentFluidProperties (EquationOfState::Type equationOfState, EquationOfState::MultiComponentMixingRules multiComponentMixingRules, double temperature, double pressure, const SimulationBox &simulationBox, double heliumVoidFraction, std::vector< Component > &components)
 Computes the fluid properties for each component in the mixture.
 

Public Attributes

std::uint64_t versionNumber {1}
 Version number for serialization.
 
EquationOfState::FluidState fluidState {EquationOfState::FluidState::Unknown}
 Current fluid state.
 
EquationOfState::Type equationOfState {EquationOfState::Type::PengRobinson}
 Type of equation of state used.
 
EquationOfState::MultiComponentMixingRules multiComponentMixingRules
 Mixing rules for multi-component systems.
 

Friends

Archive< std::ofstream > & operator<< (Archive< std::ofstream > &archive, const EquationOfState &s)
 Serializes the EquationOfState object to an output archive.
 
Archive< std::ifstream > & operator>> (Archive< std::ifstream > &archive, EquationOfState &s)
 Deserializes the EquationOfState object from an input archive.
 

Detailed Description

Represents the equation of state for fluid mixtures in the simulation.

The EquationOfState struct encapsulates the properties and behaviors associated with computing the thermodynamic properties of fluid mixtures based on different equations of state. It supports various types of equations of state, mixing rules for multi-component systems, and fluid states. The struct provides methods to compute component fluid properties and supports serialization through friend operators.

Member Enumeration Documentation

◆ FluidState

enum class EquationOfState::FluidState : int
strong

Enumeration of possible fluid states.

Enumerator
Unknown 

Fluid state is unknown.

SuperCriticalFluid 

Supercritical fluid state.

Vapor 

Vapor state.

Liquid 

Liquid state.

VaporLiquid 

Vapor-liquid coexistence.

◆ MultiComponentMixingRules

Enumeration of mixing rules for multi-component systems.

Enumerator
VanDerWaals 

van der Waals mixing rules.

◆ Type

enum class EquationOfState::Type : int
strong

Enumeration of supported equations of state.

Enumerator
PengRobinson 

Peng-Robinson equation of state.

PengRobinsonGasem 

Peng-Robinson-Gasem equation of state.

SoaveRedlichKwong 

Soave-Redlich-Kwong equation of state.

Constructor & Destructor Documentation

◆ EquationOfState() [1/2]

EquationOfState::EquationOfState ( )
default

Default constructor for the EquationOfState struct.

Initializes an EquationOfState object with default values.

◆ EquationOfState() [2/2]

EquationOfState::EquationOfState ( EquationOfState::Type  type,
EquationOfState::MultiComponentMixingRules  multiComponentMixingRules,
double  temperature,
double  pressure,
const SimulationBox simulationBox,
double  heliumVoidFraction,
std::vector< Component > &  components 
)

Constructs an EquationOfState with specified parameters.

Initializes an EquationOfState object and computes the fluid properties for the given components based on the specified equation of state and mixing rules.

Parameters
typeThe type of equation of state to use.
multiComponentMixingRulesThe mixing rules for multi-component systems.
temperatureThe temperature of the system in Kelvin.
pressureThe pressure of the system in Pascal.
simulationBoxThe simulation box containing the system dimensions.
heliumVoidFractionThe fraction of void space occupied by helium.
componentsThe components present in the fluid mixture.

Member Function Documentation

◆ computeComponentFluidProperties()

void EquationOfState::computeComponentFluidProperties ( EquationOfState::Type  equationOfState,
EquationOfState::MultiComponentMixingRules  multiComponentMixingRules,
double  temperature,
double  pressure,
const SimulationBox simulationBox,
double  heliumVoidFraction,
std::vector< Component > &  components 
)

Computes the fluid properties for each component in the mixture.

Calculates various thermodynamic properties such as fugacity coefficients, amount of excess molecules, bulk fluid density, and compressibility factors for the components based on the specified equation of state and mixing rules.

Parameters
equationOfStateThe type of equation of state to use.
multiComponentMixingRulesThe mixing rules for multi-component systems.
temperatureThe temperature of the system in Kelvin.
pressureThe pressure of the system in Pascal.
simulationBoxThe simulation box containing the system dimensions.
heliumVoidFractionThe fraction of void space occupied by helium.
componentsThe components present in the fluid mixture.

Friends And Related Symbol Documentation

◆ operator<<

Archive< std::ofstream > & operator<< ( Archive< std::ofstream > &  archive,
const EquationOfState s 
)
friend

Serializes the EquationOfState object to an output archive.

Parameters
archiveThe output archive to serialize to.
sThe EquationOfState object to serialize.
Returns
Reference to the output archive.

◆ operator>>

Archive< std::ifstream > & operator>> ( Archive< std::ifstream > &  archive,
EquationOfState s 
)
friend

Deserializes the EquationOfState object from an input archive.

Parameters
archiveThe input archive to deserialize from.
sThe EquationOfState object to deserialize into.
Returns
Reference to the input archive.

Member Data Documentation

◆ multiComponentMixingRules

EquationOfState::MultiComponentMixingRules EquationOfState::multiComponentMixingRules
Initial value:

Mixing rules for multi-component systems.


The documentation for this struct was generated from the following file: