Equations of state: Difference between revisions

From ASCEND
Jump to navigation Jump to search
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
In physics and thermodynamics, an equation of state is a relation between state variables.[1] More specifically, an equation of state is a thermodynamic equation describing the state of matter under a given set of physical conditions. It is a constitutive equation which provides a mathematical relationship between two or more state functions associated with the matter, such as its temperature, pressure, volume, or internal energy. Equations of state are useful in describing the properties of fluids, mixtures of fluids, solids, and even the interior of stars.
In physics and thermodynamics, an equation of state is a relation between state variables.[1] More specifically, an equation of state is a thermodynamic equation describing the state of matter under a given set of physical conditions. It is a constitutive equation which provides a mathematical relationship between two or more state functions associated with the matter, such as its temperature, pressure, volume, or internal energy. Equations of state are useful in describing the properties of fluids, mixtures of fluids, solids, and even the interior of stars. (Source : Wikipedia)


== '''Cubic Equations of State''' ==
== '''Cubic Equations of State''' ==
Line 88: Line 88:
END testidealgas;
END testidealgas;


</source>
== '''Van der Waals equation of state''' ==
The [[Van der Waals equation]] of state may be written:
:<math>{\left(p + \frac{a}{V_m^2}\right)\left(V_m-b\right) = RT}</math>
where <math>V_m</math> is [[molar volume]]. The substance-specific constants <math>a</math> and <math>b</math> can be calculated from the [[critical properties]] <math>p_c, T_c</math> and <math>V_c</math> (noting that <math>V_c</math> is the molar volume at the critical point) as:
:<math>a = 3p_c \,V_c^2</math>
:<math>b = \frac{V_c}{3}.</math>
Also written as
:<math>a = \frac{27(R\,T_c)^2}{64p_c}</math>
:<math>b = \frac{R\,T_c}{8p_c}.</math>
The van der Waals equation may be considered as the ideal gas law, “improved” due to two independent reasons:
# Molecules are thought as particles with volume, not material points. Thus <math>V_m</math> cannot be too little, less than some constant. So we get (<math>V_m - b</math>) instead of <math>V_m</math>.
# While ideal gas molecules do not interact, we consider molecules attracting others within a distance of several molecules' radii. It makes no effect inside the material, but surface molecules are attracted into the material from the surface. We see this as diminishing of pressure on the outer shell (which is used in the ideal gas law), so we write (<math>p +</math> something) instead of <math>p</math>. To evaluate this ‘something’, let's examine an additional force acting on an element of gas surface. While the force acting on each surface molecule is ~<math>\rho</math>, the force acting on the whole element is ~<math>\rho^2</math>~<math>\frac{1}{V_m^2}</math>.
With the reduced state variables, i.e. V<sub>r</sub>=V<sub>m</sub>/V<sub>c</sub>, P<sub>r</sub>=P/P<sub>c</sub> and T<sub>r</sub>=T/T<sub>c</sub>, the reduced form of the Van der Waals equation can be formulated:
:<math>{\left(P_r + \frac{3}{V_r^2}\right)\left(3V_r-1\right) = 8T_r}</math>
The benefit of this form is that for given T<sub>r</sub> and P<sub>r</sub>, the reduced volume of the liquid and gas can be calculated directly using [[Cubic function#Cardano.27s_method|Cardano's method]] for the reduced cubic form:
:<math>{V_r^3-\left(\frac{1}{3}+ \frac{8T_r}{3P_r}\right)V_r^2+\frac{3V_r}{P_r}-\frac{1}{P_r}=0}</math>
For P<sub>r</sub><1 and T<sub>r</sub><1, the system is in a state of vapor-liquid equilibrium. The reduced cubic equation of state yields in that case 3 solutions. The largest and the lowest solution are the gas and liquid reduced volume.
<source lang=a4c>
MODEL vanderwaals(P WILL_BE pressure;
T WILL_BE temperature;
V WILL_BE molar_volume;
Z WILL_BE factor;
data WILL_BE td_component_constants;
);
R IS_A molar_gas_constant;
b IS_A molar_volume;
a IS_A vdwa;
Pc IS_A pressure;
Tc IS_A temperature;
eq: (P*V^2 + a)*(V - b) = R*T*V^2;
eqb: b*8.0*data.Pc = R*data.Tc;
eqa: a*64.0*data.Pc = 27.0*R^2*(data.Tc)^2;
eqc: Z*R*T = P*V;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
    P.fixed := TRUE;
    T.fixed := TRUE;
    V.fixed := FALSE;
    Z.fixed := FALSE;
    END specify;
    METHOD values;
    P := 12.0 {atm};
    T := 298.15 {K};
    V := 0.075 {m^3/mole};
    V.nominal := 0.05 {m^3/mole};
    V.upper_bound := 100 {m^3/mole};
    END values;
END vanderwaals;
MODEL testvanderwaals;
c1 IS_A symbol_constant;
vd IS_A vanderwaals(P,T,V,Z,cd.data[c1]);
Tr, Pr IS_A factor;
P IS_A pressure;
T IS_A temperature;
V IS_A molar_volume;
Z IS_A factor;
c1 :== 'ethylene'; 
cd IS_A components_data([c1],c1);
eqTr: Tr = T/cd.data[c1].Tc;
eqPr: Pr = P/cd.data[c1].Pc;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
P.fixed := TRUE;
V.fixed := FALSE;
T.fixed := TRUE;
Z.fixed := FALSE;
RUN vd.specify;
    END specify;
    METHOD values;
P := 12.0 {bar};
T := 298.15 {K};
RUN vd.values;
    END values;
END testvanderwaals;
</source>
<source lang=a4c>
MODEL truncated_virial_equation (P WILL_BE pressure;
T WILL_BE temperature; V WILL_BE molar_volume; Z WILL_BE factor; 
data WILL_BE td_component_constants;);
R IS_A molar_gas_constant;
Pc IS_A pressure;
Tc IS_A temperature;
T_degC IS_A factor;
omega IS_A factor;
Tr, Pr IS_A factor;
B IS_A virialB;
C IS_A virialC;
Bhat, B0, B1 IS_A factor;
Pc = data.Pc;
Tc = data.Tc;
omega = data.omega;
eq1: Tr = T/Tc;
eq2: Pr = P/Pc;
eq3: T_degC = T/1{K} - 273.15;
eq4: Bhat = B0 + omega*B1;
eq5: B0*Tr^(1.6) = 0.083*Tr^(1.6) - 0.422;
eq6: B1*Tr^(4.2) = 0.139*Tr^(4.2) - 0.172;
eq7: Z = 1.0 + B0*Pr/Tr + omega*B1*Pr/Tr;
eq8: Z*R*T = P*V;
eq9: B = Bhat*1.0{m^3/mol};
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
P.fixed := TRUE;
T_degC.fixed := FALSE;
T.fixed := TRUE; 
    END specify;
    METHOD values;
P := 12.0 {bar};
T := 298.15 {K};
    END values;
END truncated_virial_equation;
MODEL testtruncatedvirial;
c1 IS_A symbol_constant;
c1 :== 'acetonitrile';
cd IS_A components_data([c1],c1);
Tr, Pr IS_A factor;
P IS_A pressure;
T IS_A temperature;
V IS_A molar_volume;
Z IS_A factor;
tve IS_A truncated_virial_equation(P,T,V,Z,cd.data[c1]);
eqTr: Tr = T/cd.data[c1].Tc;
eqPr: Pr = P/cd.data[c1].Pc;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
P.fixed := TRUE;
V.fixed := FALSE;
Z.fixed := FALSE; 
T.fixed := TRUE;
RUN tve.specify;
    END specify;
    METHOD values;
P := 12.0 {bar};
T := 298.15 {K};
RUN tve.values;
    END values;
END testtruncatedvirial;
</source>
=== '''Redlich–Kwong equation of state''' ===
:<math>{p = \frac{R\,T}{V_m-b} - \frac{a}{\sqrt{T}\,V_m\left(V_m+b\right)}}</math>
:<math>a = \frac{0.42748\,R^2\,T_c^{\,2.5}}{p_c}</math>
:<math>b = \frac{0.08662\,R\,T_c}{p_c}</math>
The Redlich–Kwong equation is adequate for calculation of gas phase properties when the ratio of the pressure to the [[critical properties|critical pressure]] (reduced pressure) is less than about one-half of the ratio of the temperature to the [[critical properties|critical temperature]] (reduced temperature):
:<math>\frac{p}{p_c} < \frac{T}{2T_c}.</math>
<source lang=a4c>
MODEL rk(P WILL_BE pressure;
T WILL_BE temperature;
V WILL_BE molar_volume;
Z WILL_BE factor;
data WILL_BE td_component_constants;
);
R IS_A molar_gas_constant;
Pc IS_A pressure;
Tc IS_A temperature;
T_degC IS_A factor;
alpha, beta, q,Tr, Pr, omega IS_A factor;
PSI, OMEGA, sigma, eps IS_A real_constant;
PSI :== 0.42748;
OMEGA :== 0.08664;
sigma :== 1.0;
eps :== 0.0;
Pc = data.Pc;
Tc = data.Tc;
omega = data.omega;
eq1: Tr = T/Tc;
eq2: Pr = P/Pc;
eq3: T_degC = T/1{K} - 273.15;
eq4: alpha = Tr^(0.5);
eq5: q = PSI*alpha/(OMEGA*Tr);
eq6: beta = OMEGA*Pr/Tr;
eq7: Z = 1.0 + beta - q*beta*(Z - beta)/((Z + eps*beta)*(Z + sigma*beta));
eq8: P*V = Z*R*T;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
        P.fixed := TRUE;
        T_degC.fixed := FALSE;
        T.fixed := TRUE;
    END specify;
    METHOD values;
        P := 12.0 {bar};
        T := 298.15 {K};
        Z.lower_bound := 0.0;
        Z.upper_bound := 10.0;
        Z.nominal := 1.0;
    END values;
END rk;
MODEL testrk;
c1 IS_A symbol_constant;
c1 :== 'ethylene';
cd IS_A components_data([c1],c1);
Tr, Pr IS_A factor;
P IS_A pressure;
T IS_A temperature;
V IS_A molar_volume;
Z IS_A factor;
trk IS_A rk(P,T,V,Z,cd.data[c1]);
eqTr: Tr = T/cd.data[c1].Tc;
eqPr: Pr = P/cd.data[c1].Pc;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
P.fixed := TRUE;
V.fixed := FALSE;
Z.fixed := FALSE; 
T.fixed := TRUE;
RUN trk.specify;
    END specify;
METHOD values;
P := 12.0 {bar};
T := 298.15 {K};
RUN trk.values;
    END values;
END testrk;
</source>
=== '''Soave modification of Redlich–Kwong''' ===
:<math>p = \frac{R\,T}{V_m-b} - \frac{a\,\alpha}{V_m\left(V_m+b\right)}</math>
:<math>a = \frac{0.427\,R^2\,T_c^2}{P_c}</math>
:<math>b = \frac{0.08664\,R\,T_c}{P_c}</math>
:<math>\alpha = \left(1 + \left(0.48508 + 1.55171\,\omega - 0.15613\,\omega^2\right) \left(1-T_r^{\,0.5}\right)\right)^2</math>
:<math>T_r = \frac{T}{T_c}</math>
Where ω is the [[acentric factor]] for the species.
This formulation for <math>\alpha</math> is due to Graboski and Daubert.  The original formulation from Soave is:
:<math>\alpha = \left(1 + \left(0.48 + 1.574\,\omega - 0.176\,\omega^2\right) \left(1-T_r^{\,0.5}\right)\right)^2</math>
for hydrogen:
:<math>\alpha = 1.202 \exp\left(-0.30288\,T_r\right).</math>
We can also write it in the polynomial form, with:
:<math>A = \frac{a\,\alpha\,P}{R^2\,T^2}</math>
:<math>B = \frac{b\,P}{R\,T}</math>
then we have:
:<math>0 = Z^3-Z^2+Z\left(A-B-B^2\right)-AB</math>
<source lang=a4c>
MODEL srk(P WILL_BE pressure;
T WILL_BE temperature;
V WILL_BE molar_volume;
Z WILL_BE factor;
data WILL_BE td_component_constants;);
R IS_A molar_gas_constant;
Pc IS_A pressure;
Tc IS_A temperature;
T_degC IS_A factor;
alpha, beta, q,Tr, Pr, omega IS_A factor;
PSI, OMEGA, sigma, eps IS_A real_constant;
PSI :== 0.42748;
OMEGA :== 0.08664;
sigma :== 1.0;
eps :== 0.0;
Pc = data.Pc;
Tc = data.Tc;
omega = data.omega;
eq1: Tr = T/Tc;
eq2: Pr = P/Pc;
eq3: T_degC = T/1{K} - 273.15;
eq4: alpha = (1.0 + (0.480+1.574*omega-0.176*omega^2)*(1.0-Tr^(0.5)))^2;
eq5: q = PSI*alpha/(OMEGA*Tr);
eq6: beta = OMEGA*Pr/Tr;
eq7: Z = 1.0 + beta - q*beta*(Z - beta)/((Z + eps*beta)*(Z + sigma*beta));
eq8: P*V = Z*R*T;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
        P.fixed := TRUE;
        T.fixed := TRUE;
        T_degC.fixed := FALSE;
    END specify;
    METHOD values;
        P := 12.0 {bar};
        T := 298.15 {K};
        Z.lower_bound := 0.0;
        Z.upper_bound := 10.0;
        Z.nominal := 1.0;
    END values;
END srk;
MODEL testsrk;
c1 IS_A symbol_constant;
c1 :== 'ethylene';
cd IS_A components_data([c1],c1);
Tr, Pr IS_A factor;
P IS_A pressure;
T IS_A temperature;
V IS_A molar_volume;
Z IS_A factor;
tsrk IS_A srk(P,T,V,Z,cd.data[c1]);
eqTr: Tr = T/cd.data[c1].Tc;
eqPr: Pr = P/cd.data[c1].Pc;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
P.fixed := TRUE;
V.fixed := FALSE;
Z.fixed := FALSE; 
T.fixed := TRUE;
RUN tsrk.specify;
    END specify;
    METHOD values;
P := 12.0 {bar};
T := 298.15 {K};
RUN tsrk.values;
    END values;
END testsrk;
</source>
=== '''Peng–Robinson equation of state''' ===
:<math>p=\frac{R\,T}{V_m-b} - \frac{a\,\alpha}{V_m^2+2bV_m-b^2}</math>
:<math>a = \frac{0.457235\,R^2\,T_c^2}{p_c}</math>
:<math>b = \frac{0.077796\,R\,T_c}{p_c}</math>
:<math>\alpha = \left(1 + \kappa \left(1-T_r^{\,0.5}\right)\right)^2</math>
:<math>\kappa = 0.37464 + 1.54226\,\omega - 0.26992\,\omega^2</math>
:<math>T_r = \frac{T}{T_c}</math>
In polynomial form:
:<math>A = \frac{a\alpha p}{ R^2\,T^2}</math>
:<math>B = \frac{b p}{RT}</math>
:<math>Z^3 - (1-B)\ Z^2 + (A-2B-3B^2)\ Z -(AB-B^2-B^3) = 0 \,\!</math>
where, <math>\omega</math> is the [[acentric factor]] of the species, <math>R</math> is the [[universal gas constant]] and Z=PV/(RT) is [[compressibility factor]].
<source lang=a4c>
MODEL pengrobinson(P WILL_BE pressure;
T WILL_BE temperature;
V WILL_BE molar_volume;
Z WILL_BE factor;
data WILL_BE td_component_constants;);
R IS_A molar_gas_constant;
Pc IS_A pressure;
Tc IS_A temperature;
T_degC IS_A factor;
alpha, beta, q,Tr, Pr, omega IS_A factor;
PSI, OMEGA, sigma, eps IS_A real_constant;
PSI :== 0.45724;
OMEGA :== 0.07780;
sigma :== 2.414213562;
eps :== 0.414213562;
Pc = data.Pc;
Tc = data.Tc;
omega = data.omega;
eq1: Tr = T/Tc;
eq2: Pr = P/Pc;
eq3: T_degC = T/1{K} - 273.15;
eq4: alpha = (1.0 + (0.37464+1.54226*omega-0.26992*omega^2)*(1.0-Tr^(0.5)))^2;
eq5: q = PSI*alpha/(OMEGA*Tr);
eq6: beta = OMEGA*Pr/Tr;
eq7: Z = 1.0 + beta - q*beta*(Z - beta)/((Z + eps*beta)*(Z + sigma*beta));
eq8: P*V = Z*R*T;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
        P.fixed := TRUE;
        T.fixed := TRUE;
        T_degC.fixed := FALSE;
    END specify;
    METHOD values;
        P := 12.0 {bar};
        T := 298.15 {K};
        Z.lower_bound := 0.0;
        Z.upper_bound := 10.0;
        Z.nominal := 0.1;
    END values;
END pengrobinson;
MODEL testpengrobinson;
c1 IS_A symbol_constant;
c1 :== 'ethylene';
cd IS_A components_data([c1],c1);
Tr, Pr IS_A factor;
P IS_A pressure;
T IS_A temperature;
V IS_A molar_volume;
Z IS_A factor;
tpeng IS_A pengrobinson(P,T,V,Z,cd.data[c1]);
eqTr: Tr = T/cd.data[c1].Tc;
eqPr: Pr = P/cd.data[c1].Pc;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
P.fixed := TRUE;
V.fixed := FALSE;
Z.fixed := FALSE; 
T.fixed := TRUE;
RUN tpeng.specify;
    END specify;
    METHOD values;
P := 12.0 {bar};
T := 298.15 {K};
RUN tpeng.values;
    END values;
 
END testpengrobinson;
</source>
<source lang=a4c>
MODEL vdw(P WILL_BE pressure;
T WILL_BE temperature;
V WILL_BE molar_volume;
Z WILL_BE factor;
data WILL_BE td_component_constants;);
R IS_A molar_gas_constant;
Pc IS_A pressure;
Tc IS_A temperature;
T_degC IS_A factor;
beta, q,Tr, Pr, omega IS_A factor;
alpha, PSI, OMEGA, sigma, eps IS_A real_constant;
PSI :== 27.0/64.0;
OMEGA :== 1.0/8.0;
sigma :== 0.0;
eps :== 0.0;
alpha :== 1.0;
Pc = data.Pc;
Tc = data.Tc;
omega = data.omega;
eq1: Tr = T/Tc;
eq2: Pr = P/Pc;
eq3: T_degC = T/1{K} - 273.15;
eq5: q = PSI*alpha/(OMEGA*Tr);
eq6: beta = OMEGA*Pr/Tr;
eq7: Z = 1.0 + beta - q*beta*(Z - beta)/((Z + eps*beta)*(Z + sigma*beta));
eq8: P*V = Z*R*T;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
    P.fixed := TRUE;
    T.fixed := TRUE;
    T_degC.fixed := FALSE;
    END specify;
    METHOD values;
    P := 12.0 {bar};
    T := 298.15 {K};
    Z.lower_bound := 0.0;
    Z.upper_bound := 10.0;
    Z.nominal := 0.1;
    END values;
END vdw;
MODEL testvdw;
c1 IS_A symbol_constant;
c1 :== 'ethylene';
cd IS_A components_data([c1],c1);
Tr, Pr IS_A factor;
P IS_A pressure;
T IS_A temperature;
V IS_A molar_volume;
Z IS_A factor;
tvdw IS_A vdw(P,T,V,Z,cd.data[c1]);
eqTr: Tr = T/cd.data[c1].Tc;
eqPr: Pr = P/cd.data[c1].Pc;
METHODS
    METHOD default_self;
RUN ClearAll;
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
P.fixed := TRUE;
V.fixed := FALSE;
Z.fixed := FALSE; 
T.fixed := TRUE;
RUN tvdw.specify;
    END specify;
    METHOD values;
P := 12.0 {bar};
T := 298.15 {K};
RUN tvdw.values;
    END values;
END testvdw;
</source>
This a test model to run all the models above.
<source lang=a4c>
MODEL testall;
P IS_A pressure;
T IS_A temperature;
Vvanderwaals, Vvdw, Videal, Vtruncvirial, Vrk, Vsrk, Vpeng IS_A molar_volume;
Zvanderwaals, Zvdw, Ztruncvirial, Zrk, Zsrk, Zpeng IS_A factor;
c1 IS_A symbol_constant;
c1 :== 'acetonitrile';
cd IS_A components_data([c1],c1);
Tr, Pr IS_A factor;
ig IS_A idealgas(P,T,Videal);
vd IS_A vanderwaals(P,T,Vvanderwaals,Zvanderwaals,cd.data[c1]);
vdd IS_A vdw(P,T,Vvdw,Zvdw,cd.data[c1]);
tve IS_A truncated_virial_equation(P,T,Vtruncvirial,Ztruncvirial,cd.data[c1]);
trk IS_A rk(P,T,Vrk,Zrk,cd.data[c1]);
tsrk IS_A srk(P,T,Vsrk,Zsrk,cd.data[c1]);
tpeng IS_A pengrobinson(P,T,Vpeng,Zpeng,cd.data[c1]);
eqTr: Tr = T/cd.data[c1].Tc;
eqPr: Pr = P/cd.data[c1].Pc;
METHODS
    METHOD default_self;
(* RUN ClearAll; *)
RUN specify;
RUN values;
    END default_self;
    METHOD specify;
P.fixed := TRUE;
T.fixed := TRUE;
Videal.fixed := FALSE;
Vvanderwaals.fixed := FALSE;
Vvdw.fixed := FALSE;
Vtruncvirial.fixed := FALSE;
Vrk.fixed := FALSE;
Vsrk.fixed := FALSE;
Vpeng.fixed := FALSE;
Zvanderwaals.fixed := FALSE;
Zvdw.fixed := FALSE;
Ztruncvirial.fixed := FALSE;
Zrk.fixed := FALSE;
Zsrk.fixed := FALSE;
Zpeng.fixed := FALSE;
RUN ig.specify;
RUN vd.specify;
RUN vdd.specify;
RUN tve.specify;
RUN trk.specify;
RUN tsrk.specify;
RUN tpeng.specify;
    END specify;
    METHOD values;
P := 306.12 {atm};
T := 561 {K};
RUN ig.values;
RUN vd.values;
RUN vdd.values;
RUN tve.values;
RUN trk.values;
RUN tsrk.values;
RUN tpeng.values;
    END values;
END testall;
</source>
</source>

Latest revision as of 21:36, 18 June 2013

In physics and thermodynamics, an equation of state is a relation between state variables.[1] More specifically, an equation of state is a thermodynamic equation describing the state of matter under a given set of physical conditions. It is a constitutive equation which provides a mathematical relationship between two or more state functions associated with the matter, such as its temperature, pressure, volume, or internal energy. Equations of state are useful in describing the properties of fluids, mixtures of fluids, solids, and even the interior of stars. (Source : Wikipedia)

Cubic Equations of State

Cubic equations of state are called such because they can be rewritten as a cubic function of Vm.

All the models below are first modeled as a general, re-usable model and then used in a test-model. This code defines virial coefficients as well as the model for ideal gas laws:

REQUIRE "thermodynamics.a4l";

ATOM vdwa REFINES solver_var
	DIMENSION M*L^5/Q^2/T^2
	DEFAULT 0.1 {kg*m^5/mole^2/sec^2};
	lower_bound := 0.0 {kg*m^5/mole^2/sec^2};
	upper_bound := 10.0 {kg*m^5/mole^2/sec^2};
	nominal := 0.1 {kg*m^5/mole^5/sec^2};
END vdwa;

ATOM virialC REFINES solver_var
	DIMENSION L^6/Q^2
	DEFAULT 7000.0 {cm^6/mol^2};
	lower_bound := 0.0 {cm^6/mol^2};
	upper_bound := 1.0 {m^6/mol^2};
	nominal := 7000.0 {cm^6/mol^2};
END virialC;

ATOM virialB REFINES solver_var
	DIMENSION L^3/Q
	DEFAULT 1.0 {m^3/mol};
	lower_bound := -1000.00 {m^3/mol};
	upper_bound := 1000.0 {m^3/mol};
	nominal := 1.0 {m^3/mol};
END virialB;


MODEL idealgas(P WILL_BE pressure;
	T WILL_BE temperature;
	V WILL_BE molar_volume;);

	R IS_A molar_gas_constant;

	eq: P*V = R*T;

METHODS
    METHOD default_self;
		RUN ClearAll;
		RUN specify;
		RUN values;
    END default_self;
    METHOD specify;
		P.fixed := TRUE;
		T.fixed := TRUE;
		V.fixed := FALSE;
    END specify;
    METHOD values;
		P := 1.0 {atm};
		T := 298.0 {K};
    END values;

END idealgas;

MODEL testidealgas;

	ig IS_A idealgas(P,T,V);
	P IS_A pressure;
	T IS_A temperature;
	V IS_A molar_volume;
		
METHODS
    METHOD default_self;
		RUN ClearAll;
		RUN specify;
		RUN values;
    END default_self;
    METHOD specify;
		P.fixed := TRUE;
		T.fixed := TRUE;
		V.fixed := FALSE;
		RUN ig.specify;
    END specify;
    METHOD values;
		P := 1.0 {atm};
		T := 800.0 {K};
		RUN ig.values;
    END values;
END testidealgas;