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

Free Surface Processor 6 Calculates mass excess from the cell type conversions and distributes them to neighbouring interface cells Keeps mass local if no neighbour exists until an interface reappears at this position. More...

#include <freeSurfacePostProcessor2D.h>

+ Collaboration diagram for olb::FreeSurfaceMassExcessPostProcessor2D< 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::FreeSurfaceMassExcessPostProcessor2D< T, DESCRIPTOR >

Free Surface Processor 6 Calculates mass excess from the cell type conversions and distributes them to neighbouring interface cells Keeps mass local if no neighbour exists until an interface reappears at this position.

Definition at line 120 of file freeSurfacePostProcessor2D.h.

Member Function Documentation

◆ apply()

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

@hint EPSILON of neighbours used here @hint Mass can be set in this processor, but not epsilon since it is needed for the normal computation. epsilon is set in the next processor Became untrue due to code section removal, but epsilon is still set in the next part because of pushed mass excess

Definition at line 320 of file freeSurfacePostProcessor2D.hh.

320 {
321
322 using namespace olb::FreeSurface;
323
325 return;
326 }
327
328 T rho = cell.computeRho();
329 T mass = cell.template getField<FreeSurface::MASS>( );
330 T mass_excess = 0.;
331
332 auto normal = computeParkerYoungInterfaceNormal(cell);
333 // redistribute excess mass
334
339 mass_excess = mass;
340 cell.template setField<FreeSurface::MASS>( 0. );
341 normal = {-normal[0], -normal[1]};
342 } else if (hasCellFlags(cell, FreeSurface::Flags::ToFluid)) {
343 mass_excess = mass - rho;
344 cell.template setField<FreeSurface::MASS>( rho );
345 } else {
346 return;
347 }
348
349 std::array<T,DESCRIPTOR::q> products;
350 products[0] = 0.;
351 T product_sum = 0.;
352 std::size_t product_total = 0;
353
354 for(int iPop=1; iPop<DESCRIPTOR::q; iPop++) {
355 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
356 descriptors::c<DESCRIPTOR>(iPop,1)});
357 products[iPop] = 0.;
358
359 // Thuerey Paper says we can't use new interface cells
360 // or flagged cells
361 // But surface tension showed us that it has anisotropic effects
363 static_cast<FreeSurface::Flags>(255)) /*|| hasCellFlags(cellC, FreeSurface::Flags::ToFluid)*/ ))
364 /*|| isCellType(cellC, FreeSurface::Type::Fluid)*/
365 ){
366 products[iPop] = (normal[0] * descriptors::c<DESCRIPTOR>(iPop, 0) + normal[1] * descriptors::c<DESCRIPTOR>(iPop,1));
367 if(products[iPop] <= 0){
368 products[iPop] = 0.;
369 }
370 ++product_total;
371 product_sum += products[iPop];
372 }
373 }
374
375 /* Prepare Mass excess push */
376 Vector<T,DESCRIPTOR::q> mass_excess_vector{};
377 mass_excess_vector[0] = 0.;
378
379 if (product_total > 0) {
380 T product_fraction = 1. / product_total;
381 for(int iPop=1; iPop < DESCRIPTOR::q; iPop++) {
382 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
383 descriptors::c<DESCRIPTOR>(iPop,1)});
385 static_cast<FreeSurface::Flags>(255)) /*|| hasCellFlags(cellC, FreeSurface::Flags::ToFluid)*/ ))
386 /*|| isCellType(cellC, FreeSurface::Type::Fluid)*/
387 ){
388 mass_excess_vector[iPop] = mass_excess * product_fraction;
389 } else {
390 mass_excess_vector[iPop] = 0.;
391 }
392 }
393 cell.template setField<FreeSurface::TEMP_MASS_EXCHANGE>( mass_excess_vector );
394 } else {
395 mass_excess_vector[0] = mass_excess;
396 for(int iPop=1; iPop < DESCRIPTOR::q; iPop++) {
397 mass_excess_vector[iPop] = 0.;
398 }
399 cell.template setField<FreeSurface::TEMP_MASS_EXCHANGE>( mass_excess_vector );
400 }
401}
Plain old scalar vector.
Definition vector.h:47
bool isCellType(CELL &cell, const FreeSurface::Type &type)
Vector< V, CELL::descriptor_t::d > computeParkerYoungInterfaceNormal(CELL &cell)
bool hasCellFlags(CELL &cell, const FreeSurface::Flags &flags)

References olb::FreeSurface::Interface, olb::FreeSurface::ToFluid, and olb::FreeSurface::ToGas.

◆ getPriority()

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

Definition at line 124 of file freeSurfacePostProcessor2D.h.

124 {
125 return 6;
126 }

Member Data Documentation

◆ scope

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

Definition at line 122 of file freeSurfacePostProcessor2D.h.


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