Peano 4
Loading...
Searching...
No Matches
benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV Class Reference

#include <SelfSimilarInfallFV.h>

Inheritance diagram for benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV:
Collaboration diagram for benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV:

Public Member Functions

 SelfSimilarInfallFV ()
 
void addDensity (const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double density)
 Add density of one voxel to global bookkeeping.
 
void initialCondition (double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, bool gridIsConstructed) override
 We start with a top hat overdensity.
 
virtual void boundaryConditions (const double *__restrict__ Qinside, double *__restrict__ Qoutside, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, int normal) override
 Apply Neumann boundary conditions.
 
void sourceTerm (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, double *__restrict__ S) override
 Fake source term.
 
virtual double maxEigenvalue (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal) override
 Determine max eigenvalue over Jacobian in a given point with solution values (states) Q.
 
virtual void flux (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, double *__restrict__ F) override
 Same story again: This is the standard Euler flux which is independent of any modification of the right-hand side.
 
::exahype2::RefinementCommand refinementCriterion (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t) override
 
void finishTimeStep () override
 According to the docu, I always call the superclass routine.
 
bool patchCanUseStatelessPDETerms (const tarch::la::Vector< Dimensions, double > &patchCentre, const tarch::la::Vector< Dimensions, double > &patchH, double t, double dt) const override
 Outside of the critical area, we can use the stateless PDE terms.
 

Static Public Member Functions

static GPUCallableMethod void sourceTerm (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &volumeCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, double *__restrict__ S, Offloadable)
 Manually inlined version of the source term.
 
static GPUCallableMethod double maxEigenvalue (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, Offloadable)
 Manually inlined.
 
static GPUCallableMethod void flux (const double *__restrict__ Q, const tarch::la::Vector< Dimensions, double > &faceCentre, const tarch::la::Vector< Dimensions, double > &volumeH, double t, double dt, int normal, double *__restrict__ F, Offloadable)
 Manually inlined.
 

Static Public Attributes

static constexpr double BaseDensity = 0.1
 
static constexpr double Gamma = 5.0/3.0
 
static constexpr double pInitial = 1e-6
 
static constexpr double aInitial = 0.001
 
static constexpr double AdditionalMass = 0.15
 
static constexpr double InitialTopHatRadius = 0.05
 

Private Attributes

::applications::exahype2::euler::sphericalaccretion::MassAccumulator _accumulator
 Use class from application folders.
 

Static Private Attributes

static tarch::logging::Log _log
 
static double TotalMassInPreviousTimeStep = 0.0
 After each time step, we backup the total mass in this static variable.
 

Detailed Description

Definition at line 31 of file SelfSimilarInfallFV.h.

Constructor & Destructor Documentation

◆ SelfSimilarInfallFV()

benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::SelfSimilarInfallFV ( )

Definition at line 11 of file SelfSimilarInfallFV.cpp.

Member Function Documentation

◆ addDensity()

void benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::addDensity ( const tarch::la::Vector< Dimensions, double > & volumeCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double density )

Add density of one voxel to global bookkeeping.

Definition at line 16 of file SelfSimilarInfallFV.cpp.

References logDebug, tarch::la::norm2(), and tarch::la::volume().

Here is the call graph for this function:

◆ boundaryConditions()

void benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::boundaryConditions ( const double *__restrict__ Qinside,
double *__restrict__ Qoutside,
const tarch::la::Vector< Dimensions, double > & faceCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double t,
int normal )
overridevirtual

Apply Neumann boundary conditions.

I'm super lazy here and rely on the pre-manufactured routine from the EulerKernels.h which are shipped with the actual Euler application.

Definition at line 100 of file SelfSimilarInfallFV.cpp.

References logTraceInWith4Arguments, and logTraceOut.

◆ finishTimeStep()

void benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::finishTimeStep ( )
override

According to the docu, I always call the superclass routine.

After that, I check whether this has been the last sweep of the current time step. If so, we let the mass accummulation know.

◆ flux() [1/2]

virtual void benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::flux ( const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & faceCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double t,
double dt,
int normal,
double *__restrict__ F )
overridevirtual

Same story again: This is the standard Euler flux which is independent of any modification of the right-hand side.

◆ flux() [2/2]

static GPUCallableMethod void benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::flux ( const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & faceCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double t,
double dt,
int normal,
double *__restrict__ F,
Offloadable  )
static

Manually inlined.

Otherwise the same as the virtual function without the logging.

Definition at line 250 of file SelfSimilarInfallFV.h.

References applications::exahype2::euler::flux(), and Gamma.

Here is the call graph for this function:

◆ initialCondition()

void benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::initialCondition ( double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & volumeCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
bool gridIsConstructed )
override

We start with a top hat overdensity.

Please note that the initial overdensity does not enter the initial fluxes: The Euler equation are totally agnostic in principle of the density. However, the overdensity will enter the mass accumulation in the first time step.

It is important that we inject some initial energy into the system to close the PDE. This energy can be the same everywhere to get the setup going, but we may not set it to zero. If we do this, the system doesn't evolve at al.

Definition at line 63 of file SelfSimilarInfallFV.cpp.

References applications::exahype2::euler::sphericalaccretion::initialiseOverdensity_topHat(), logDebug, logTraceInWith3Arguments, logTraceOut, and tarch::la::norm2().

Here is the call graph for this function:

◆ maxEigenvalue() [1/2]

virtual double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::maxEigenvalue ( const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & faceCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double t,
double dt,
int normal )
overridevirtual

Determine max eigenvalue over Jacobian in a given point with solution values (states) Q.

As we use the plain Euler equations and "solely" modify the right-hand side compared to the baseline version, we can work with the eigenvalue realisation as it is provided by the applications folds.

Returns
Max eigenvalue. Result has to be positive, so we are actually speaking about the maximum absolute eigenvalue.

◆ maxEigenvalue() [2/2]

static GPUCallableMethod double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::maxEigenvalue ( const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & faceCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double t,
double dt,
int normal,
Offloadable  )
static

Manually inlined.

Otherwise the same as the virtual function without the logging.

Definition at line 215 of file SelfSimilarInfallFV.h.

References Gamma.

◆ patchCanUseStatelessPDETerms()

bool benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::patchCanUseStatelessPDETerms ( const tarch::la::Vector< Dimensions, double > & patchCentre,
const tarch::la::Vector< Dimensions, double > & patchH,
double t,
double dt ) const
override

Outside of the critical area, we can use the stateless PDE terms.

◆ refinementCriterion()

exahype2::RefinementCommand benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::refinementCriterion ( const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & volumeCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double t )
override

Definition at line 32 of file SelfSimilarInfallFV.cpp.

References tarch::la::equals(), and tarch::la::norm2().

Here is the call graph for this function:

◆ sourceTerm() [1/2]

void benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::sourceTerm ( const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & volumeCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double t,
double dt,
double *__restrict__ S )
override

Fake source term.

The term is a fake, i.e. does not fit to the original paper force that you find in the application folder. However, it shared some commonalities:

  • The force does not kick in immediately but fades in (a parameter).
  • The force depends on the amount of mass (overdensity) from the voxel centre to the origin.
  • The source forces always drag the solution towards the centre. That does not mean that we have fluid flow into that direction, as the pressure might actually be stronger and push the fluid away.
  • The force scales with the density.

◆ sourceTerm() [2/2]

static GPUCallableMethod void benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::sourceTerm ( const double *__restrict__ Q,
const tarch::la::Vector< Dimensions, double > & volumeCentre,
const tarch::la::Vector< Dimensions, double > & volumeH,
double t,
double dt,
double *__restrict__ S,
Offloadable  )
static

Manually inlined version of the source term.

As this variant is only called outside of the area of relevance, we know that the mass acting on the volume is the total mass.

Definition at line 181 of file SelfSimilarInfallFV.h.

References applications::exahype2::euler::sphericalaccretion::addGravitationalSource_AlphaCDM(), aInitial, and TotalMassInPreviousTimeStep.

Here is the call graph for this function:

Field Documentation

◆ _accumulator

::applications::exahype2::euler::sphericalaccretion::MassAccumulator benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::_accumulator
private

Use class from application folders.

Definition at line 38 of file SelfSimilarInfallFV.h.

◆ _log

tarch::logging::Log benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::_log
staticprivate

Definition at line 33 of file SelfSimilarInfallFV.h.

◆ AdditionalMass

constexpr double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::AdditionalMass = 0.15
staticconstexpr

Definition at line 50 of file SelfSimilarInfallFV.h.

◆ aInitial

constexpr double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::aInitial = 0.001
staticconstexpr

Definition at line 49 of file SelfSimilarInfallFV.h.

Referenced by sourceTerm().

◆ BaseDensity

constexpr double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::BaseDensity = 0.1
staticconstexpr

Definition at line 46 of file SelfSimilarInfallFV.h.

◆ Gamma

constexpr double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::Gamma = 5.0/3.0
staticconstexpr

◆ InitialTopHatRadius

constexpr double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::InitialTopHatRadius = 0.05
staticconstexpr

Definition at line 51 of file SelfSimilarInfallFV.h.

◆ pInitial

constexpr double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::pInitial = 1e-6
staticconstexpr

Definition at line 48 of file SelfSimilarInfallFV.h.

◆ TotalMassInPreviousTimeStep

double benchmarks::exahype2::euler::sphericalaccretionupscaling::SelfSimilarInfallFV::TotalMassInPreviousTimeStep = 0.0
staticprivate

After each time step, we backup the total mass in this static variable.

It has to be static, as we want to use it in stateless terms later on.

Definition at line 44 of file SelfSimilarInfallFV.h.

Referenced by sourceTerm().


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