![]() |
OpenLB 1.8.1
|
Conversion between physical and lattice units, as well as discretization. More...
#include <unitConverter.h>
Inheritance diagram for olb::UnitConverter< T, DESCRIPTOR >:
Collaboration diagram for olb::UnitConverter< T, DESCRIPTOR >: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 | getCharCFLnumber () const |
| return characteristic CFL number | |
| 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 | |
| template<unsigned D> | |
| constexpr Vector< T, D > | getLatticeVelocity (Vector< T, D > physU) 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 | |
| template<unsigned D> | |
| constexpr Vector< T, D > | getPhysForce (Vector< T, D > latticeForce) const |
| conversion from lattice to physical force vector | |
| 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 | |
| template<unsigned D> | |
| constexpr Vector< T, D > | getPhysTorque (Vector< T, D > latticeTorque) const |
| conversion from lattice to physical force vector | |
| 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 141 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 152 of file unitConverter.h.
|
virtualdefault |
|
inlineconstexpr |
return characteristic CFL number
Definition at line 214 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charLatticeVelocity.
|
inlineconstexpr |
return characteristic velocity in lattice units
Definition at line 209 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charLatticeVelocity.
Here is the caller graph for this function:
|
inlineconstexpr |
return characteristic length in physical units
Definition at line 199 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysLength.
Here is the caller graph for this function:
|
inlineconstexpr |
return characteristic pressure in physical units
Definition at line 229 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysPressure.
Here is the caller graph for this function:
|
inlineconstexpr |
return characteristic velocity in physical units
Definition at line 204 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysVelocity.
Here is the caller graph for this function:
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 331 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionDensity.
Here is the caller graph for this function:
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 387 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionForce.
Here is the caller graph for this function:
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 261 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionLength.
Here is the caller graph for this function:
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 347 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionMass.
Here is the caller graph for this function:
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 427 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionPressure.
Here is the caller graph for this function:
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 282 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTime.
Here is the caller graph for this function:
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 411 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTorque.
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 311 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionVelocity.
Here is the caller graph for this function:
|
inlineconstexpr |
access (read-only) to private member variable
Definition at line 363 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionViscosity.
Here is the caller graph for this function:
|
inlineconstexpr |
return Knudsen number
Definition at line 244 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::getMachNumber(), and olb::UnitConverter< T, DESCRIPTOR >::getReynoldsNumber().
Here is the call graph for this function:
|
inlineconstexpr |
conversion from physical to lattice density
Definition at line 322 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionDensity.
Here is the caller graph for this function:
|
inlineconstexpr |
Definition at line 326 of file unitConverter.h.
References olb::util::densityFromPressure(), and olb::UnitConverter< T, DESCRIPTOR >::getLatticePressure().
Here is the call graph for this function:
|
inlineconstexpr |
conversion from physical to lattice force
Definition at line 382 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 256 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionLength.
|
inlineconstexpr |
conversion from physical to lattice mass
Definition at line 342 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionMass.
|
inlineconstexpr |
conversion from physical to lattice pressure
Definition at line 422 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysPressure, and olb::UnitConverter< T, DESCRIPTOR >::_conversionPressure.
Here is the caller graph for this function:
|
inlineconstexpr |
return relaxation frequency in lattice units
Definition at line 188 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_latticeRelaxationTime.
Here is the caller graph for this function:
|
inlineconstexpr |
return relaxation frequency in lattice units computed from given physical diffusivity in m^2 / s
Definition at line 194 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionViscosity, and olb::descriptors::invCs2().
Here is the call graph for this function:
|
inlineconstexpr |
return relaxation time in lattice units
Definition at line 183 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_latticeRelaxationTime.
Here is the caller graph for this function:
|
inlineconstexpr |
conversion from physical to lattice time
Definition at line 277 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTime.
Here is the caller graph for this function:
|
inlineconstexpr |
conversion from physical to lattice torque
Definition at line 406 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTorque.
|
inlineconstexpr |
conversion from physical to lattice velocity
Definition at line 298 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionVelocity.
Here is the caller graph for this function:
|
inlineconstexpr |
conversion from physical to lattice velocity
Definition at line 304 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::getLatticeVelocity().
Here is the call graph for this function:
|
inlineconstexpr |
conversion from physical to lattice viscosity
Definition at line 358 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionViscosity, and olb::UnitConverter< T, DESCRIPTOR >::_physViscosity.
Here is the caller graph for this function:
|
inlineconstexpr |
return Mach number
Definition at line 239 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::getCharLatticeVelocity(), olb::descriptors::invCs2(), and olb::util::sqrt().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineconstexpr |
returns time spacing (timestep length) in s
Definition at line 287 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTime.
Here is the caller graph for this function:
|
inlineconstexpr |
returns grid spacing (voxel length) in m
Definition at line 266 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionLength.
Here is the caller graph for this function:
|
inlineconstexpr |
return density in physical units
Definition at line 224 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_physDensity.
Here is the caller graph for this function:
|
inlineconstexpr |
conversion from lattice to physical density
Definition at line 317 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionDensity.
|
inlineconstexpr |
conversion from lattice to physical force
Definition at line 369 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionForce.
Here is the caller graph for this function:
|
inlineconstexpr |
conversion from lattice to physical force vector
Definition at line 375 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::getPhysForce().
Here is the call graph for this function:
|
inlineconstexpr |
conversion from lattice to physical length
Definition at line 251 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionLength.
|
inlineconstexpr |
conversion from lattice to physical mass
Definition at line 337 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionMass.
|
inlineconstexpr |
conversion from lattice to physical pressure
Definition at line 417 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 272 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTime.
Here is the caller graph for this function:
|
inlineconstexpr |
conversion from lattice to physical torque
Definition at line 393 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionTorque.
Here is the caller graph for this function:
|
inlineconstexpr |
conversion from lattice to physical force vector
Definition at line 399 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::getPhysTorque().
Here is the call graph for this function:
|
inlineconstexpr |
conversion from lattice to physical velocity
Definition at line 293 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionVelocity.
Here is the caller graph for this function:
|
inlineconstexpr |
return viscosity in physical units
Definition at line 219 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_physViscosity.
Here is the caller graph for this function:
|
inlineconstexpr |
conversion from lattice to physical viscosity
Definition at line 353 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_conversionViscosity.
|
inlineconstexpr |
return resolution
Definition at line 178 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_resolution.
Here is the caller graph for this function:
|
inlineconstexpr |
return Reynolds number
Definition at line 234 of file unitConverter.h.
References olb::UnitConverter< T, DESCRIPTOR >::_charPhysLength, olb::UnitConverter< T, DESCRIPTOR >::_charPhysVelocity, and olb::UnitConverter< T, DESCRIPTOR >::_physViscosity.
Here is the caller graph for this function:
|
virtual |
nice terminal output for conversion factors, characteristical and physical data
Implements olb::UnitConverterBase.
Reimplemented in olb::AdeUnitConverter< T, DESCRIPTOR >, olb::AdsorptionConverter< T, DESCRIPTOR >, olb::MultiPhaseUnitConverter< T, DESCRIPTOR >, olb::MultiPhaseUnitConverterFromRelaxationTime< T, DESCRIPTOR >, olb::RadiativeUnitConverter< T, DESCRIPTOR >, olb::ThermalUnitConverter< T, DESCRIPTOR, ThermalLattice >, and olb::ThermalUnitConverter< T, DESCRIPTOR, TDESCRIPTOR >.
Definition at line 99 of file unitConverter.hh.
|
virtual |
Implements olb::UnitConverterBase.
Definition at line 39 of file unitConverter.hh.
References olb::descriptors::invCs2().
Here is the call graph for this function:
|
virtual |
Implements olb::UnitConverterBase.
Definition at line 105 of file unitConverter.hh.
References olb::singleton::directories(), olb::singleton::Directories::getLogOutDir(), and olb::singleton::mpi().
Here is the call graph for this function:
|
protected |
Definition at line 459 of file unitConverter.h.
|
protected |
Definition at line 450 of file unitConverter.h.
|
protected |
Definition at line 454 of file unitConverter.h.
|
protected |
Definition at line 451 of file unitConverter.h.
|
protected |
Definition at line 442 of file unitConverter.h.
|
protected |
Definition at line 445 of file unitConverter.h.
|
protected |
Definition at line 439 of file unitConverter.h.
|
protected |
Definition at line 443 of file unitConverter.h.
|
protected |
Definition at line 447 of file unitConverter.h.
|
protected |
Definition at line 440 of file unitConverter.h.
|
protected |
Definition at line 446 of file unitConverter.h.
|
protected |
Definition at line 441 of file unitConverter.h.
|
protected |
Definition at line 444 of file unitConverter.h.
|
protected |
Definition at line 458 of file unitConverter.h.
|
protected |
Definition at line 453 of file unitConverter.h.
|
protected |
Definition at line 452 of file unitConverter.h.
|
protected |
Definition at line 457 of file unitConverter.h.