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

Free Surface Processor 7 Finishes up left over cell conversions and prepares the state for the next simulation step. More...

#include <freeSurfacePostProcessor3D.h>

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

Free Surface Processor 7 Finishes up left over cell conversions and prepares the state for the next simulation step.

Definition at line 128 of file freeSurfacePostProcessor3D.h.

Member Function Documentation

◆ apply()

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

@hint moved flag removal to processor 1 without any negative effects

@hint moved flag removal to processor 1 without any negative effects

Definition at line 440 of file freeSurfacePostProcessor3D.hh.

440 {
441 using namespace olb::FreeSurface;
442 /* Convert flagged cells to appropriate cell types */
443 FreeSurface::Flags flags = static_cast<FreeSurface::Flags>(cell.template getField<FreeSurface::CELL_FLAGS>());
444
445 switch(flags){
447 {
450 cell.template setField<FreeSurface::EPSILON>( 1. );
451 T mass_tmp = cell.template getField<FreeSurface::MASS>();
452 mass_tmp += cell.template getField<FreeSurface::TEMP_MASS_EXCHANGE>()[0];
453 cell.template setField<FreeSurface::MASS>(mass_tmp);
454
455 }
456 break;
458 {
461 cell.template setField<FreeSurface::EPSILON>( 0. );
462 T mass_tmp = cell.template getField<FreeSurface::MASS>();
463 mass_tmp += cell.template getField<FreeSurface::TEMP_MASS_EXCHANGE>()[0];
464 cell.template setField<FreeSurface::MASS>(mass_tmp);
465
466 }
467 break;
469 {
471 }
472 break;
473 default:
474 break;
475 }
476
477 FreeSurface::Type type = static_cast<FreeSurface::Type>(cell.template getField<FreeSurface::CELL_TYPE>());
478
479 /* Collection of mass excess in a pulling step */
480 switch(type){
482 {
483 T collected_excess = 0.;
484 for(int iPop = 1; iPop < DESCRIPTOR::q; ++iPop){
485 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
486 descriptors::c<DESCRIPTOR>(iPop,1),
487 descriptors::c<DESCRIPTOR>(iPop,2)});
488 auto tempMassExchange = cellC.template getFieldPointer<FreeSurface::TEMP_MASS_EXCHANGE>();
489
490 if (hasCellFlags(cellC,
493 int iPop_op = descriptors::opposite<DESCRIPTOR>(iPop);
494 collected_excess += tempMassExchange[iPop_op];
495 }
496 }
497
498 T mass_tmp = cell.template getField<FreeSurface::MASS>();
499
500 mass_tmp += collected_excess;
501 T rho;
502 T u_tmp[DESCRIPTOR::d];
503 cell.computeRhoU(rho, u_tmp);
504
505 Vector<T,DESCRIPTOR::d> u_vel{u_tmp[0], u_tmp[1], u_tmp[2]};
506
507 cell.template setField<FreeSurface::EPSILON>( mass_tmp / rho );
508 cell.template setField<FreeSurface::MASS>(mass_tmp);
509 cell.template setField<FreeSurface::PREVIOUS_VELOCITY>(u_vel);
510 }
511 break;
513 {
514 T collected_excess = 0.;
515
516 for(int iPop = 1; iPop < DESCRIPTOR::q; ++iPop){
517 auto cellC = cell.neighbor({descriptors::c<DESCRIPTOR>(iPop,0),
518 descriptors::c<DESCRIPTOR>(iPop,1),
519 descriptors::c<DESCRIPTOR>(iPop,2)});
520 auto tempMassExchange = cellC.template getFieldPointer<FreeSurface::TEMP_MASS_EXCHANGE>();
521 if (hasCellFlags(cellC,
524 int iPop_op = descriptors::opposite<DESCRIPTOR>(iPop);
525 collected_excess += tempMassExchange[iPop_op];
526 }
527 }
528
529 T mass_tmp = cell.template getField<FreeSurface::MASS>();
530 mass_tmp += collected_excess;
531 cell.template setField<FreeSurface::MASS>(mass_tmp);
532 }
533 break;
534 default:
535 break;
536 }
537}
Plain old scalar vector.
Definition vector.h:47
void setCellType(CELL &cell, const FreeSurface::Type &type)
bool hasCellFlags(CELL &cell, const FreeSurface::Flags &flags)

References olb::FreeSurface::Fluid, olb::FreeSurface::Gas, olb::FreeSurface::Interface, olb::FreeSurface::NewInterface, olb::FreeSurface::ToFluid, and olb::FreeSurface::ToGas.

◆ getPriority()

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

Definition at line 132 of file freeSurfacePostProcessor3D.h.

132 {
133 return 7;
134 }

Member Data Documentation

◆ scope

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

Definition at line 130 of file freeSurfacePostProcessor3D.h.


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