OpenLB 1.8.1
Loading...
Searching...
No Matches
olb::FreeSurfaceToFluidCellConversionPostProcessor3D< T, DESCRIPTOR > Class Template Reference

#include <freeSurfacePostProcessor3D.h>

+ Collaboration diagram for olb::FreeSurfaceToFluidCellConversionPostProcessor3D< T, DESCRIPTOR >:

Public Member Functions

int getPriority () const
 
template<typename CELL >
void apply (CELL &cell) any_platform
 

Static Public Attributes

static constexpr OperatorScope scope = OperatorScope::PerCell
 

Detailed Description

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

Definition at line 90 of file freeSurfacePostProcessor3D.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR >
template<typename CELL >
void olb::FreeSurfaceToFluidCellConversionPostProcessor3D< T, DESCRIPTOR >::apply ( CELL & cell)

Definition at line 274 of file freeSurfacePostProcessor3D.hh.

274 {
275 using namespace olb::FreeSurface;
276
277 // Convert a gas cell to interface if it is in the neighborhood of a toFluid neighbour cell
279 // Initialize distribution functions for a cell converted to interface from gas, using the
280 // equilibrium refilling method, i.e., the average velocity and density of neighboring cells.
282 T rho_average = T(0);
283 T u_average[DESCRIPTOR::d] = {T(0), T(0), T(0)};
284 std::uint8_t count = std::uint8_t(0);
285
286 for (int iPop = 1; iPop < DESCRIPTOR::q; ++iPop) {
287 auto nbrCell = cell.neighbor(descriptors::c<DESCRIPTOR>(iPop));
288
289 // Only consider neighbouring cells which are fluid or interface cells.
290 // Note: newly converted interface cells are not considered here, i.e., CELL_TYPE is not updated yet.
292 T rho_tmp = T(0);
293 T u_tmp[DESCRIPTOR::d] = {T(0), T(0), T(0)};
294 ++count;
295 nbrCell.computeRhoU(rho_tmp, u_tmp);
296 rho_average += rho_tmp;
297 for (std::size_t i = 0; i < DESCRIPTOR::d; ++i) { u_average[i] += u_tmp[i]; }
298 }
299 }
300
301 if (count > std::uint8_t(0)) {
302 rho_average /= static_cast<T>(count);
303 for (std::size_t i = 0; i < DESCRIPTOR::d; ++i) { u_average[i] /= static_cast<T>(count); }
304 }
305 else {
306 // If no valid neighbouring cells are found
307 rho_average = T(1);
308 for (std::size_t i = 0; i < DESCRIPTOR::d; ++i) { u_average[i] = T(0); }
309 }
310
311 cell.iniEquilibrium(rho_average, u_average);
312 }
313
314 // If an interface cell with a ToGas flag has a neighbouring ToFluid cell, unset the ToGas flag
318 }
319 }
320}
bool hasNeighbourFlags(CELL &cell, const FreeSurface::Flags &flags)
bool isCellType(CELL &cell, const FreeSurface::Type &type)
bool hasCellFlags(CELL &cell, const FreeSurface::Flags &flags)
void setCellFlags(CELL &cell, const FreeSurface::Flags &flags)
constexpr int c(unsigned iPop, unsigned iDim) any_platform
Definition functions.h:83

References olb::descriptors::c(), olb::FreeSurface::Fluid, olb::FreeSurface::Gas, olb::FreeSurface::Interface, olb::FreeSurface::NewInterface, olb::FreeSurface::None, olb::FreeSurface::ToFluid, and olb::FreeSurface::ToGas.

+ Here is the call graph for this function:

◆ getPriority()

template<typename T , typename DESCRIPTOR >
int olb::FreeSurfaceToFluidCellConversionPostProcessor3D< T, DESCRIPTOR >::getPriority ( ) const
inline

Definition at line 94 of file freeSurfacePostProcessor3D.h.

94 {
95 return 3;
96 }

Member Data Documentation

◆ scope

template<typename T , typename DESCRIPTOR >
OperatorScope olb::FreeSurfaceToFluidCellConversionPostProcessor3D< T, DESCRIPTOR >::scope = OperatorScope::PerCell
staticconstexpr

Definition at line 92 of file freeSurfacePostProcessor3D.h.


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