From 707ee4799a11aeca59eabaf1b44ccab9d4e1680b Mon Sep 17 00:00:00 2001 From: Ian Bell Date: Thu, 4 Dec 2014 11:43:44 -0500 Subject: [PATCH] Brought back surface tension support Signed-off-by: Ian Bell --- src/AbstractState.cpp | 2 ++ .../Helmholtz/HelmholtzEOSMixtureBackend.cpp | 12 ++++++++++++ src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h | 3 ++- src/DataStructures.cpp | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/AbstractState.cpp b/src/AbstractState.cpp index 8e8064ef..01b4ae24 100644 --- a/src/AbstractState.cpp +++ b/src/AbstractState.cpp @@ -279,6 +279,8 @@ double AbstractState::keyed_output(int key) return viscosity(); case iconductivity: return conductivity(); + case isurface_tension: + return surface_tension(); case iPhase: return phase(); case iZ: diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp index 0774079d..2d42d1ba 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.cpp @@ -271,6 +271,9 @@ long double HelmholtzEOSMixtureBackend::calc_saturation_ancillary(parameters par return components[0]->ancillaries.rhoV.invert(value); } } + else if (param == isurface_tension && given == iT){ + return components[0]->ancillaries.surface_tension.evaluate(value); + } else{ throw ValueError(format("calc of %s given %s is invalid in calc_saturation_ancillary", get_parameter_information(param,"short").c_str(), @@ -296,6 +299,15 @@ long double HelmholtzEOSMixtureBackend::calc_melting_line(int param, int given, throw NotImplementedError(format("calc_melting_line not implemented for mixtures")); } } +long double HelmholtzEOSMixtureBackend::calc_surface_tension(void) +{ + if (is_pure_or_pseudopure){ + return components[0]->ancillaries.surface_tension.evaluate(T()); + } + else{ + throw NotImplementedError(format("surface tension not implemented for mixtures")); + } +} long double HelmholtzEOSMixtureBackend::calc_viscosity_dilute(void) { if (is_pure_or_pseudopure) diff --git a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h index c876821f..cabc28bc 100644 --- a/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h +++ b/src/Backends/Helmholtz/HelmholtzEOSMixtureBackend.h @@ -195,7 +195,7 @@ public: long double calc_d3alpha0_dDelta_dTau2(void); long double calc_d3alpha0_dTau3(void); - //long double calc_surface_tension(void); + long double calc_surface_tension(void); long double calc_viscosity(void); long double calc_viscosity_dilute(void); long double calc_viscosity_background(void); @@ -203,6 +203,7 @@ public: long double calc_conductivity(void); long double calc_conductivity_background(void); + long double calc_Tmin(void); long double calc_Tmax(void); long double calc_pmax(void); diff --git a/src/DataStructures.cpp b/src/DataStructures.cpp index 83c192cd..ed636e94 100644 --- a/src/DataStructures.cpp +++ b/src/DataStructures.cpp @@ -135,6 +135,7 @@ public: index_map.insert(std::pair("molemass", imolar_mass)); index_map.insert(std::pair("molarmass", imolar_mass)); index_map.insert(std::pair("A", ispeed_sound)); + index_map.insert(std::pair("I", isurface_tension)); std::map::iterator it; for(it = index_map.begin(); it != index_map.end(); ++it )