TransFlow
0.1.0
A transient pipeline flow simulation library
|
37 const arma::uword nGridPoints,
53 const arma::uword nGridPoints,
54 const std::string& energyEquation =
"InternalEnergy",
57 const arma::vec&
tolerances = {0.001, 0.001, 0.001},
58 const bool bruteForce =
false,
59 const arma::uword maxIterations = 200);
133 const arma::uword dt,
195 const arma::uword nGridPoints,
206 const arma::uword nGridPoints,
207 const std::string& discretizer);
arma::vec m_relaxationFactor
Relaxation factors for each property (flow, pressure and temperature).
Definition: solver.hpp:158
static arma::uword differencesWithinTolerance(const Pipeline &guess, const Pipeline &previous, const arma::vec &tolerances, const std::string &toleranceType, const arma::vec &relaxationFactors)
Check if differences between an old and a new state are within tolerances. This will either compare r...
Pipeline solveWithIterations(const arma::uword dt, const Pipeline ¤t, const BoundaryConditions &boundaryConditions, const Physics &physics) const
Solve the governing equations.
std::unique_ptr< GoverningEquationSolverBase > makeGoverningEquationSolver(const arma::uword nGridPoints, const Config &config)
Private method for making GoverningEquationSolverBase instance from Config and nGridPoints.
Definition: pipeline.hpp:16
bool m_bruteForce
Definition: solver.hpp:173
std::unique_ptr< BatchTracking > m_compositionSolver
BatchTracking instance used to advect composition in the pipeline.
Definition: solver.hpp:185
virtual Pipeline solve(const arma::uword dt, const Pipeline ¤t, const TimeStep &boundaryConditions, const Physics &physics) const
Solve the governing equations.
arma::uword m_maxIterations
Definition: solver.hpp:176
The Physics class combines EquationOfState and HeatTransfer to calculate the new state of a pipeline ...
Definition: physics.hpp:21
void enableBruteForce()
Enable brute force solver, which always does m_maxIterations iterations.
std::unique_ptr< GoverningEquationSolverBase > m_governingEquationSolver
GoverningEquationSolver instance used for solving the governing equations.
Definition: solver.hpp:182
virtual ~Solver()
Declared to avoid the inline compiler-generated default destructor.
The TimeStep class is a subclass of BoundaryConditions with an extra member to store the timestamp of...
Definition: boundaryconditions.hpp:305
arma::uword m_nIterations
Definition: solver.hpp:179
The Solver class combines GoverningEquationSolver and BatchTracking to advance the governing equation...
Definition: solver.hpp:25
const GoverningEquationSolverBase & governingEquationSolver() const
Get (const ref) GoverningEquationSolver.
Definition: solver.hpp:154
std::string m_toleranceType
Definition: solver.hpp:162
The Config struct stores all settings for the different parts of the pipeline simulation.
Definition: config.hpp:11
const arma::vec & tolerances() const
Get (const ref) tolerances.
Definition: solver.hpp:152
void setMaxIterations(const arma::uword maxIterations)
Set max iterations.
A class for calculating the time development of the gas composition from the gas velocity.
Definition: batchtracking.hpp:21
arma::vec m_tolerances
Convergence tolerances for each property (flow, pressure and temperature).
Definition: solver.hpp:165
const arma::vec & relaxationFactors() const
Get (const ref) relaxation factors.
Definition: solver.hpp:148
const std::string & toleranceType() const
Get (const ref) tolerance type.
Definition: solver.hpp:150
arma::uword nIterations() const
Return the number of iterations performed during previous solution attempt.
Definition: solver.hpp:145
The BoundaryConditions class is a container for the boundary conditions at the inlet and outlet of a ...
Definition: boundaryconditions.hpp:27
Solver(const arma::uword nGridPoints, const Config &config)
Construct from Config.
Simple Base class to avoid having to specify template argument for GoverningEquationSolver....
Definition: governingequationsolver.hpp:18