OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Protected Attributes | List of all members
olb::MultiPhaseUnitConverter< T, DESCRIPTOR > Class Template Reference

Conversion between physical and lattice units, as well as discretization for multiple component lattices. More...

#include <multiPhaseUnitConverter.h>

+ Inheritance diagram for olb::MultiPhaseUnitConverter< T, DESCRIPTOR >:
+ Collaboration diagram for olb::MultiPhaseUnitConverter< T, DESCRIPTOR >:

Public Member Functions

constexpr MultiPhaseUnitConverter (size_t resolution, T charPhysLength, T charPhysVelocity, T physViscosity, T physEoSa, T latticeEoSa, T physEoSb, T physMolarMass, T physSurfaceTension, T charPhysTemperature, T charPhysPressure)
 Documentation of constructor: TODO: Extend constructur documentation.
 
constexpr T getCharPhysTemperature () const
 return characteristic temperature in physical units
 
constexpr T getPhysEoSa () const
 return equation of state parameter a in physical units
 
constexpr T getPhysEoSb () const
 return equation of state parameter b in physical units
 
constexpr T getPhysMolarMass () const
 return molar mass in physical units
 
constexpr T getPhysSurfaceTension () const
 return surface tension in physical units
 
constexpr T getPhysTemperature () const
 return characteristic temperature in physical units
 
constexpr T getConversionFactorEoSa () const
 access (read-only) to private member variable
 
constexpr T getConversionFactorEoSb () const
 access (read-only) to private member variable
 
constexpr T getConversionFactorMolarMass () const
 access (read-only) to private member variable
 
constexpr T getConversionFactorGasConstant () const
 access (read-only) to private member variable
 
constexpr T getConversionFactorSurfaceTension () const
 access (read-only) to private member variable
 
constexpr T getConversionFactorTemperature () const
 access (read-only) to private member variable
 
constexpr T getLatticeSurfaceTension () const
 return lattice surface tension for parameter fitting
 
void print () const override
 nice terminal output for conversion factors, characteristical and physical data
 
- Public Member Functions inherited from olb::UnitConverter< T, DESCRIPTOR >
constexpr UnitConverter (T physDeltaX, T physDeltaT, T charPhysLength, T charPhysVelocity, T physViscosity, T physDensity, T charPhysPressure=0)
 Documentation of constructor:
 
virtual ~UnitConverter ()=default
 
constexpr int getResolution () const
 return resolution
 
constexpr T getLatticeRelaxationTime () const
 return relaxation time in lattice units
 
constexpr T getLatticeRelaxationFrequency () const
 return relaxation frequency in lattice units
 
template<typename DESCRIPTOR_ >
constexpr T getLatticeRelaxationFrequencyFromDiffusivity (const T physDiffusivity) const
 return relaxation frequency in lattice units computed from given physical diffusivity in m^2 / s
 
constexpr T getCharPhysLength () const
 return characteristic length in physical units
 
constexpr T getCharPhysVelocity () const
 return characteristic velocity in physical units
 
constexpr T getCharLatticeVelocity () const
 return characteristic velocity in lattice units
 
constexpr T getPhysViscosity () const
 return viscosity in physical units
 
constexpr T getPhysDensity () const
 return density in physical units
 
constexpr T getCharPhysPressure () const
 return characteristic pressure in physical units
 
constexpr T getReynoldsNumber () const
 return Reynolds number
 
constexpr T getMachNumber () const
 return Mach number
 
constexpr T getKnudsenNumber () const
 return Knudsen number
 
constexpr T getPhysLength (int latticeLength) const
 conversion from lattice to physical length
 
constexpr int getLatticeLength (T physLength) const
 conversion from physical to lattice length, returns number of voxels for given physical length
 
constexpr T getConversionFactorLength () const
 access (read-only) to private member variable
 
constexpr T getPhysDeltaX () const
 returns grid spacing (voxel length) in m
 
constexpr T getPhysTime (size_t latticeTime) const
 conversion from lattice to physical time
 
constexpr size_t getLatticeTime (T physTime) const
 conversion from physical to lattice time
 
constexpr T getConversionFactorTime () const
 access (read-only) to private member variable
 
constexpr T getPhysDeltaT () const
 returns time spacing (timestep length) in s
 
constexpr T getPhysVelocity (T latticeVelocity) const
 conversion from lattice to physical velocity
 
constexpr T getLatticeVelocity (T physVelocity) const
 conversion from physical to lattice velocity
 
constexpr T getConversionFactorVelocity () const
 access (read-only) to private member variable
 
constexpr T getPhysDensity (T latticeDensity) const
 conversion from lattice to physical density
 
constexpr T getLatticeDensity (T physDensity) const
 conversion from physical to lattice density
 
constexpr T getLatticeDensityFromPhysPressure (T physPressure) const
 
constexpr T getConversionFactorDensity () const
 access (read-only) to private member variable
 
constexpr T getPhysMass (T latticeMass) const
 conversion from lattice to physical mass
 
constexpr T getLatticeMass (T physMass) const
 conversion from physical to lattice mass
 
constexpr T getConversionFactorMass () const
 access (read-only) to private member variable
 
constexpr T getPhysViscosity (T latticeViscosity) const
 conversion from lattice to physical viscosity
 
constexpr T getLatticeViscosity () const
 conversion from physical to lattice viscosity
 
constexpr T getConversionFactorViscosity () const
 access (read-only) to private member variable
 
constexpr T getPhysForce (T latticeForce) const
 conversion from lattice to physical force
 
constexpr T getLatticeForce (T physForce) const
 conversion from physical to lattice force
 
constexpr T getConversionFactorForce () const
 access (read-only) to private member variable
 
constexpr T getPhysTorque (T latticeTorque) const
 conversion from lattice to physical torque
 
constexpr T getLatticeTorque (T physTorque) const
 conversion from physical to lattice torque
 
constexpr T getConversionFactorTorque () const
 access (read-only) to private member variable
 
constexpr T getPhysPressure (T latticePressure) const
 conversion from lattice to physical pressure
 
constexpr T getLatticePressure (T physPressure) const
 conversion from physical to lattice pressure
 
constexpr T getConversionFactorPressure () const
 access (read-only) to private member variable
 
void print (std::ostream &fout) const
 
void write (std::string const &fileName="unitConverter") const
 
- Public Member Functions inherited from olb::UnitConverterBase
virtual ~UnitConverterBase ()=default
 

Protected Attributes

const T _conversionEoSa
 
const T _conversionEoSb
 
const T _conversionMolarMass
 
const T _conversionGasConstant = 8.314462618
 
const T _conversionSurfaceTension
 
const T _conversionTemperature
 
const T _physEoSa
 
const T _physEoSb
 
const T _physMolarMass
 
const T _physSurfaceTension
 
const T _charPhysTemperature
 
const T _latticeSurfaceTension
 
- Protected Attributes inherited from olb::UnitConverter< T, DESCRIPTOR >
const T _conversionLength
 
const T _conversionTime
 
const T _conversionVelocity
 
const T _conversionDensity
 
const T _conversionMass
 
const T _conversionViscosity
 
const T _conversionForce
 
const T _conversionTorque
 
const T _conversionPressure
 
const T _charPhysLength
 
const T _charPhysVelocity
 
const T _physViscosity
 
const T _physDensity
 
const T _charPhysPressure
 
const size_t _resolution
 
const T _latticeRelaxationTime
 
const T _charLatticeVelocity
 

Detailed Description

template<typename T, typename DESCRIPTOR>
class olb::MultiPhaseUnitConverter< T, DESCRIPTOR >

Conversion between physical and lattice units, as well as discretization for multiple component lattices.

Be aware of the nomenclature: We distingish between physical (dimensioned) and lattice (dimensionless) values. A specific conversion factor maps the two different scopes, e.g. physLength = conversionLength * latticeLength

For the basic units of length L, time T, mass M, particle number N and temperature theta, 5 elemental conversion factors are deduced from EoS parameters a,b and R, molar mass M and surface tension sigma. For multiple components, the conversion factors are computed for the lightest condensable component.

TODO: Extend documentation for MultiPhaseUnitConverter

Definition at line 56 of file multiPhaseUnitConverter.h.

Constructor & Destructor Documentation

◆ MultiPhaseUnitConverter()

template<typename T , typename DESCRIPTOR >
constexpr olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::MultiPhaseUnitConverter ( size_t resolution,
T charPhysLength,
T charPhysVelocity,
T physViscosity,
T physEoSa,
T latticeEoSa,
T physEoSb,
T physMolarMass,
T physSurfaceTension,
T charPhysTemperature,
T charPhysPressure )
inlineconstexpr

Documentation of constructor: TODO: Extend constructur documentation.

Definition at line 61 of file multiPhaseUnitConverter.h.

73 : UnitConverter<T, DESCRIPTOR>(
74 (charPhysLength/resolution),
75 (charPhysLength/resolution)*util::pow(physEoSa/latticeEoSa, -0.5)*util::pow(physEoSb*10.5/1., 0.5)*util::pow(physMolarMass*1, 0.5),
76 charPhysLength,
77 charPhysVelocity,
78 physViscosity,
79 physMolarMass*1/(physEoSb*10.5/1.),
80 charPhysPressure),
81 _conversionEoSa(physEoSa/latticeEoSa),
82 _conversionEoSb(physEoSb*10.5/1.),
83 _conversionMolarMass(physMolarMass*1),
86 _physEoSa(physEoSa),
87 _physEoSb(physEoSb),
88 _physMolarMass(physMolarMass),
89 _physSurfaceTension(physSurfaceTension),
90 _charPhysTemperature(charPhysTemperature),
92 clout(std::cout,"MultiPhaseUnitConv")
93 {
94 };
cpu::simd::Pack< T > pow(cpu::simd::Pack< T > base, cpu::simd::Pack< T > exp)
Definition pack.h:112

Member Function Documentation

◆ getCharPhysTemperature()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getCharPhysTemperature ( ) const
inlineconstexpr

return characteristic temperature in physical units

Definition at line 97 of file multiPhaseUnitConverter.h.

98 {
100 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_charPhysTemperature.

◆ getConversionFactorEoSa()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getConversionFactorEoSa ( ) const
inlineconstexpr

access (read-only) to private member variable

Definition at line 128 of file multiPhaseUnitConverter.h.

129 {
130 return _conversionEoSa;
131 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionEoSa.

◆ getConversionFactorEoSb()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getConversionFactorEoSb ( ) const
inlineconstexpr

access (read-only) to private member variable

Definition at line 134 of file multiPhaseUnitConverter.h.

135 {
136 return _conversionEoSb;
137 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionEoSb.

◆ getConversionFactorGasConstant()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getConversionFactorGasConstant ( ) const
inlineconstexpr

access (read-only) to private member variable

Definition at line 146 of file multiPhaseUnitConverter.h.

147 {
149 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionGasConstant.

◆ getConversionFactorMolarMass()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getConversionFactorMolarMass ( ) const
inlineconstexpr

access (read-only) to private member variable

Definition at line 140 of file multiPhaseUnitConverter.h.

141 {
143 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionMolarMass.

◆ getConversionFactorSurfaceTension()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getConversionFactorSurfaceTension ( ) const
inlineconstexpr

access (read-only) to private member variable

Definition at line 152 of file multiPhaseUnitConverter.h.

153 {
155 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionSurfaceTension.

◆ getConversionFactorTemperature()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getConversionFactorTemperature ( ) const
inlineconstexpr

access (read-only) to private member variable

Definition at line 158 of file multiPhaseUnitConverter.h.

159 {
161 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionTemperature.

◆ getLatticeSurfaceTension()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getLatticeSurfaceTension ( ) const
inlineconstexpr

return lattice surface tension for parameter fitting

Definition at line 164 of file multiPhaseUnitConverter.h.

165 {
167 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_latticeSurfaceTension.

◆ getPhysEoSa()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getPhysEoSa ( ) const
inlineconstexpr

return equation of state parameter a in physical units

Definition at line 102 of file multiPhaseUnitConverter.h.

103 {
104 return _physEoSa;
105 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_physEoSa.

◆ getPhysEoSb()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getPhysEoSb ( ) const
inlineconstexpr

return equation of state parameter b in physical units

Definition at line 107 of file multiPhaseUnitConverter.h.

108 {
109 return _physEoSb;
110 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_physEoSb.

◆ getPhysMolarMass()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getPhysMolarMass ( ) const
inlineconstexpr

return molar mass in physical units

Definition at line 112 of file multiPhaseUnitConverter.h.

113 {
114 return _physMolarMass;
115 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_physMolarMass.

◆ getPhysSurfaceTension()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getPhysSurfaceTension ( ) const
inlineconstexpr

return surface tension in physical units

Definition at line 117 of file multiPhaseUnitConverter.h.

118 {
119 return _physSurfaceTension;
120 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_physSurfaceTension.

◆ getPhysTemperature()

template<typename T , typename DESCRIPTOR >
constexpr T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::getPhysTemperature ( ) const
inlineconstexpr

return characteristic temperature in physical units

Definition at line 122 of file multiPhaseUnitConverter.h.

123 {
125 };

References olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_charPhysTemperature.

◆ print()

template<typename T , typename DESCRIPTOR >
void olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::print ( ) const
overridevirtual

nice terminal output for conversion factors, characteristical and physical data

Reimplemented from olb::UnitConverter< T, DESCRIPTOR >.

Definition at line 38 of file multiPhaseUnitConverter.hh.

39{
40 clout << "----------------- MultiPhaseUnitConverter information ------------------" << std::endl;
41 clout << "-- Parameters:" << std::endl;
42 clout << "Resolution: N= " << this->getResolution() << std::endl;
43 clout << "Lattice velocity: latticeU= " << this->getCharLatticeVelocity() << std::endl;
44 clout << "Lattice relaxation frequency: omega= " << this->getLatticeRelaxationFrequency() << std::endl;
45 clout << "Lattice relaxation time: tau= " << this->getLatticeRelaxationTime() << std::endl;
46 clout << "Characteristical length(m): charL= " << this->getCharPhysLength() << std::endl;
47 clout << "Characteristical speed(m/s): charU= " << this->getCharPhysVelocity() << std::endl;
48 clout << "Phys. kinematic viscosity(m^2/s): charNu= " << this->getPhysViscosity() << std::endl;
49 clout << "Characteristical pressure(N/m^2): charPressure= " << this->getCharPhysPressure() << std::endl;
50 clout << "Reynolds number: reynoldsNumber= " << this->getReynoldsNumber() << std::endl;
51 clout << "Phys. Delta X(m): physDeltaX= " << this->getPhysDeltaX() << std::endl;
52 clout << "Phys. Delta T(s): physDeltaT= " << this->getPhysDeltaT() << std::endl;
53 clout << "Phys. Surface Tension(J/m^2): physSurfaceTension= " << getPhysSurfaceTension() << std::endl;
54 clout << "Characteristical Phys. Temperature(K): charPhysTemperature= " << getCharPhysTemperature() << std::endl;
55
56 clout << "----------------- Conversion factors:-----------------------------------" << std::endl;
57 clout << "Voxel length(m): physDeltaX= " << this->getConversionFactorLength() << std::endl;
58 clout << "Time step(s): physDeltaT= " << this->getConversionFactorTime() << std::endl;
59 clout << "Velocity factor(m/s): physVelocity= " << this->getConversionFactorVelocity() << std::endl;
60 clout << "Density factor(kg/m^3): physDensity= " << this->getConversionFactorDensity() << std::endl;
61 clout << "Mass factor(kg): physMass= " << this->getConversionFactorMass() << std::endl;
62 clout << "Viscosity factor(m^2/s): physViscosity= " << this->getConversionFactorViscosity() << std::endl;
63 clout << "Force factor(N): physForce= " << this->getConversionFactorForce() << std::endl;
64 clout << "Pressure factor(N/m^2): physPressure= " << this->getConversionFactorPressure() << std::endl;
65 clout << "Equation of state a(Jm^3/mol^2): physEoSa= " << getConversionFactorEoSa() << std::endl;
66 clout << "Equation of state b(m^3/mol): physEoSb= " << getConversionFactorEoSb() << std::endl;
67 clout << "Molar mass(kg/mol): physMolarMass= " << getConversionFactorMolarMass() << std::endl;
68 clout << "Surface tension(J/m^2): physSurfaceTension= " << getConversionFactorSurfaceTension() << std::endl;
69 clout << "Temperature(K): physTemperature= " << getConversionFactorTemperature() << std::endl;
70
71 clout << "------------------------------------------------------------------------" << std::endl;
72
73}
constexpr T getConversionFactorEoSa() const
access (read-only) to private member variable
constexpr T getConversionFactorTemperature() const
access (read-only) to private member variable
constexpr T getCharPhysTemperature() const
return characteristic temperature in physical units
constexpr T getPhysSurfaceTension() const
return surface tension in physical units
constexpr T getConversionFactorSurfaceTension() const
access (read-only) to private member variable
constexpr T getConversionFactorEoSb() const
access (read-only) to private member variable
constexpr T getConversionFactorMolarMass() const
access (read-only) to private member variable
constexpr T getConversionFactorViscosity() const
access (read-only) to private member variable
constexpr T getCharPhysLength() const
return characteristic length in physical units
constexpr int getResolution() const
return resolution
constexpr T getConversionFactorDensity() const
access (read-only) to private member variable
constexpr T getLatticeRelaxationFrequency() const
return relaxation frequency in lattice units
constexpr T getConversionFactorLength() const
access (read-only) to private member variable
constexpr T getCharLatticeVelocity() const
return characteristic velocity in lattice units
constexpr T getConversionFactorVelocity() const
access (read-only) to private member variable
constexpr T getConversionFactorMass() const
access (read-only) to private member variable
constexpr T getPhysViscosity() const
return viscosity in physical units
constexpr T getConversionFactorForce() const
access (read-only) to private member variable
constexpr T getConversionFactorPressure() const
access (read-only) to private member variable
constexpr T getCharPhysVelocity() const
return characteristic velocity in physical units
constexpr T getPhysDeltaT() const
returns time spacing (timestep length) in s
constexpr T getConversionFactorTime() const
access (read-only) to private member variable
constexpr T getCharPhysPressure() const
return characteristic pressure in physical units
constexpr T getLatticeRelaxationTime() const
return relaxation time in lattice units
constexpr T getReynoldsNumber() const
return Reynolds number
constexpr T getPhysDeltaX() const
returns grid spacing (voxel length) in m

Member Data Documentation

◆ _charPhysTemperature

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_charPhysTemperature
protected

Definition at line 188 of file multiPhaseUnitConverter.h.

◆ _conversionEoSa

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionEoSa
protected

Definition at line 176 of file multiPhaseUnitConverter.h.

◆ _conversionEoSb

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionEoSb
protected

Definition at line 177 of file multiPhaseUnitConverter.h.

◆ _conversionGasConstant

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionGasConstant = 8.314462618
protected

Definition at line 179 of file multiPhaseUnitConverter.h.

◆ _conversionMolarMass

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionMolarMass
protected

Definition at line 178 of file multiPhaseUnitConverter.h.

◆ _conversionSurfaceTension

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionSurfaceTension
protected

Definition at line 180 of file multiPhaseUnitConverter.h.

◆ _conversionTemperature

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_conversionTemperature
protected

Definition at line 181 of file multiPhaseUnitConverter.h.

◆ _latticeSurfaceTension

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_latticeSurfaceTension
protected

Definition at line 191 of file multiPhaseUnitConverter.h.

◆ _physEoSa

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_physEoSa
protected

Definition at line 184 of file multiPhaseUnitConverter.h.

◆ _physEoSb

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_physEoSb
protected

Definition at line 185 of file multiPhaseUnitConverter.h.

◆ _physMolarMass

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_physMolarMass
protected

Definition at line 186 of file multiPhaseUnitConverter.h.

◆ _physSurfaceTension

template<typename T , typename DESCRIPTOR >
const T olb::MultiPhaseUnitConverter< T, DESCRIPTOR >::_physSurfaceTension
protected

Definition at line 187 of file multiPhaseUnitConverter.h.


The documentation for this class was generated from the following files: