diff --git a/HelmholtzMedia/HelmholtzFluids/Butane/package.mo b/HelmholtzMedia/HelmholtzFluids/Butane/package.mo index 2df9f81..1b63032 100644 --- a/HelmholtzMedia/HelmholtzFluids/Butane/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/Butane/package.mo @@ -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=[ diff --git a/HelmholtzMedia/HelmholtzFluids/Ethanol/package.mo b/HelmholtzMedia/HelmholtzFluids/Ethanol/package.mo index 6daa96d..53a4cad 100644 --- a/HelmholtzMedia/HelmholtzFluids/Ethanol/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/Ethanol/package.mo @@ -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=[ @@ -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=[ diff --git a/HelmholtzMedia/HelmholtzFluids/Helium/package.mo b/HelmholtzMedia/HelmholtzFluids/Helium/package.mo index 5c575a4..a99dd26 100644 --- a/HelmholtzMedia/HelmholtzFluids/Helium/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/Helium/package.mo @@ -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), diff --git a/HelmholtzMedia/HelmholtzFluids/Hexamethyldisiloxane/package.mo b/HelmholtzMedia/HelmholtzFluids/Hexamethyldisiloxane/package.mo index 1a7875e..fc4099f 100644 --- a/HelmholtzMedia/HelmholtzFluids/Hexamethyldisiloxane/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/Hexamethyldisiloxane/package.mo @@ -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), @@ -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, @@ -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=[ diff --git a/HelmholtzMedia/HelmholtzFluids/Isobutane/package.mo b/HelmholtzMedia/HelmholtzFluids/Isobutane/package.mo index dea5cc3..a9d8b1b 100644 --- a/HelmholtzMedia/HelmholtzFluids/Isobutane/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/Isobutane/package.mo @@ -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=[ @@ -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, @@ -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=[ diff --git a/HelmholtzMedia/HelmholtzFluids/Isopentane/package.mo b/HelmholtzMedia/HelmholtzFluids/Isopentane/package.mo index b6db396..6b1ff46 100644 --- a/HelmholtzMedia/HelmholtzFluids/Isopentane/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/Isopentane/package.mo @@ -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=[ @@ -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, @@ -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=[ diff --git a/HelmholtzMedia/HelmholtzFluids/Pentane/package.mo b/HelmholtzMedia/HelmholtzFluids/Pentane/package.mo index cdd7c7a..6a94145 100644 --- a/HelmholtzMedia/HelmholtzFluids/Pentane/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/Pentane/package.mo @@ -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=[ @@ -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, @@ -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=[ diff --git a/HelmholtzMedia/HelmholtzFluids/Propane/package.mo b/HelmholtzMedia/HelmholtzFluids/Propane/package.mo index e5cb31e..060b04b 100644 --- a/HelmholtzMedia/HelmholtzFluids/Propane/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/Propane/package.mo @@ -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=[ @@ -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, @@ -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=[ diff --git a/HelmholtzMedia/HelmholtzFluids/R134a/package.mo b/HelmholtzMedia/HelmholtzFluids/R134a/package.mo index 763dc6c..d5eca29 100644 --- a/HelmholtzMedia/HelmholtzFluids/R134a/package.mo +++ b/HelmholtzMedia/HelmholtzFluids/R134a/package.mo @@ -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=[ @@ -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, @@ -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=[ diff --git a/HelmholtzMedia/Interfaces/Choices/DynamicViscosityModel.mo b/HelmholtzMedia/Interfaces/Choices/DynamicViscosityModel.mo index 931b3e5..d228aec 100644 --- a/HelmholtzMedia/Interfaces/Choices/DynamicViscosityModel.mo +++ b/HelmholtzMedia/Interfaces/Choices/DynamicViscosityModel.mo @@ -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"); diff --git a/HelmholtzMedia/Interfaces/Choices/ThermalConductivityCriticalEnhancementModel.mo b/HelmholtzMedia/Interfaces/Choices/ThermalConductivityCriticalEnhancementModel.mo new file mode 100644 index 0000000..812ad69 --- /dev/null +++ b/HelmholtzMedia/Interfaces/Choices/ThermalConductivityCriticalEnhancementModel.mo @@ -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"); diff --git a/HelmholtzMedia/Interfaces/Choices/package.order b/HelmholtzMedia/Interfaces/Choices/package.order index e188c63..576f6bb 100644 --- a/HelmholtzMedia/Interfaces/Choices/package.order +++ b/HelmholtzMedia/Interfaces/Choices/package.order @@ -1,6 +1,7 @@ ReferenceState -DynamicViscosityModel ThermalConductivityModel +ThermalConductivityCriticalEnhancementModel +DynamicViscosityModel CollisionIntegralModel PressureSaturationModel DensityLiquidModel diff --git a/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/DynamicViscosityCoefficients.mo b/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/DynamicViscosityCoefficients.mo index 1964c32..2a6b278 100644 --- a/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/DynamicViscosityCoefficients.mo +++ b/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/DynamicViscosityCoefficients.mo @@ -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"; diff --git a/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/ThermalConductivityCoefficients.mo b/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/ThermalConductivityCoefficients.mo index 742a8c4..cdac13c 100644 --- a/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/ThermalConductivityCoefficients.mo +++ b/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/ThermalConductivityCoefficients.mo @@ -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"; @@ -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) @@ -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; diff --git a/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/thermalConductivity.mo b/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/thermalConductivity.mo index a181598..a469da4 100644 --- a/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/thermalConductivity.mo +++ b/HelmholtzMedia/Interfaces/PartialHelmholtzMedium/Transport/thermalConductivity.mo @@ -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="