OpenLB 1.7
|
Conversion between physical and lattice units, as well as discretization. More...
#include <unitConverter.h>
Public Member Functions | |
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 | |
virtual void | print () const |
nice terminal output for conversion factors, characteristical and physical data | |
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 | _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 |
Conversion between physical and lattice units, as well as discretization.
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 pressure and temperature we first shift the physical values by a characteristic value to asure a lattice pressure and lattice temperature between 0 and 1, e.g. physPressure - charPhysPressure = conversionPressure * latticePressure
latticeRelaxationTime | relaxation time, have to be greater than 0.5! |
physViscosity | physical kinematic viscosity in m^2 / s |
physDensity | physical density in kg / m^3 |
conversionLength | conversion factor for length m |
conversionTime | conversion factor for time s |
conversionMass | conversion factor for mass kg |
conversionVelocity | conversion velocity m / s |
conversionViscosity | conversion kinematic viscosity m^2 / s |
conversionDensity | conversion density kg / m^3 |
conversionForce | conversion force kg m / s^2 |
conversionPressure | conversion pressure kg / m s^2 |
resolution | number of grid points per charPhysLength |
charLatticeVelocity |
Definition at line 85 of file unitConverter.h.
|
inlineconstexpr |
Documentation of constructor:
physDeltaX | spacing between two lattice cells in m |
physDeltaT | time step in s |
charPhysLength | reference/characteristic length of simulation geometry in m |
charPhysVelocity | maximal or highest expected velocity during simulation in m / s |
physViscosity | physical kinematic viscosity in m^2 / s |
physDensity | physical density in kg / m^3 |
charPhysPressure | reference/characteristic physical pressure in Pa = kg / m s^2 |
Definition at line 96 of file unitConverter.h.
|
virtualdefault |
|
inlineconstexpr |
return characteristic velocity in lattice units
Definition at line 153 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charLatticeVelocity.
|
inlineconstexpr |
return characteristic length in physical units
Definition at line 143 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysLength.
|
inlineconstexpr |
return characteristic pressure in physical units
Definition at line 168 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysPressure.
|
inlineconstexpr |
return characteristic velocity in physical units
Definition at line 148 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysVelocity.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 262 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionDensity.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 310 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionForce.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 200 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionLength.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 278 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionMass.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 342 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionPressure.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 221 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTime.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 326 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTorque.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 242 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionVelocity.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 294 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionViscosity.
|
inlineconstexpr |
return Knudsen number
Definition at line 183 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::getMachNumber(), and olb::UnitConverter< T, DESCRIPTOR >::getReynoldsNumber().
|
inlineconstexpr |
conversion from physical to lattice density
Definition at line 253 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionDensity.
|
inlineconstexpr |
Definition at line 257 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::getLatticePressure().
|
inlineconstexpr |
conversion from physical to lattice force
Definition at line 305 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionForce.
|
inlineconstexpr |
conversion from physical to lattice length, returns number of voxels for given physical length
Definition at line 195 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionLength.
|
inlineconstexpr |
conversion from physical to lattice mass
Definition at line 273 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionMass.
|
inlineconstexpr |
conversion from physical to lattice pressure
Definition at line 337 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysPressure, and olb::UnitConverter< T, DESCRIPTOR >::_conversionPressure.
|
inlineconstexpr |
return relaxation frequency in lattice units
Definition at line 132 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_latticeRelaxationTime.
|
inlineconstexpr |
return relaxation frequency in lattice units computed from given physical diffusivity in m^2 / s
Definition at line 138 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionViscosity.
|
inlineconstexpr |
return relaxation time in lattice units
Definition at line 127 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_latticeRelaxationTime.
|
inlineconstexpr |
conversion from physical to lattice time
Definition at line 216 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTime.
|
inlineconstexpr |
conversion from physical to lattice torque
Definition at line 321 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTorque.
|
inlineconstexpr |
conversion from physical to lattice velocity
Definition at line 237 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionVelocity.
|
inlineconstexpr |
conversion from physical to lattice viscosity
Definition at line 289 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionViscosity, and olb::UnitConverter< T, DESCRIPTOR >::_physViscosity.
|
inlineconstexpr |
return Mach number
Definition at line 178 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::getCharLatticeVelocity(), and olb::util::sqrt().
|
inlineconstexpr |
returns time spacing (timestep length) in s
Definition at line 226 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTime.
|
inlineconstexpr |
returns grid spacing (voxel length) in m
Definition at line 205 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionLength.
|
inlineconstexpr |
return density in physical units
Definition at line 163 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_physDensity.
|
inlineconstexpr |
conversion from lattice to physical density
Definition at line 248 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionDensity.
|
inlineconstexpr |
conversion from lattice to physical force
Definition at line 300 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionForce.
|
inlineconstexpr |
conversion from lattice to physical length
Definition at line 190 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionLength.
|
inlineconstexpr |
conversion from lattice to physical mass
Definition at line 268 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionMass.
|
inlineconstexpr |
conversion from lattice to physical pressure
Definition at line 332 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysPressure, and olb::UnitConverter< T, DESCRIPTOR >::_conversionPressure.
|
inlineconstexpr |
conversion from lattice to physical time
Definition at line 211 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTime.
|
inlineconstexpr |
conversion from lattice to physical torque
Definition at line 316 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTorque.
|
inlineconstexpr |
conversion from lattice to physical velocity
Definition at line 232 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionVelocity.
|
inlineconstexpr |
return viscosity in physical units
Definition at line 158 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_physViscosity.
|
inlineconstexpr |
conversion from lattice to physical viscosity
Definition at line 284 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionViscosity.
|
inlineconstexpr |
return resolution
Definition at line 122 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_resolution.
|
inlineconstexpr |
return Reynolds number
Definition at line 173 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysLength, olb::UnitConverter< T, DESCRIPTOR >::_charPhysVelocity, and olb::UnitConverter< T, DESCRIPTOR >::_physViscosity.
|
virtual |
nice terminal output for conversion factors, characteristical and physical data
Implements olb::UnitConverterBase.
Reimplemented in olb::AdsorptionConverter< T, DESCRIPTOR >, olb::AdsorptionConverter< T, ADEDESCRIPTOR >, olb::AdeUnitConverter< T, DESCRIPTOR >, olb::MultiPhaseUnitConverter< T, DESCRIPTOR >, olb::RadiativeUnitConverter< T, DESCRIPTOR >, olb::ThermalUnitConverter< T, DESCRIPTOR, ThermalLattice >, and olb::ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR >.
Definition at line 72 of file unitConverter.hh.
|
virtual |
Implements olb::UnitConverterBase.
Definition at line 39 of file unitConverter.hh.
|
virtual |
Implements olb::UnitConverterBase.
Definition at line 78 of file unitConverter.hh.
References olb::singleton::directories(), olb::singleton::Directories::getLogOutDir(), and olb::singleton::mpi().
|
protected |
Definition at line 374 of file unitConverter.h.
|
protected |
Definition at line 365 of file unitConverter.h.
|
protected |
Definition at line 369 of file unitConverter.h.
|
protected |
Definition at line 366 of file unitConverter.h.
|
protected |
Definition at line 357 of file unitConverter.h.
|
protected |
Definition at line 360 of file unitConverter.h.
|
protected |
Definition at line 354 of file unitConverter.h.
|
protected |
Definition at line 358 of file unitConverter.h.
|
protected |
Definition at line 362 of file unitConverter.h.
|
protected |
Definition at line 355 of file unitConverter.h.
|
protected |
Definition at line 361 of file unitConverter.h.
|
protected |
Definition at line 356 of file unitConverter.h.
|
protected |
Definition at line 359 of file unitConverter.h.
|
protected |
Definition at line 373 of file unitConverter.h.
|
protected |
Definition at line 368 of file unitConverter.h.
|
protected |
Definition at line 367 of file unitConverter.h.
|
protected |
Definition at line 372 of file unitConverter.h.