OpenLB 1.7
Loading...
Searching...
No Matches
adsorptionConverter.h
Go to the documentation of this file.
1#ifndef OLB_APPS_FLORIAN_ADSORPTIONCONVERTER_H_
2#define OLB_APPS_FLORIAN_ADSORPTIONCONVERTER_H_
3
4#include <fstream>
5#include <iostream>
6#include <unistd.h>
7
8#include "io/ostreamManager.h"
9#include "io/fileName.h"
10
11#include "core/util.h"
12#include "core/unitConverter.h"
13#include "core/singleton.h"
14
15namespace olb {
16template<typename T, typename DESCRIPTOR>
17class AdsorptionConverter : public UnitConverter<T, DESCRIPTOR> {
18 protected:
23
24 public:
38 T physDeltaX,
39 T physDeltaT,
40 T charPhysLength,
41 T charPhysVelocity,
42 T physDiffusivity,
43 T charConcentration,
44 T particleConcentration,
45 T fluidPhysViscosity) : UnitConverter<T, DESCRIPTOR>(physDeltaX,
46 physDeltaT,
47 charPhysLength,
48 charPhysVelocity,
49 physDiffusivity,
50 charConcentration),
51 _physViscosity(fluidPhysViscosity),
52 _conversionViscosity(physDeltaX * physDeltaX / physDeltaT),
53 _particleConcentration(particleConcentration),
54 clout(std::cout, "AdsConverter") {};
55
56 // rename properties because in ADE viscosity has the function of diffusivity
57 constexpr T
61 constexpr T
65 constexpr T
69
70 constexpr T
72 return _physViscosity;
73 }
74 constexpr T
79 constexpr T
86
88 return c * this->getConversionFactorDensity();
89 }
91 return Cq * _particleConcentration;
92 }
93
94
95 constexpr T
97 return this->_charPhysVelocity * this->_charPhysLength / this->_physViscosity;
98 }
99 constexpr T
101 return this->getPhysViscosity() / this->getPhysDiffusivity();
102 }
103 constexpr T
105 return this->getPhysDiffusivity()*this->getPhysDeltaT() / this->getPhysDeltaX()/ this->getPhysDeltaX();
106 }
107
108
109 void print(std::ostream &clout) const {
110 {
111 clout << "----------------- UnitConverter information -----------------" << std::endl;
112 clout << "-- Parameters:" << std::endl;
113 clout << "Resolution: N= " << this->getResolution() << std::endl;
114 clout << "Lattice velocity: latticeU= " << this->getCharLatticeVelocity() << std::endl;
115 clout << "Lattice relaxation frequency: omega= " << this->getLatticeRelaxationFrequency() << std::endl;
116 clout << "Lattice relaxation time: tau= " << this->getLatticeRelaxationTime() << std::endl;
117 clout << "Characteristic length(m): charL= " << this->getCharPhysLength() << std::endl;
118 clout << "Characteristic speed(m/s): charU= " << this->getCharPhysVelocity() << std::endl;
119 clout << "Phys. concentration(kg/m^d): charC= " << this->getPhysDensity() << std::endl;
120 clout << "Phys. diffusivity (m^2/s): Diffusivity= " << this->getPhysDiffusivity() << std::endl;
121 clout << "Phys. viscosity (m^2/s): Viscosity= " << this->getPhysViscosity() << std::endl;
122 clout << "Schmidt Number: Sc= " << this->getSchmidtNumber() << std::endl;
123 clout << "Reynolds number: reynoldsNumber= " << this->getReynoldsNumber() << std::endl;
124 clout << "Mach number: machNumber= " << this->getMachNumber() << std::endl;
125 clout << "Fourier number: fourierNumber= " << this->getFourierNumber() << std::endl;
126 clout << std::endl;
127
128 clout << "-- Conversion factors:" << std::endl;
129 clout << "Voxel length(m): physDeltaX= " << this->getConversionFactorLength() << std::endl;
130 clout << "Time step(s): physDeltaT= " << this->getConversionFactorTime() << std::endl;
131 clout << "Velocity factor(m/s): physVelocity= " << this->getConversionFactorVelocity() << std::endl;
132 clout << "Density factor(kg/m^3): physDensity= " << this->getConversionFactorDensity() << std::endl;
133 clout << "Mass factor(kg): physMass= " << this->getConversionFactorMass() << std::endl;
134 clout << "Viscosity factor(m^2/s): physViscosity= " << this->getConversionFactorViscosity() << std::endl;
135 clout << "Diffusivity factor(m^2/s): physDiffusivity=" << this->getConversionFactorDiffusivity() << std::endl;
136 clout << "Force factor(N): physForce= " << this->getConversionFactorForce() << std::endl;
137 clout << "Pressure factor(N/m^2): physPressure= " << this->getConversionFactorPressure() << std::endl;
138 clout << "Particle density factor: " << this->getConversionFactorParticleDensity() << std::endl;
139 clout << "-------------------------------------------------------------" << std::endl;
140
141 }
142 }
143
144 void print() const {
145 {
146 this->print(clout);
147 }
148 }
149};
150
151template<typename T, typename DESCRIPTOR>
153 public:
166 T schmidtNumber,
167 T reynoldsNumber,
168 T relaxationTimeADV,
169 T charPhysLength,
170 T particleLength,
171 T resolution,
172 T charPhysVelocity,
173 T physDensity,
174 T particleConcentration) : AdsorptionConverter<T, DESCRIPTOR>(charPhysLength / resolution,
175 (relaxationTimeADV - 0.5) / descriptors::invCs2<T,DESCRIPTOR>()
176 * util::pow((charPhysLength / resolution), 2)
177 / (charPhysVelocity * particleLength
178 / (schmidtNumber * reynoldsNumber)),
179 particleLength,
180 charPhysVelocity,
181 charPhysVelocity * particleLength
182 / (schmidtNumber * reynoldsNumber),
183 physDensity,
184 particleConcentration,
185 charPhysVelocity*particleLength/(reynoldsNumber)) {};
186
187};
188}
189#endif // OLB_APPS_FLORIAN_ADSORPTIONCONVERTER_H_
constexpr AdsorptionConverterFromSchmidtNumberAndRelaxation(T schmidtNumber, T reynoldsNumber, T relaxationTimeADV, T charPhysLength, T particleLength, T resolution, T charPhysVelocity, T physDensity, T particleConcentration)
Calculate parameters from nondimensionalized values.
constexpr T getFourierNumber() const
constexpr T getConversionFactorParticleDensity() const
conversion factor to convert particle density from lattice units to kg/m^3
void print() const
nice terminal output for conversion factors, characteristical and physical data
constexpr T getPhysDiffusivity() const
AdsorptionConverter(T physDeltaX, T physDeltaT, T charPhysLength, T charPhysVelocity, T physDiffusivity, T charConcentration, T particleConcentration, T fluidPhysViscosity)
Converter for adsorption reactions primarily for ADE lattices based on concentration.
constexpr T getConversionFactorDiffusivity() const
void print(std::ostream &clout) const
constexpr T getSchmidtNumber() const
constexpr T getConversionFactorViscosity() const
constexpr T getReynoldsNumber() const
constexpr T getPhysViscosity() const
constexpr T getLatticeDiffusivity() const
class for marking output with some text
Conversion between physical and lattice units, as well as discretization.
constexpr T getConversionFactorViscosity() const
access (read-only) to private member variable
constexpr T getLatticeViscosity() const
conversion from physical to lattice viscosity
constexpr T getCharPhysLength() const
return characteristic length in physical units
constexpr T getMachNumber() const
return Mach number
constexpr int getResolution() const
return resolution
constexpr T getConversionFactorDensity() const
access (read-only) to private member variable
constexpr T getPhysDensity() const
return density in physical units
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 getLatticeRelaxationTime() const
return relaxation time in lattice units
constexpr T getPhysDeltaX() const
returns grid spacing (voxel length) in m
These functions help you to create file names.
Top level namespace for all of OpenLB.
Definition of singletons: global, publicly available information.
Unit conversion handling – header file.
Set of functions commonly used in LB computations – header file.