Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt > Class Template Reference

Two-way solver class for the steam tables. More...

#include <solver2.h>

Inheritance diagram for Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >:

Solver2Base< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt > List of all members.

Public Member Functions

 Solver2 (const bool debug=false)
int whichRegion (const FirstProp &fp, const SecondProp &sp)
 Calculator the IAPWS-IF97 region number given (any combination of) property values.
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.

Detailed Description

template<class FirstProp, class SecondProp, int FirstPropAlt = 0, int SecondPropAlt = 0>
class Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >

Two-way solver class for the steam tables.

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;

See also:
Solver (solving for one un-correlated property)


Member Function Documentation

template<class FirstProp, class SecondProp, int FirstPropAlt = 0, int SecondPropAlt = 0>
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.

Parameters:
fp Value of FirstProp property
sp Value of SecondProp property
firstguess SteamCalculator initialised with state to be used for first guess

template<class FirstProp, class SecondProp, int FirstPropAlt = 0, int SecondPropAlt = 0>
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.

Parameters:
fp Value of FirstProp property
sp Value of SecondProp property

Implements Solver2Base< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >.

template<class FirstProp, class SecondProp, int FirstPropAlt = 0, int SecondPropAlt = 0>
int Solver2< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >::whichRegion const FirstProp &  fp,
const SecondProp &  sp
[virtual]
 

Calculator the IAPWS-IF97 region number given (any combination of) property values.

Used in the same way as Solver2::solve but the solution is not done, only the region is found.

Parameters:
fp Value of FirstProp property
sp Value of SecondProp property
To find the region for steam with u = 1500 kJ/kg and v = 0.02 m³/kg, use the following:
Solver2<SpecificEnergy,SpecificVolume> SS;
cerr << SS.whichRegion(1500. * kJ_kg, 0.02 * m3_kg);

Implements Solver2Base< FirstProp, SecondProp, FirstPropAlt, SecondPropAlt >.


The documentation for this class was generated from the following file:
Generated on Tue Mar 22 19:07:06 2005 for freesteam by doxygen 1.3.8