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

#include <wallFunctionBoundaryPostProcessors3D.h>

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

Public Member Functions

 WallFunctionBoundaryProcessor3D (int x0, int x1, int y0, int y1, int z0, int z1, BlockGeometry< T, 3 > &blockGeometryStructure, std::vector< int > discreteNormal, std::vector< int > missingIndices, UnitConverter< T, DESCRIPTOR > const &converter, wallFunctionParam< T > const &wallFunctionParam, IndicatorF3D< T > *geoIndicator)
 
virtual int extent () const
 Extent of application area (0 for purely local operations)
 
virtual int extent (int whichDirection) const
 Extent of application area along a direction (0 or 1)
 
virtual void process (BlockLattice< T, DESCRIPTOR > &blockLattice)
 Execute post-processing step.
 
virtual void processSubDomain (BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
 Execute post-processing step on a sublattice.
 
virtual void ComputeWallFunction (BlockLattice< T, DESCRIPTOR > &blockLattice, int x, int y, int z)
 
- Public Member Functions inherited from olb::PostProcessor3D< T, DESCRIPTOR >
 PostProcessor3D ()
 
virtual ~PostProcessor3D ()
 
std::string & getName ()
 read and write access to name
 
std::string const & getName () const
 read only access to name
 
int getPriority () const
 read only access to priority
 

Additional Inherited Members

- Protected Attributes inherited from olb::PostProcessor3D< T, DESCRIPTOR >
int _priority
 

Detailed Description

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

Definition at line 99 of file wallFunctionBoundaryPostProcessors3D.h.

Constructor & Destructor Documentation

◆ WallFunctionBoundaryProcessor3D()

template<typename T , typename DESCRIPTOR >
olb::WallFunctionBoundaryProcessor3D< T, DESCRIPTOR >::WallFunctionBoundaryProcessor3D ( int x0,
int x1,
int y0,
int y1,
int z0,
int z1,
BlockGeometry< T, 3 > & blockGeometryStructure,
std::vector< int > discreteNormal,
std::vector< int > missingIndices,
UnitConverter< T, DESCRIPTOR > const & converter,
wallFunctionParam< T > const & wallFunctionParam,
IndicatorF3D< T > * geoIndicator )

=== STEP 1 : Define distance for boundary and neighbor nodes

Definition at line 100 of file wallFunctionBoundaryPostProcessors3D.hh.

105 : x0(x0_), x1(x1_), y0(y0_), y1(y1_), z0(z0_), z1(z1_),
106 _blockGeometryStructure(blockGeometryStructure),
107 _discreteNormal(discreteNormal), _missingIndices(missingIndices),
108 _converter(converter), _wallFunctionParam(wallFunctionParam)
109{
110 this->getName() = "WallFunctionBoundaryProcessor3D";
111 // Define Direction and orientatation
112 discreteNormalX = _discreteNormal[0];
113 discreteNormalY = _discreteNormal[1];
114 discreteNormalZ = _discreteNormal[2];
115
116 int Type_BC = discreteNormalX*discreteNormalX + discreteNormalY*discreteNormalY + discreteNormalZ*discreteNormalZ;
117 T normal_norm = util::sqrt(Type_BC); // l2 norm : magnitude of the vector
118 if (Type_BC == 1) { // Straight plane
119 if (discreteNormalX != 0) {
120 orientation = discreteNormalX;
121 direction = 0;
122 }
123 else if (discreteNormalY != 0) {
124 orientation = discreteNormalY;
125 direction = 1;
126 }
127 else if (discreteNormalZ != 0) {
128 orientation = discreteNormalZ;
129 direction = 2;
130 }
131 }
132 else if (Type_BC == 2) { // Edge
133 orientation = 0;
134 direction = 0;
135 }
136 else if (Type_BC == 3) { // Corner
137 orientation = 0;
138 direction = 0;
139 }
140
141 if (geoIndicator == NULL) {
143 y_1 = 0.5; // Default half-way Bounce-Back distance - [m] DESCRIPTOR units
144 if (_wallFunctionParam.latticeWalldistance > 0.) {
145 y_1 = _wallFunctionParam.latticeWalldistance; // [m] DESCRIPTOR units
146 }
147 y_1 *= normal_norm; // DESCRIPTOR units
148
149 // Define the unit normal vector
150 unit_normal[0] = discreteNormalX / normal_norm;
151 unit_normal[1] = discreteNormalY / normal_norm;
152 unit_normal[2] = discreteNormalZ / normal_norm;
153 }
154 else {
155 calculateWallDistances(geoIndicator);
156 if (y_1 > 2. || std::isnan(unit_normal[0]) || std::isnan(unit_normal[1]) || std::isnan(unit_normal[2])) {
157 y_1 = 0.5; // Default half-way Bounce-Back distance - [m] DESCRIPTOR units
158 if (_wallFunctionParam.latticeWalldistance > 0.) {
159 y_1 = _wallFunctionParam.latticeWalldistance; // [m] DESCRIPTOR units
160 }
161 y_1 *= normal_norm; // DESCRIPTOR units
162
163 // Define the unit normal vector
164 unit_normal[0] = discreteNormalX / normal_norm;
165 unit_normal[1] = discreteNormalY / normal_norm;
166 unit_normal[2] = discreteNormalZ / normal_norm;
167 }
168 }
169 y_2 = y_1 + normal_norm; // DESCRIPTOR units
170
171 // Computation of Rho - Zou an He - Speed up
172 getIndices(direction, 0, onWallIndices);
173 getIndices(direction, orientation, normalIndices);
174
175 // Vector needed for Pi Computation - FNeq Bounce-Back - Speep up
176 // Malaspinas condition c*n < zero
177 // Definition of directions pointing towards the fluid
178 getIndices(direction, -orientation, normalInwardsIndices);
179}
std::string & getName()
read and write access to name
cpu::simd::Pack< T > sqrt(cpu::simd::Pack< T > value)
Definition pack.h:100

References olb::PostProcessor3D< T, DESCRIPTOR >::getName(), and olb::util::sqrt().

+ Here is the call graph for this function:

Member Function Documentation

◆ ComputeWallFunction()

template<typename T , typename DESCRIPTOR >
void olb::WallFunctionBoundaryProcessor3D< T, DESCRIPTOR >::ComputeWallFunction ( BlockLattice< T, DESCRIPTOR > & blockLattice,
int x,
int y,
int z )
virtual

Definition at line 826 of file wallFunctionBoundaryPostProcessors3D.hh.

827{
828 Cell<T,DESCRIPTOR> cell_bc = blockLattice.get(x,y,z);
829 T rho_bc = 0.;
830 T u_bc[DESCRIPTOR::d];
831 T fneq_bc[DESCRIPTOR::q];
832
833 // Computation of boundary velocity from the wall function
834 ComputeUWall(blockLattice, x, y, z, u_bc);
835
836 if (_wallFunctionParam.useVanDriest) {
837 // Computation of effective relaxation time from the vanDriest damping function
838 ComputeTauEff(blockLattice, cell_bc, x, y, z, u_bc);
839 }
840
841 // Computation of density at the boundary node
842 ComputeRhoWall(blockLattice, cell_bc, x, y, z, u_bc, rho_bc);
843
844 // Computation of the second-order moment of non-equilibrium distribution function
845 ComputeFneqWall(blockLattice, cell_bc, x, y, z, u_bc, rho_bc, fneq_bc);
846
847 // Computation of the particle distribution functions according to the regularized formula
848 Dynamics<T,DESCRIPTOR>* dynamics_bc = cell_bc.getDynamics();
849
850 for (int iPop = 0; iPop < DESCRIPTOR::q; ++iPop) {
851 cell_bc[iPop] = dynamics_bc -> computeEquilibrium(iPop,rho_bc,u_bc) + fneq_bc[iPop];
852 if (std::isnan(cell_bc[iPop])) {
853 OstreamManager clout(std::cout, "Slip Musker Profile");
854 clout << "Musker Profile Computation" << std::endl;
855 clout << "Position = [" << x << ", " << y << "," << z << "]" << std::endl;
856 clout << "Normal outwards = [" << discreteNormalX << ", " << discreteNormalY << "," << discreteNormalZ << "]" << std::endl;
857 clout << "Velocity at boundary u_bc = [" << u_bc[0] << ", " << u_bc[1] << "," << u_bc[2] << "]" << std::endl;
858 clout << "Density at boundary rho_bc = " << rho_bc << std::endl;
859 exit(1);
860 }
861 }
862
863}
void exit(int exitcode)
Definition singleton.h:165

References olb::BlockLattice< T, DESCRIPTOR >::get(), and olb::Cell< T, DESCRIPTOR >::getDynamics().

+ Here is the call graph for this function:

◆ extent() [1/2]

template<typename T , typename DESCRIPTOR >
virtual int olb::WallFunctionBoundaryProcessor3D< T, DESCRIPTOR >::extent ( ) const
inlinevirtual

Extent of application area (0 for purely local operations)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 105 of file wallFunctionBoundaryPostProcessors3D.h.

106 {
107 return 2;
108 }

◆ extent() [2/2]

template<typename T , typename DESCRIPTOR >
virtual int olb::WallFunctionBoundaryProcessor3D< T, DESCRIPTOR >::extent ( int direction) const
inlinevirtual

Extent of application area along a direction (0 or 1)

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 109 of file wallFunctionBoundaryPostProcessors3D.h.

110 {
111 return 2;
112 }

◆ process()

template<typename T , typename DESCRIPTOR >
void olb::WallFunctionBoundaryProcessor3D< T, DESCRIPTOR >::process ( BlockLattice< T, DESCRIPTOR > & blockLattice)
virtual

Execute post-processing step.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 866 of file wallFunctionBoundaryPostProcessors3D.hh.

867{
868 processSubDomain(blockLattice, x0, x1, y0, y1, z0, z1);
869}
virtual void processSubDomain(BlockLattice< T, DESCRIPTOR > &blockLattice, int x0_, int x1_, int y0_, int y1_, int z0_, int z1_)
Execute post-processing step on a sublattice.

◆ processSubDomain()

template<typename T , typename DESCRIPTOR >
void olb::WallFunctionBoundaryProcessor3D< T, DESCRIPTOR >::processSubDomain ( BlockLattice< T, DESCRIPTOR > & blockLattice,
int x0_,
int x1_,
int y0_,
int y1_,
int z0_,
int z1_ )
virtual

Execute post-processing step on a sublattice.

Implements olb::PostProcessor3D< T, DESCRIPTOR >.

Definition at line 182 of file wallFunctionBoundaryPostProcessors3D.hh.

183{
184 int newX0, newX1, newY0, newY1, newZ0, newZ1;
185 if ( util::intersect (
186 x0, x1, y0, y1, z0, z1,
187 x0_, x1_, y0_, y1_, z0_, z1_,
188 newX0, newX1, newY0, newY1, newZ0, newZ1 ) ) {
189
190 int iX;
191#ifdef PARALLEL_MODE_OMP
192 #pragma omp parallel for
193#endif
194 for (iX=newX0; iX<=newX1; ++iX) {
195 for (int iY=newY0; iY<=newY1; ++iY) {
196 for (int iZ=newZ0; iZ<=newZ1; ++iZ) {
197 ComputeWallFunction(blockLattice, iX,iY,iZ);
198 }
199 }
200 }
201 }
202}
virtual void ComputeWallFunction(BlockLattice< T, DESCRIPTOR > &blockLattice, int x, int y, int z)
bool intersect(int x0, int x1, int y0, int y1, int x0_, int x1_, int y0_, int y1_, int &newX0, int &newX1, int &newY0, int &newY1)
Definition util.h:89

References olb::util::intersect().

+ Here is the call graph for this function:

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