svZeroDSolver
Loading...
Searching...
No Matches
Solver Class Reference

Class for running 0D simulations. More...

#include <Solver.h>

Public Member Functions

 Solver (const nlohmann::json &config)
 Construct a new Solver object.
 
void run ()
 Run the simulation.
 
std::string get_full_result () const
 Get the full result as a csv encoded string.
 
Eigen::VectorXd get_single_result (const std::string &dof_name) const
 Get the result of a single DOF over time.
 
double get_single_result_avg (const std::string &dof_name) const
 Get the result of a single DOF averaged over time.
 
std::vector< double > get_times () const
 Get the time steps of the result.
 
void update_block_params (const std::string &block_name, const std::vector< double > &new_params)
 Update the parameters of a block.
 
std::vector< double > read_block_params (const std::string &block_name)
 Read the parameters of a block.
 
void write_result_to_csv (const std::string &filename) const
 Write the result to a csv file.
 

Detailed Description

Class for running 0D simulations.

The solver solves for pressure and flow rate at the nodes of the lumped-parameter system [8]. The lumped-parameter network is documented in SparseSystem. Refer to Integrator for the time discretization.

Constructor & Destructor Documentation

◆ Solver()

Solver::Solver ( const nlohmann::json & config)

Construct a new Solver object.

Parameters
configConfiguration handler

Member Function Documentation

◆ get_full_result()

std::string Solver::get_full_result ( ) const

Get the full result as a csv encoded string.

Returns
std::string Result

◆ get_single_result()

Eigen::VectorXd Solver::get_single_result ( const std::string & dof_name) const

Get the result of a single DOF over time.

Parameters
dof_nameName of the degree-of-freedom
Returns
Eigen::VectorXd Result

◆ get_single_result_avg()

double Solver::get_single_result_avg ( const std::string & dof_name) const

Get the result of a single DOF averaged over time.

Parameters
dof_nameName of the degree-of-freedom
Returns
double Result

◆ get_times()

std::vector< double > Solver::get_times ( ) const

Get the time steps of the result.

Returns
std::vector<double> Vector of times

◆ read_block_params()

std::vector< double > Solver::read_block_params ( const std::string & block_name)

Read the parameters of a block.

Parameters
block_nameName of the block
Returns
std::vector<double> Block parameters

◆ run()

void Solver::run ( )

Run the simulation.

◆ update_block_params()

void Solver::update_block_params ( const std::string & block_name,
const std::vector< double > & new_params )

Update the parameters of a block.

Parameters
block_nameName of the block
new_paramsNew parameters

◆ write_result_to_csv()

void Solver::write_result_to_csv ( const std::string & filename) const

Write the result to a csv file.

Parameters
filename

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