Flow123d  jenkins-Flow123d-windows32-release-multijob-51
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
MassBalance Class Reference

Class for calculation and writing the balance of mass, volume sources and fluxes. More...

#include <mass_balance.hh>

Collaboration diagram for MassBalance:
Collaboration graph
[legend]

Public Member Functions

 MassBalance (EquationForMassBalance *eq, const Input::Record &in_rec)
 
 ~MassBalance ()
 
void output (double time)
 Write computed fields to file. More...
 
void calculate (double time)
 

Static Public Attributes

static Input::Type::Record input_type
 

Protected Attributes

EquationForMassBalanceequation_
 Pointer to the class which implements calculation of mass, sources and fluxes. More...
 
FILE * balance_output_file
 Handle for output file for output of balance and total fluxes over individual regions and region sets. More...
 
vector< vector< double > > bcd_balance
 
vector< vector< double > > bcd_plus_balance
 
vector< vector< double > > bcd_minus_balance
 
vector< vector< double > > mass
 
vector< vector< double > > src_balance
 
vector< double > bcd_total_balance
 
vector< double > bcd_total_inflow
 
vector< double > bcd_total_outflow
 
vector< double > mass_total
 
vector< double > src_total_balance
 
vector< double > initial_mass
 
vector< double > integrated_sources
 
vector< double > integrated_fluxes
 
double initial_time
 initial time More...
 
double last_time
 time of last calculated balance More...
 
bool initial
 true before calculating the mass at initial time, otherwise false More...
 
bool cumulative
 if true then cumulative balance is computed More...
 

Detailed Description

Class for calculation and writing the balance of mass, volume sources and fluxes.

At each time instant we calculate:

In addition, the quantities are summed over all regions and integrated in time, so that the cumulative (integrated) quantities should satisfy:

INITIAL_MASS + INTEGRATED_SOURCES - INTEGRATED_FLUXES = CURRENT_MASS.

All quantities are written to the file "mass_balance.txt" in the output directory.

Definition at line 82 of file mass_balance.hh.

Constructor & Destructor Documentation

MassBalance::MassBalance ( EquationForMassBalance eq,
const Input::Record in_rec 
)

Definition at line 56 of file mass_balance.cc.

MassBalance::~MassBalance ( )

Definition at line 83 of file mass_balance.cc.

Member Function Documentation

void MassBalance::calculate ( double  time)

Calculate mass balance: flux through boundary, mass and volume sources

Definition at line 89 of file mass_balance.cc.

Here is the caller graph for this function:

void MassBalance::output ( double  time)

Write computed fields to file.

Definition at line 251 of file mass_balance.cc.

Here is the caller graph for this function:

Member Data Documentation

FILE* MassBalance::balance_output_file
protected

Handle for output file for output of balance and total fluxes over individual regions and region sets.

Definition at line 109 of file mass_balance.hh.

vector<vector<double> > MassBalance::bcd_balance
protected

Definition at line 112 of file mass_balance.hh.

vector<vector<double> > MassBalance::bcd_minus_balance
protected

Definition at line 114 of file mass_balance.hh.

vector<vector<double> > MassBalance::bcd_plus_balance
protected

Definition at line 113 of file mass_balance.hh.

vector<double> MassBalance::bcd_total_balance
protected

Definition at line 118 of file mass_balance.hh.

vector<double> MassBalance::bcd_total_inflow
protected

Definition at line 119 of file mass_balance.hh.

vector<double> MassBalance::bcd_total_outflow
protected

Definition at line 120 of file mass_balance.hh.

bool MassBalance::cumulative
protected

if true then cumulative balance is computed

Definition at line 138 of file mass_balance.hh.

EquationForMassBalance* MassBalance::equation_
protected

Pointer to the class which implements calculation of mass, sources and fluxes.

Definition at line 106 of file mass_balance.hh.

bool MassBalance::initial
protected

true before calculating the mass at initial time, otherwise false

Definition at line 135 of file mass_balance.hh.

vector<double> MassBalance::initial_mass
protected

Definition at line 124 of file mass_balance.hh.

double MassBalance::initial_time
protected

initial time

Definition at line 129 of file mass_balance.hh.

Record MassBalance::input_type
static
Initial value:
= Record("MassBalance", "Balance of mass, boundary fluxes and sources for transport of substances.")
.declare_key("cumulative", Bool(), Default("false"), "Compute cumulative balance over time. "
"If true, then balance is calculated at each computational time step, which can slow down the program.")
.declare_key("file", FileName::output(), Default("mass_balance.txt"), "File name for output of mass balance.")

Definition at line 100 of file mass_balance.hh.

vector<double> MassBalance::integrated_fluxes
protected

Definition at line 126 of file mass_balance.hh.

vector<double> MassBalance::integrated_sources
protected

Definition at line 125 of file mass_balance.hh.

double MassBalance::last_time
protected

time of last calculated balance

Definition at line 132 of file mass_balance.hh.

vector<vector<double> > MassBalance::mass
protected

Definition at line 115 of file mass_balance.hh.

vector<double> MassBalance::mass_total
protected

Definition at line 121 of file mass_balance.hh.

vector<vector<double> > MassBalance::src_balance
protected

Definition at line 116 of file mass_balance.hh.

vector<double> MassBalance::src_total_balance
protected

Definition at line 122 of file mass_balance.hh.


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