DamBreak++ Wave Simulator 0.3
DamBreak++ Simulation Framework
Loading...
Searching...
No Matches
DamBreakSim Class Reference

Base class for simulating the Dam Break Problem. More...

#include <DamBreakSim.h>

Inheritance diagram for DamBreakSim:

Public Types

enum class  eInitialWaveProfile { SINE = 0 , STEP = 1 }

Public Member Functions

 DamBreakSim ()
 Default ctor.
 ~DamBreakSim ()=default
 Force destructor to be virtual.
 DamBreakSim (const DamBreakSim &aOther)=delete
 copying not allowed
DamBreakSimoperator= (const DamBreakSim &aOther)=delete
 assigning not allowed
void run () override final
bool init () override final
 Some initialization of the simulator.
void unInitialize () override final
 clean-upof the simulator
void dump (const std::filesystem::path &aFilePath)
 Save data in a file for visualizing.
const DBSArrayType getH () const noexcept
 Set/get water level height.
void setPhi1 (float64 aValue)
 Initial values (water level) imposed on the left and right side of DAM.
void setPhi0 (float64 aValue)
const float64 getPhi1 () const
 Constant value in the initial setting of the Dam-Break problem.
const float64 getPhi0 () const
 Constant value in the initial setting of the Dam-Break problem.
float64 getCFL () const
 Courant-Friedrich-Levy number of the simulation.
void setCFL (float64 aOther)
float64 getCurrentTime () const
 Returns the current time of the simulation.
float64 getTimeStep ()
 return time stepping
uint32 currentIteration ()
 Current iteration of the simulation.
std::string getMethodName ()
 Numerical scheme for the current simulation.
void setMethodName (const std::string &aMethodName)
 set method name of numerical scheme
void setWorkingDir (std::filesystem::path aProjectPath)
 Working directory (store result of simulation and ...)
bool isFlatBedTopography () const
 Cross-section flow topography.
void setInitialCnd (eInitialWaveProfile aType)
 Set/Get Initial profile.
eInitialWaveProfile getInitialType () const
 Initial wave profile.
std::shared_ptr< DamBreakSimgetDamBreakSim ()
 share the ownership of 'this' with all existing std::shared_ptr that refer to *this.
void profilecmp (float64 aTime)
 Plot profile of the water depth (exact/computed) at a given time.

Private Member Functions

void ImposePhysCnd ()
void saveResult ()

Private Attributes

DBSArrayType mU1
DBSArrayType mU2
DBSArrayType mH
DBSArrayType mX
DBSArrayType mZ
DBSArrayType mN
float64 mDx
int32 mNbSections
int32 mReadpar
int32 mNbIterMax
Sfx::SfxTimePrm m_Tip
bool mSimRunning
bool mUseFriction
bool mUseCompare
float64 mCFL
float64 mTime
float64 B
float64 mL
float64 mDt
float64 mS0am
float64 mS0av
float64 mPhi1
float64 mPhi0
eInitialWaveProfile m_initialWaveProfile
std::ofstream mFileRes
std::string mStVenantOut
std::string mMethodName
std::filesystem::path m_currWrkDir
Sfx::DamBreakData m_dbData
dbpp::ListSectionsFlow m_listDamBreak
CalculFF m_calculFF
 Display the result as a graph (post-script format) for visualization.

Detailed Description

Base class for simulating the Dam Break Problem.

Reference: "An Efficient Implementation of Non-Oscillatory Schemes for the Computation of Free-Surface Flows" Nujic (1995), 33, No.1

Member Enumeration Documentation

◆ eInitialWaveProfile

An enum type. Initial solution profile

Enumerator
SINE 

sine function wave form

STEP 

step function

Constructor & Destructor Documentation

◆ DamBreakSim() [1/2]

DamBreakSim::DamBreakSim ( )

Default ctor.

◆ ~DamBreakSim()

DamBreakSim::~DamBreakSim ( )
default

Force destructor to be virtual.

◆ DamBreakSim() [2/2]

DamBreakSim::DamBreakSim ( const DamBreakSim & aOther)
delete

copying not allowed

Parameters
aOtherinstance to copy from

Member Function Documentation

◆ currentIteration()

uint32 DamBreakSim::currentIteration ( )
inline

Current iteration of the simulation.

Returns
the current iteration

◆ dump()

void DamBreakSim::dump ( const std::filesystem::path & aFilePath)

Save data in a file for visualizing.

◆ getCFL()

float64 DamBreakSim::getCFL ( ) const
inline

Courant-Friedrich-Levy number of the simulation.

Returns
CFL (Courant-Friedrich-Levy) number
Deprecated
SimulationMgr will take care of this variable

◆ getCurrentTime()

float64 DamBreakSim::getCurrentTime ( ) const
inline

Returns the current time of the simulation.

Returns
current time of the simulation

◆ getDamBreakSim()

std::shared_ptr< DamBreakSim > DamBreakSim::getDamBreakSim ( )
inline

share the ownership of 'this' with all existing std::shared_ptr that refer to *this.

Returns
shared pointer

◆ getH()

const DBSArrayType DamBreakSim::getH ( ) const
inlinenoexcept

Set/get water level height.

◆ getInitialType()

eInitialWaveProfile DamBreakSim::getInitialType ( ) const
inline

Initial wave profile.

Returns
type of profile

◆ getMethodName()

std::string DamBreakSim::getMethodName ( )
inline

Numerical scheme for the current simulation.

Returns
string name of the numerical scheme

◆ getPhi0()

const float64 DamBreakSim::getPhi0 ( ) const
inline

Constant value in the initial setting of the Dam-Break problem.

Returns
Value at downstream

◆ getPhi1()

const float64 DamBreakSim::getPhi1 ( ) const
inline

Constant value in the initial setting of the Dam-Break problem.

Returns
Value at upstream

◆ getTimeStep()

float64 DamBreakSim::getTimeStep ( )
inline

return time stepping

Returns
time step

◆ ImposePhysCnd()

void DamBreakSim::ImposePhysCnd ( )
private

◆ init()

bool DamBreakSim::init ( )
finaloverride

Some initialization of the simulator.

◆ isFlatBedTopography()

bool DamBreakSim::isFlatBedTopography ( ) const
inline

Cross-section flow topography.

Returns
bottom topography type (default is flat)

◆ operator=()

DamBreakSim & DamBreakSim::operator= ( const DamBreakSim & aOther)
delete

assigning not allowed

Parameters
aOtherinstance to assign from
Returns
current instance

◆ profilecmp()

void DamBreakSim::profilecmp ( float64 aTime)

Plot profile of the water depth (exact/computed) at a given time.

Parameters
aTimetime of the simulation

◆ run()

void DamBreakSim::run ( )
finaloverride

Main loop of the simulation

◆ saveResult()

void DamBreakSim::saveResult ( )
private

◆ setCFL()

void DamBreakSim::setCFL ( float64 aOther)
inline

◆ setInitialCnd()

void DamBreakSim::setInitialCnd ( eInitialWaveProfile aType)
inline

Set/Get Initial profile.

Parameters
aTypeinitial profile

◆ setMethodName()

void DamBreakSim::setMethodName ( const std::string & aMethodName)
inline

set method name of numerical scheme

Parameters
aMethodNamename of the numerical scheme

◆ setPhi0()

void DamBreakSim::setPhi0 ( float64 aValue)
inline

◆ setPhi1()

void DamBreakSim::setPhi1 ( float64 aValue)
inline

Initial values (water level) imposed on the left and right side of DAM.

◆ setWorkingDir()

void DamBreakSim::setWorkingDir ( std::filesystem::path aProjectPath)
inline

Working directory (store result of simulation and ...)

Parameters
aProjectPathPAth of the folder

◆ unInitialize()

void DamBreakSim::unInitialize ( )
inlinefinaloverride

clean-upof the simulator

Member Data Documentation

◆ B

float64 DamBreakSim::B
private

◆ m_calculFF

CalculFF DamBreakSim::m_calculFF
private

Display the result as a graph (post-script format) for visualization.

Parameters
aOutFileNamefile name to write result
aInFileNamefile name ...

PointerToFunction(numerical flux computation)

◆ m_currWrkDir

std::filesystem::path DamBreakSim::m_currWrkDir
private

Working dir folder

◆ m_dbData

Sfx::DamBreakData DamBreakSim::m_dbData
private

Hudson data as default

◆ m_initialWaveProfile

eInitialWaveProfile DamBreakSim::m_initialWaveProfile
private

sine function, step, etc.

◆ m_listDamBreak

dbpp::ListSectionsFlow DamBreakSim::m_listDamBreak
private

◆ m_Tip

Sfx::SfxTimePrm DamBreakSim::m_Tip
private

time parameters

◆ mCFL

float64 DamBreakSim::mCFL
private

Courant-Friedrich-Levy

◆ mDt

float64 DamBreakSim::mDt
private

time step

◆ mDx

float64 DamBreakSim::mDx
private

Lattice spacing

◆ mFileRes

std::ofstream DamBreakSim::mFileRes
private

file for printing result

◆ mH

DBSArrayType DamBreakSim::mH
private

water level

◆ mL

float64 DamBreakSim::mL
private

size of periodic region

◆ mMethodName

std::string DamBreakSim::mMethodName
private

name of the active method (Numerical scheme)

◆ mN

DBSArrayType DamBreakSim::mN
private

Manning coefficient

◆ mNbIterMax

int32 DamBreakSim::mNbIterMax
private

maximum number iterations

◆ mNbSections

int32 DamBreakSim::mNbSections
private

Number of cross-sections

◆ mPhi0

float64 DamBreakSim::mPhi0
private

initial water level (right side)

◆ mPhi1

float64 DamBreakSim::mPhi1
private

initial water level (left side)

◆ mReadpar

int32 DamBreakSim::mReadpar
private

Reading flag (end of file)

◆ mS0am

float64 DamBreakSim::mS0am
private

slope upstream

◆ mS0av

float64 DamBreakSim::mS0av
private

slope downstream

◆ mSimRunning

bool DamBreakSim::mSimRunning
private

◆ mStVenantOut

std::string DamBreakSim::mStVenantOut
private

Filename for the final result of the water depth

◆ mTime

float64 DamBreakSim::mTime
private

current time

◆ mU1

DBSArrayType DamBreakSim::mU1
private

first state variable

◆ mU2

DBSArrayType DamBreakSim::mU2
private

second state variable

◆ mUseCompare

bool DamBreakSim::mUseCompare
private

◆ mUseFriction

bool DamBreakSim::mUseFriction
private

◆ mX

DBSArrayType DamBreakSim::mX
private

x coordinate of each section

◆ mZ

DBSArrayType DamBreakSim::mZ
private

bathymetry


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