OpenLB 1.7
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
olb::FreeSurfaceMassExcessPostProcessor3D< 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 <freeSurfacePostProcessor3D.h>

+ Collaboration diagram for olb::FreeSurfaceMassExcessPostProcessor3D< 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::FreeSurfaceMassExcessPostProcessor3D< 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 110 of file freeSurfacePostProcessor3D.h.

Member Function Documentation

◆ apply()

template<typename T , typename DESCRIPTOR >
template<typename CELL >
void olb::FreeSurfaceMassExcessPostProcessor3D< 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 326 of file freeSurfacePostProcessor3D.hh.

326 {
327 using namespace olb::FreeSurface;
329 return;
330 }
331
332 T rho = cell.computeRho();
333 T mass = cell.template getField<FreeSurface::MASS>( );
334 T mass_excess = 0.;
335
336 auto normal = computeParkerYoungInterfaceNormal(cell);
337 // redistribute excess mass
338
343 mass_excess = mass;
344 cell.template setField<FreeSurface::MASS>( 0. );
345 normal *= -1;
346 } else if (hasCellFlags(cell, FreeSurface::Flags::ToFluid)) {
347 mass_excess = mass - rho;
348 cell.template setField<FreeSurface::MASS>( rho );
349 } else {
350 return;
351 }
352
353 std::array<T,DESCRIPTOR::q> products;
354 products[0] = 0.;
355 T product_sum = 0.;
356 std::size_t product_total = 0;
357
358 for(int iPop=1; iPop<DESCRIPTOR::q; iPop++) {
359 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
360 descriptors::c<DESCRIPTOR>(iPop,1),
361 descriptors::c<DESCRIPTOR>(iPop,2)});
362 products[iPop] = 0.;
363
364 // Thuerey Paper says we can't use new interface cells
365 // or flagged cells
366 // But surface tension showed us that it has anisotropic effects
368 static_cast<FreeSurface::Flags>(255)) /*|| hasCellFlags(cellC, FreeSurface::Flags::ToFluid)*/ ))
369 /*|| isCellType(cellC, FreeSurface::Type::Fluid)*/
370 ){
371 products[iPop] = (normal[0] * descriptors::c<DESCRIPTOR>(iPop, 0) + normal[1] * descriptors::c<DESCRIPTOR>(iPop,1) + normal[2] * descriptors::c<DESCRIPTOR>(iPop,2));
372 if(products[iPop] <= 0){
373 products[iPop] = 0.;
374 }
375 ++product_total;
376 product_sum += products[iPop];
377 }
378 }
379
380 /* Prepare Mass excess push */
381 Vector<T,DESCRIPTOR::q> mass_excess_vector{};
382 mass_excess_vector[0] = 0.;
383 /*
384 if(product_sum > 0){
385 T fraction = 1./ product_sum;
386
387 for(int iPop = 1; iPop < DESCRIPTOR::q; ++iPop){
388 mass_excess_vector[iPop] = mass_excess * products[iPop] * fraction;
389 }
390 cell.template setField<FreeSurface::TEMP_MASS_EXCHANGE>( mass_excess_vector );
391 }
392 else*/
393 if (product_total > 0) {
394 T product_fraction = 1. / product_total;
395 for(int iPop=1; iPop < DESCRIPTOR::q; iPop++) {
396 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
397 descriptors::c<DESCRIPTOR>(iPop,1),
398 descriptors::c<DESCRIPTOR>(iPop,2)});
400 static_cast<FreeSurface::Flags>(255)) /*|| hasCellFlags(cellC, FreeSurface::Flags::ToFluid)*/ ))
401 /*|| isCellType(cellC, FreeSurface::Type::Fluid)*/
402 ){
403 mass_excess_vector[iPop] = mass_excess * product_fraction;
404 } else {
405 mass_excess_vector[iPop] = 0.;
406 }
407 }
408 cell.template setField<FreeSurface::TEMP_MASS_EXCHANGE>( mass_excess_vector );
409 } else {
410 mass_excess_vector[0] = mass_excess;
411 for(int iPop=1; iPop < DESCRIPTOR::q; iPop++) {
412 mass_excess_vector[iPop] = 0.;
413 }
414 cell.template setField<FreeSurface::TEMP_MASS_EXCHANGE>( mass_excess_vector );
415 }
416}
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::FreeSurfaceMassExcessPostProcessor3D< T, DESCRIPTOR >::getPriority ( ) const
inline

Definition at line 114 of file freeSurfacePostProcessor3D.h.

114 {
115 return 6;
116 }

Member Data Documentation

◆ scope

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

Definition at line 112 of file freeSurfacePostProcessor3D.h.


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