#include <solver2.h>
Public Member Functions | |
Solver2 (const bool debug=false) | |
~Solver2 () | |
int | whichRegion (const FirstProp &fp, const SecondProp &sp) |
SteamCalculator | solve (const FirstProp &fp, const SecondProp &sp) |
Solve with no first guess provided. | |
SteamCalculator | solve (const FirstProp &fp, const SecondProp &sp, const SteamCalculator &firstguess) |
Solve with a first guess provided. | |
template<> | |
int | whichRegion (const Pressure &p, const Temperature &T) |
template<> | |
SteamCalculator | makeRegion1Guess (const Pressure &p, const Temperature &T) |
template<> | |
SteamCalculator | makeRegion2Guess (const Pressure &p, const Temperature &T) |
template<> | |
SteamCalculator | solveRegion3 (const Pressure &p, const Temperature &T, const SteamCalculator &firstguess) |
template<> | |
int | whichRegion (const Temperature &T, const SpecificEnergy &h) |
template<> | |
int | whichRegion (const Temperature &T, const SpecificEntropy &s) |
template<> | |
int | whichRegion (const Pressure &p, const SpecificEntropy &s) |
template<> | |
int | whichRegion (const Pressure &p, const SpecificEnergy &u) |
template<> | |
int | whichRegion (const Pressure &p, const SpecificEnergy &h) |
template<> | |
int | whichRegion (const SpecificEnergy &u, const SpecificVolume &v) |
template<> | |
SteamCalculator | solveRegion3 (const Pressure &p, const Temperature &T, const SteamCalculator &firstguess) |
template<> | |
SteamCalculator | makeRegion1Guess (const Pressure &p, const Temperature &T) |
template<> | |
SteamCalculator | makeRegion2Guess (const Pressure &p, const Temperature &T) |
template<> | |
SteamCalculator | solveRegion3 (const Pressure &p, const Temperature &T, const SteamCalculator &firstguess) |
template<> | |
int | whichRegion (const Pressure &p, const Temperature &T) |
template<> | |
int | whichRegion (const Temperature &T, const SpecificEnergy &h) |
template<> | |
int | whichRegion (const Temperature &T, const SpecificEntropy &s) |
template<> | |
int | whichRegion (const Pressure &p, const SpecificEntropy &s) |
template<> | |
int | whichRegion (const Pressure &p, const SpecificEnergy &u) |
template<> | |
int | whichRegion (const Pressure &p, const SpecificEnergy &h) |
template<> | |
int | whichRegion (const SpecificEnergy &u, const SpecificVolume &v) |
This is intended to be a general purpose way of defining steam state in terms of any combination of properties, eg to find the pressure at which rho = 1.1 kg/m3 and u = 2500 kJ/kg, use:
Solver2<Density,SpecificEnergy> SS; SteamCalculator S = SS.solve(1.1 * kg_m3, 2500.0 * kJ_kg); cerr << S->pres() << endl;
Likewise, even with one of the properties being a correlation property, just use
Solver2<Temperature,SpecificEnergy> SS; SteamCalculator S = SS.solve(450.0 * Kelvin, 2500.0 * kJ_kg); cerr << S->pres() << endl;
Or even,
Solver2<Temperature,Pressure> SS; SteamCalculator S = SS.solve(450.0 * Kelvin, 10.0 * bar); cerr << S->dens() << endl;
Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::Solver2 | ( | const bool | debug = false |
) | [inline] |
Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::~Solver2 | ( | ) | [inline] |
int Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion | ( | const FirstProp & | fp, | |
const SecondProp & | sp | |||
) | [virtual] |
SteamCalculator Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::solve | ( | const FirstProp & | fp, | |
const SecondProp & | sp | |||
) | [inline, virtual] |
Solve with no first guess provided.
This will called the appropriate 'make guess' method, based on the results of the whichRegion call, and then perform iteration in that region (using the appropriate 'solve region x' method) to home in on the solution using a two-way solver method.
fp | Value of FirstProp property | |
sp | Value of SecondProp property |
Implements Solver2Base< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >.
References SteamProperty< Property, PropertyAlternative >::name(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
Referenced by Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::solve().
SteamCalculator Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::solve | ( | const FirstProp & | fp, | |
const SecondProp & | sp, | |||
const SteamCalculator & | firstguess | |||
) | [inline] |
Solve with a first guess provided.
If you already have steam properties very close to your expected point, you can use this method. Note that it will not use the 'make guess' (eg Solver2::makeRegion1Guess etc) methods, so if you have faster methods like that, it may be better not to provide a first guess for Solver2 iterations.
fp | Value of FirstProp property | |
sp | Value of SecondProp property | |
firstguess | SteamCalculator initialised with state to be used for first guess |
References SteamProperty< Property, PropertyAlternative >::get(), SteamCalculator::isSet(), SteamProperty< Property, PropertyAlternative >::name(), Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::solve(), SteamCalculator::whichRegion(), and Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion().
int Solver2< Pressure, Temperature, 0, 0 >::whichRegion | ( | const Pressure & | p, | |
const Temperature & | T | |||
) | [inline] |
whichRegion given p, T
References SteamCalculator::set_pT(), and SteamCalculator::whichRegion().
SteamCalculator Solver2< Pressure, Temperature, 0, 0 >::makeRegion1Guess | ( | const Pressure & | p, | |
const Temperature & | T | |||
) | [inline] |
Use the straight-up region 1 correlation if attempting to use Solver2<p,T> for region 1
References SteamCalculator::setRegion1_pT().
SteamCalculator Solver2< Pressure, Temperature, 0, 0 >::makeRegion2Guess | ( | const Pressure & | p, | |
const Temperature & | T | |||
) | [inline] |
Use the straight-up region 2 correlation if attempting to use Solver2<p,T> for region 2
References SteamCalculator::setRegion2_pT().
SteamCalculator Solver2< Pressure, Temperature, 0, 0 >::solveRegion3 | ( | const Pressure & | p, | |
const Temperature & | T, | |||
const SteamCalculator & | firstguess | |||
) | [inline] |
That's easy - just use the correlation directly.
References SteamCalculator::set_pT().
int Solver2< Temperature, SpecificEnergy, 0, SOLVE_ENTHALPY >::whichRegion | ( | const Temperature & | T, | |
const SpecificEnergy & | h | |||
) | [inline] |
whichRegion given T, h
References kJ_kg, SAT_STEAM, SAT_WATER, B23Curve< Ordinate, Abscissa, OrdinateAlternative, AbscissaAlternative >::solve(), SatCurve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), T_CRIT, T_REG1_REG3, and TB_HIGH.
int Solver2< Temperature, SpecificEntropy, 0, SOLVE_ENTROPY >::whichRegion | ( | const Temperature & | T, | |
const SpecificEntropy & | s | |||
) | [inline] |
which region given T,s
References P_MAX, SAT_STEAM, SAT_WATER, SteamCalculator::set_pT(), B23Curve< Ordinate, Abscissa, OrdinateAlternative, AbscissaAlternative >::solve(), SatCurve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), SteamCalculator::specentropy(), T_CRIT, T_REG1_REG3, and TB_HIGH.
int Solver2< Pressure, SpecificEntropy, 0, SOLVE_ENTROPY >::whichRegion | ( | const Pressure & | p, | |
const SpecificEntropy & | s | |||
) | [inline] |
whichRegion given p, s
References kJ_kgK, MPa, P_MAX, P_MIN, SteamCalculator::pres(), REQUIRE, RHO_CRIT, SAT_STEAM, SAT_WATER, SteamCalculator::set_pT(), SteamCalculator::setRegion3_rhoT(), SteamCalculator::setSatWater_T(), B23Curve< Ordinate, Abscissa, OrdinateAlternative, AbscissaAlternative >::solve(), B13Curve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), SatCurve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), SteamCalculator::specentropy(), T_CRIT, T_MAX, and T_REG1_REG3.
int Solver2< Pressure, SpecificEnergy, 0, SOLVE_IENERGY >::whichRegion | ( | const Pressure & | p, | |
const SpecificEnergy & | u | |||
) | [inline] |
whichRegion given p, u
References kJ_kg, MPa, P_MAX, P_MIN, SteamCalculator::pres(), REQUIRE, RHO_CRIT, SAT_STEAM, SAT_WATER, SteamCalculator::setRegion3_rhoT(), SteamCalculator::setSatWater_T(), B23Curve< Ordinate, Abscissa, OrdinateAlternative, AbscissaAlternative >::solve(), B13Curve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), SatCurve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), T_CRIT, and T_REG1_REG3.
int Solver2< Pressure, SpecificEnergy, 0, SOLVE_ENTHALPY >::whichRegion | ( | const Pressure & | p, | |
const SpecificEnergy & | h | |||
) | [inline] |
whichRegion given p, h
References kJ_kg, MPa, SteamCalculator::pres(), RHO_CRIT, SAT_STEAM, SAT_WATER, SteamCalculator::set_pT(), SteamCalculator::setRegion3_rhoT(), SteamCalculator::setSatWater_T(), B23Curve< Ordinate, Abscissa, OrdinateAlternative, AbscissaAlternative >::solve(), B13Curve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), SatCurve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), SteamCalculator::specenthalpy(), T_CRIT, T_MAX, T_REG1_REG3, and T_TRIPLE.
int Solver2< SpecificEnergy, SpecificVolume, SOLVE_IENERGY, 0 >::whichRegion | ( | const SpecificEnergy & | u, | |
const SpecificVolume & | v | |||
) | [inline] |
whichRegion given u, v
References kJ_kg, m3_kg, P_MAX, SAT_STEAM, SteamCalculator::set_pT(), SteamCalculator::setB23_T(), SteamCalculator::setSatSteam_T(), SteamCalculator::setSatWater_T(), B13Curve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), B23Curve< Ordinate, Abscissa, OrdinateAlternative, AbscissaAlternative >::solve(), SatCurve< Ordinate, Abscissa, OrdinateAlt, AbscissaAlt >::solve(), SteamCalculator::specienergy(), SteamCalculator::specvol(), T_CRIT, T_REG1_REG3, TB_HIGH, and TB_LOW.
SteamCalculator Solver2< Pressure, Temperature, 0, 0 >::solveRegion3 | ( | const Pressure & | p, | |
const Temperature & | T, | |||
const SteamCalculator & | firstguess | |||
) | [inline] |
SteamCalculator Solver2< Pressure, Temperature, 0, 0 >::makeRegion1Guess | ( | const Pressure & | p, | |
const Temperature & | T | |||
) | [inline] |
SteamCalculator Solver2< Pressure, Temperature, 0, 0 >::makeRegion2Guess | ( | const Pressure & | p, | |
const Temperature & | T | |||
) | [inline] |
SteamCalculator Solver2< Pressure, Temperature, 0, 0 >::solveRegion3 | ( | const Pressure & | p, | |
const Temperature & | T, | |||
const SteamCalculator & | firstguess | |||
) | [inline] |
int Solver2< Pressure, Temperature, 0, 0 >::whichRegion | ( | const Pressure & | p, | |
const Temperature & | T | |||
) | [inline] |
int Solver2< Temperature, SpecificEnergy, 0, SOLVE_ENTHALPY >::whichRegion | ( | const Temperature & | T, | |
const SpecificEnergy & | h | |||
) | [inline] |
int Solver2< Temperature, SpecificEntropy, 0, SOLVE_ENTROPY >::whichRegion | ( | const Temperature & | T, | |
const SpecificEntropy & | s | |||
) | [inline] |
int Solver2< Pressure, SpecificEntropy, 0, SOLVE_ENTROPY >::whichRegion | ( | const Pressure & | p, | |
const SpecificEntropy & | s | |||
) | [inline] |
int Solver2< Pressure, SpecificEnergy, 0, SOLVE_IENERGY >::whichRegion | ( | const Pressure & | p, | |
const SpecificEnergy & | u | |||
) | [inline] |
int Solver2< Pressure, SpecificEnergy, 0, SOLVE_ENTHALPY >::whichRegion | ( | const Pressure & | p, | |
const SpecificEnergy & | h | |||
) | [inline] |
int Solver2< SpecificEnergy, SpecificVolume, SOLVE_IENERGY, 0 >::whichRegion | ( | const SpecificEnergy & | u, | |
const SpecificVolume & | v | |||
) | [inline] |