Skip to content

Commit

Permalink
preparation for helium thermal conductivity model,
Browse files Browse the repository at this point in the history
related to issue thorade#5
  • Loading branch information
thorade committed Oct 10, 2014
1 parent 04f7cb4 commit b0ccde0
Show file tree
Hide file tree
Showing 15 changed files with 75 additions and 71 deletions.
2 changes: 2 additions & 0 deletions HelmholtzMedia/HelmholtzFluids/Butane/package.mo
Expand Up @@ -101,6 +101,8 @@ extends Interfaces.PartialHelmholtzMedium(

final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsButane(
thermalConductivityModel=ThermalConductivityModel.TC1,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK3,
reducingTemperature_0=425.16,
reducingThermalConductivity_0=1,
lambda_0_num_coeffs=[
Expand Down
11 changes: 5 additions & 6 deletions HelmholtzMedia/HelmholtzFluids/Ethanol/package.mo
Expand Up @@ -95,9 +95,10 @@ extends Interfaces.PartialHelmholtzMedium(
0.972795913095E-3, 23.0, 7, 4],
residualGauss=fill(0.0, 0, 9)) "Coefficients of the Helmholtz EoS";

final constant
Transport.ThermalConductivityCoefficients
final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsEthanol(
thermalConductivityModel=ThermalConductivityModel.TC1,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK3,
reducingTemperature_0=513.9,
reducingThermalConductivity_0=1,
lambda_0_num_coeffs=[
Expand Down Expand Up @@ -168,14 +169,12 @@ extends Interfaces.PartialHelmholtzMedium(
-1., 0.0, 1, 0, 0])
"Coefficients for the dynamic viscosity";

final constant
Transport.SurfaceTensionCoefficients
final constant Transport.SurfaceTensionCoefficients
surfaceTensionCoefficientsEthanol(
coeffs=[
0.065, 1.26]) "Coefficients for the surface tension";

final constant
Ancillary.AncillaryCoefficients
final constant Ancillary.AncillaryCoefficients
ancillaryCoefficientsEthanol(
pressureSaturationModel=PressureSaturationModel.PS5,
pressureSaturation=[
Expand Down
2 changes: 2 additions & 0 deletions HelmholtzMedia/HelmholtzFluids/Helium/package.mo
Expand Up @@ -96,6 +96,8 @@ extends Interfaces.PartialHelmholtzMedium(

final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsHelium(
thermalConductivityModel=ThermalConductivityModel.TC0,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK0,
reducingTemperature_0=10,
reducingThermalConductivity_0=1,
lambda_0_num_coeffs=fill(0.0, 0, 2),
Expand Down
14 changes: 6 additions & 8 deletions HelmholtzMedia/HelmholtzFluids/Hexamethyldisiloxane/package.mo
Expand Up @@ -83,9 +83,10 @@ extends Interfaces.PartialHelmholtzMedium(
0.25902341E-1, 12.0, 4, 3],
residualGauss=fill(0.0, 0, 9)) "Coefficients of the Helmholtz EoS";

final constant
Transport.ThermalConductivityCoefficients
final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsMM(
thermalConductivityModel=ThermalConductivityModel.TC1,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK3,
reducingTemperature_0=1,
reducingThermalConductivity_0=1,
lambda_0_num_coeffs=fill(0.0, 0, 2),
Expand All @@ -98,8 +99,7 @@ extends Interfaces.PartialHelmholtzMedium(
qd_inverse=0.875350E-9,
T_ref=637.68) "Coefficients for the thermal conductivity";

final constant
Transport.DynamicViscosityCoefficients
final constant Transport.DynamicViscosityCoefficients
dynamicViscosityCoefficientsMM(
dynamicViscosityModel=DynamicViscosityModel.VS1,
collisionIntegralModel=CollisionIntegralModel.CI1,
Expand All @@ -116,13 +116,11 @@ extends Interfaces.PartialHelmholtzMedium(
nu_po=fill(0.0, 0, 5),
de_po=fill(0.0, 0, 5)) "Coefficients for the dynamic viscosity";

final constant
Transport.SurfaceTensionCoefficients
final constant Transport.SurfaceTensionCoefficients
surfaceTensionCoefficientsMM(
coeffs=fill(0.0, 0, 2)) "Coefficients for the surface tension";

final constant
Ancillary.AncillaryCoefficients
final constant Ancillary.AncillaryCoefficients
ancillaryCoefficientsMM(
pressureSaturationModel=PressureSaturationModel.PS5,
pressureSaturation=[
Expand Down
14 changes: 6 additions & 8 deletions HelmholtzMedia/HelmholtzFluids/Isobutane/package.mo
Expand Up @@ -98,9 +98,10 @@ package Isobutane "Isobutane"
-0.53001044558079E-02, 0.0, 2., 2, 2, -10., -200., 1.13, 1.0])
"Coefficients of the Helmholtz EoS";

final constant
Transport.ThermalConductivityCoefficients
final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsIsobutane(
thermalConductivityModel=ThermalConductivityModel.TC1,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK3,
reducingTemperature_0 = 407.85,
reducingThermalConductivity_0 = 1,
lambda_0_num_coeffs=[
Expand All @@ -126,8 +127,7 @@ package Isobutane "Isobutane"
qd_inverse=0.657661E-9,
T_ref=611.73) "Coefficients for the thermal conductivity";

final constant
Transport.DynamicViscosityCoefficients
final constant Transport.DynamicViscosityCoefficients
dynamicViscosityCoefficientsIsobutane(
dynamicViscosityModel=DynamicViscosityModel.VS1,
collisionIntegralModel=CollisionIntegralModel.CI1,
Expand Down Expand Up @@ -176,15 +176,13 @@ package Isobutane "Isobutane"
-1., 0.0, 1.00, 0.00, 0])
"Coefficients for the dynamic viscosity";

final constant
Transport.SurfaceTensionCoefficients
final constant Transport.SurfaceTensionCoefficients
surfaceTensionCoefficientsIsobutane(
coeffs=[
0.05756, 1.290;
-0.009554, 2.290]) "Coefficients for the surface tension";

final constant
Ancillary.AncillaryCoefficients
final constant Ancillary.AncillaryCoefficients
ancillaryCoefficientsIsobutane(
pressureSaturationModel=PressureSaturationModel.PS5,
pressureSaturation=[
Expand Down
14 changes: 6 additions & 8 deletions HelmholtzMedia/HelmholtzFluids/Isopentane/package.mo
Expand Up @@ -84,9 +84,10 @@ package Isopentane "Isopentane"
0.018156, 12.0, 4.0, 3],
residualGauss=fill(0.0, 0, 9)) "Coefficients of the Helmholtz EoS";

final constant
Transport.ThermalConductivityCoefficients
final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsIsopentane(
thermalConductivityModel=ThermalConductivityModel.TC1,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK3,
reducingTemperature_0 = 341.06,
reducingThermalConductivity_0 = 1e-3,
lambda_0_num_coeffs=[
Expand All @@ -108,8 +109,7 @@ package Isopentane "Isopentane"
qd_inverse=0.9316E-9,
T_ref=690.525) "Coefficients for the thermal conductivity";

final constant
Transport.DynamicViscosityCoefficients
final constant Transport.DynamicViscosityCoefficients
dynamicViscosityCoefficientsIsopentane(
dynamicViscosityModel=DynamicViscosityModel.VS2,
collisionIntegralModel=CollisionIntegralModel.CI0,
Expand All @@ -132,14 +132,12 @@ package Isopentane "Isopentane"
-20914.7951660000;
3.24]) "Coefficients for the dynamic viscosity";

final constant
Transport.SurfaceTensionCoefficients
final constant Transport.SurfaceTensionCoefficients
surfaceTensionCoefficientsIsopentane(
coeffs=[
0.05106, 1.21]) "Coefficients for the surface tension";

final constant
Ancillary.AncillaryCoefficients
final constant Ancillary.AncillaryCoefficients
ancillaryCoefficientsIsopentane(
pressureSaturationModel=PressureSaturationModel.PS5,
pressureSaturation=[
Expand Down
14 changes: 6 additions & 8 deletions HelmholtzMedia/HelmholtzFluids/Pentane/package.mo
Expand Up @@ -85,9 +85,10 @@ package Pentane "Pentane"
0.016877016, 12.0, 4.0, 3],
residualGauss=fill(0.0, 0, 9)) "Coefficients of the Helmholtz EoS";

final constant
Transport.ThermalConductivityCoefficients
final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsPentane(
thermalConductivityModel=ThermalConductivityModel.TC1,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK3,
reducingTemperature_0 = 341.1,
reducingThermalConductivity_0 = 1e-3,
lambda_0_num_coeffs=[
Expand All @@ -109,8 +110,7 @@ package Pentane "Pentane"
qd_inverse=0.9345E-9,
T_ref=704.55) "Coefficients for the thermal conductivity";

final constant
Transport.DynamicViscosityCoefficients
final constant Transport.DynamicViscosityCoefficients
dynamicViscosityCoefficientsPentane(
dynamicViscosityModel=DynamicViscosityModel.VS2,
collisionIntegralModel=CollisionIntegralModel.CI0,
Expand All @@ -133,16 +133,14 @@ package Pentane "Pentane"
21435.7720323;
3.215]) "Coefficients for the dynamic viscosity";

final constant
Transport.SurfaceTensionCoefficients
final constant Transport.SurfaceTensionCoefficients
surfaceTensionCoefficientsPentane(
coeffs=[
0.0562267, 1.25;
-0.0037496, 2.25;
-0.0029861, 3.25]) "Coefficients for the surface tension";

final constant
Ancillary.AncillaryCoefficients
final constant Ancillary.AncillaryCoefficients
ancillaryCoefficientsPentane(
pressureSaturationModel=PressureSaturationModel.PS5,
pressureSaturation=[
Expand Down
14 changes: 6 additions & 8 deletions HelmholtzMedia/HelmholtzFluids/Propane/package.mo
Expand Up @@ -91,9 +91,10 @@ extends Interfaces.PartialHelmholtzMedium(
-0.17486824E-01, 6.75, 1., 2., 2., -14.6, -547.8, 1.093, 0.948])
"Coefficients of the Helmholtz EoS";

final constant
Transport.ThermalConductivityCoefficients
final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsPropane(
thermalConductivityModel=ThermalConductivityModel.TC1,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK3,
reducingTemperature_0=369.85,
reducingThermalConductivity_0=1,
lambda_0_num_coeffs=[
Expand All @@ -119,8 +120,7 @@ extends Interfaces.PartialHelmholtzMedium(
qd_inverse=0.875350E-9,
T_ref=637.68) "Coefficients for the thermal conductivity";

final constant
Transport.DynamicViscosityCoefficients
final constant Transport.DynamicViscosityCoefficients
dynamicViscosityCoefficientsPropane(
dynamicViscosityModel=DynamicViscosityModel.VS1,
collisionIntegralModel=CollisionIntegralModel.CI1,
Expand Down Expand Up @@ -169,15 +169,13 @@ extends Interfaces.PartialHelmholtzMedium(
-1., 0.0, 1, 0, 0])
"Coefficients for the dynamic viscosity";

final constant
Transport.SurfaceTensionCoefficients
final constant Transport.SurfaceTensionCoefficients
surfaceTensionCoefficientsPropane(
coeffs=[
0.05666, 1.265;
-0.005291, 2.265]) "Coefficients for the surface tension";

final constant
Ancillary.AncillaryCoefficients
final constant Ancillary.AncillaryCoefficients
ancillaryCoefficientsPropane(
pressureSaturationModel=PressureSaturationModel.PS5,
pressureSaturation=[
Expand Down
14 changes: 6 additions & 8 deletions HelmholtzMedia/HelmholtzFluids/R134a/package.mo
Expand Up @@ -91,9 +91,10 @@ package R134a "R134a with IIR reference state"
-0.1285458000E-03, 50.00, 10.00, 4],
residualGauss=fill(0.0, 0, 9)) "Coefficients of the Helmholtz EoS";

final constant
Transport.ThermalConductivityCoefficients
final constant Transport.ThermalConductivityCoefficients
thermalConductivityCoefficientsR134a(
thermalConductivityModel=ThermalConductivityModel.TC1,
thermalConductivityCriticalEnhancementModel=ThermalConductivityCriticalEnhancementModel.TK3,
reducingTemperature_0=1.0,
reducingThermalConductivity_0=1.0,
lambda_0_num_coeffs=[
Expand All @@ -112,8 +113,7 @@ package R134a "R134a with IIR reference state"
qd_inverse=5.285356E-10,
T_ref=561.411) "Coefficients for the thermal conductivity";

final constant
Transport.DynamicViscosityCoefficients
final constant Transport.DynamicViscosityCoefficients
dynamicViscosityCoefficientsR134a(
dynamicViscosityModel=DynamicViscosityModel.VS1_alternative,
collisionIntegralModel=CollisionIntegralModel.CI1,
Expand Down Expand Up @@ -157,14 +157,12 @@ package R134a "R134a with IIR reference state"
-1.00, 0.00, 1.00, 0.00, 0])
"Coefficients for the dynamic viscosity";

final constant
Transport.SurfaceTensionCoefficients
final constant Transport.SurfaceTensionCoefficients
surfaceTensionCoefficientsR134a(
coeffs=[
0.06016, 1.26]) "Coefficients for the surface tension";

final constant
Ancillary.AncillaryCoefficients
final constant Ancillary.AncillaryCoefficients
ancillaryCoefficientsR134a(
pressureSaturationModel=PressureSaturationModel.PS5,
pressureSaturation=[
Expand Down
2 changes: 1 addition & 1 deletion HelmholtzMedia/Interfaces/Choices/DynamicViscosityModel.mo
Expand Up @@ -4,4 +4,4 @@ type DynamicViscosityModel = enumeration(
VS1 "VS1 model",
VS1_alternative "VS1 with alternative first term",
VS2 "VS2 model",
VS4 "VS4 model (Quinones-Cisneros and Deiters)");
VS4 "VS4 model");
@@ -0,0 +1,7 @@
within HelmholtzMedia.Interfaces.Choices;
type ThermalConductivityCriticalEnhancementModel = enumeration(
TK0 "TK0 model (hardcoded/none)",
TK2 "TK2 model",
TK3 "TK3 model",
TK4 "TK4 model",
TK6 "TK6 model");
3 changes: 2 additions & 1 deletion HelmholtzMedia/Interfaces/Choices/package.order
@@ -1,6 +1,7 @@
ReferenceState
DynamicViscosityModel
ThermalConductivityModel
ThermalConductivityCriticalEnhancementModel
DynamicViscosityModel
CollisionIntegralModel
PressureSaturationModel
DensityLiquidModel
Expand Down
@@ -1,30 +1,25 @@
within HelmholtzMedia.Interfaces.PartialHelmholtzMedium.Transport;
record DynamicViscosityCoefficients
import HelmholtzMedia;

constant DynamicViscosityModel dynamicViscosityModel;
constant CollisionIntegralModel collisionIntegralModel;

// collision integral S_mathfrak
constant Temperature epsilon_kappa "Lennard-Jones energy parameter";
constant Temperature epsilon_kappa(min=0) "Lennard-Jones energy parameter";
constant Real sigma "Lennard-Jones size parameter";
constant Real[:,2] a = fill(0.0, 0, 2) "coefficients for collision integral";

// zero density dependence, via Chapman-Enskog-Theory
constant Real[:,2] CET = fill(0.0, 0, 2);
constant Temperature reducingTemperature_0=1 "reducing temperature";
constant Temperature reducingTemperature_0(min=1)=1 "reducing temperature";
constant Real reducingViscosity_0=1 "reducing viscosity";

// initial density dependence, via Rainwater-Friend-Theory
constant Temperature reducingTemperature_1=1 "reducing temperature";
constant Temperature reducingTemperature_1(min=1)=1 "reducing temperature";
constant Real reducingViscosity_1=1 "reducing viscosity";
constant Real[:,2] b = fill(0.0, 0, 2)
"coefficients for second viscosity virial coefficent B";

// residual / high density viscosity contribution
constant Real[:,1] c = fill(0.0, 0, 1)
"coefficients for residual viscosity contribution in VS2 model";
constant Temperature reducingTemperature_residual=1 "reducing temperature";
constant Temperature reducingTemperature_residual(min=1)=1
"reducing temperature";
constant MolarVolume reducingMolarVolume_residual=1 "reducing molar volume";
constant Real reducingViscosity_residual=1 "reducing viscosity";
constant Real[:,2] g = fill(0.0, 0, 2) "close-packed density delta_0";
Expand Down
@@ -1,5 +1,7 @@
within HelmholtzMedia.Interfaces.PartialHelmholtzMedium.Transport;
record ThermalConductivityCoefficients
constant ThermalConductivityModel thermalConductivityModel;
constant ThermalConductivityCriticalEnhancementModel thermalConductivityCriticalEnhancementModel;
// dilute gas / zero density terms
constant Temperature reducingTemperature_0=1 "reducing temperature";
constant Real reducingThermalConductivity_0=1 "usually unity";
Expand All @@ -9,7 +11,8 @@ record ThermalConductivityCoefficients
"coeffs for dilute contribution denominator";

// residual / background terms
constant Temperature reducingTemperature_residual=1 "reducing temperature";
constant Temperature reducingTemperature_residual(min=1)=1
"reducing temperature";
constant MolarVolume reducingMolarVolume_residual "reducing molar volume";
constant Real reducingThermalConductivity_residual=1 "usually unity";
constant Real[:,4] lambda_r_coeffs = fill(0.0, 0, 4)
Expand All @@ -25,5 +28,5 @@ record ThermalConductivityCoefficients
constant Real xi_0 "amplitude";
constant Real Gamma_0 "amplitude";
constant Real qd_inverse "modified effective cutoff parameter";
constant Temperature T_ref "reference temperature";
constant Temperature T_ref(min=1,max=3e3) "reference temperature";
end ThermalConductivityCoefficients;
Expand Up @@ -3,12 +3,19 @@ function thermalConductivity "Return thermal conductivity"
input ThermodynamicState state;
output ThermalConductivity lambda;

protected
ThermalConductivityModel thermalConductivityModel=thermalConductivityCoefficients.thermalConductivityModel;

algorithm
assert(state.phase <> 2, "thermalConductivity warning: property not defined in two-phase region", level=AssertionLevel.warning);

lambda := ( Transport.thermalConductivity_dilute(state)
+ Transport.thermalConductivity_residual(state)
+ Transport.thermalConductivity_critical(state));
if (thermalConductivityModel == ThermalConductivityModel.TC0) then
// hardcoded models return full thermal conductivity in one equation
lambda := thermalConductivity_residual(state);
else
// composite models
lambda := thermalConductivity_dilute(state) + thermalConductivity_residual(state) + thermalConductivity_critical(state);
end if;

annotation (Documentation(info="<html>
<p>
Expand Down

0 comments on commit b0ccde0

Please sign in to comment.