You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a Hydrogen model using ExternalMedia.Media.CoolPropMedium and I am using it as the medium in several components in my model.
I got the following error when I tried to simulate my model:
[1] 13:19:48 Translation Error
[ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium: 235:25-257:18]: External function ‘TwoPhaseMedium_setState_pT_C_impl_wrap‘ could not be found in any of the given shared libraries:
C:/Programs/bin/ExternalMediaLib.dll
C:/Users/AliAbedi/AppData/Roaming/.openmodelica/libraries/ExternalMedia 4.0.0/Resources/Library/mingw64/ExternalMediaLib.dll
C:\Users\AliAbedi\AppData\Roaming\.openmodelica\libraries\ExternalMedia 4.0.0\Resources\Library\win64\ExternalMediaLib.dll
C:/Users/AliAbedi/AppData/Roaming/.openmodelica/libraries/ExternalMedia 4.0.0/Resources/Library/ExternalMediaLib.dll
C:/Programs/bin/libExternalMediaLib.dll
C:/Users/AliAbedi/AppData/Roaming/.openmodelica/libraries/ExternalMedia 4.0.0/Resources/Library/mingw64/libExternalMediaLib.dll
C:/Users/AliAbedi/AppData/Roaming/.openmodelica/libraries/ExternalMedia 4.0.0/Resources/Library/win64/libExternalMediaLib.dll
C:/Users/AliAbedi/AppData/Roaming/.openmodelica/libraries/ExternalMedia 4.0.0/Resources/Library/libExternalMediaLib.dll
C:/Programs/bin/ffi/ExternalMediaLib.dll
C:/Programs/bin/ffi/libExternalMediaLib.dll
[2] 13:19:48 Translation Error
[ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium: 365:5-365:37]: [Failed to evaluate function: HRS_tst.volumeFlowRate.Medium.setState_pT.](omeditmessagesbrowser:///ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium?lineNumber=365)
As the error message indicates, the external function ExternalMedia.Media.CoolPropMedium could not be found in any of the dynamic libraries provided with ExternalMedia. I have validated this claim by manually looking for such function in the .dll files above. No such function exists while TwoPhaseMedium_setState_pT_C_impl and TwoPhaseMedium_setState_pT_C_impl_errdo exist.
I managed to temporarily solve the problem by changing the external function's name from TwoPhaseMedium_setState_pT_C_impl_wrap to TwoPhaseMedium_setState_pT_C_impl at line 243 of ExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium base class inside setState_pT function:
function setState_pT"Return thermodynamic state record from p and T"extends Modelica.Icons.Function;
input AbsolutePressure p "pressure";
input Temperature T "temperature";
input FixedPhase phase =0"2 for two-phase, 1 for one-phase, 0 if not known";
output ThermodynamicState state;
external "C" TwoPhaseMedium_setState_pT_C_impl(p, T, state, mediumName, libraryName, substanceName)
annotation(Library="ExternalMediaLib", IncludeDirectory="modelica://ExternalMedia/Resources/Include", LibraryDirectory="modelica://ExternalMedia/Resources/Library", Include=" #ifndef SETSTATE_PT_DEFINED #define SETSTATE_PT_DEFINED #include \"externalmedialib.h\" #include \"ModelicaUtilities.h\" void TwoPhaseMedium_setState_pT_C_impl_wrap(double p, double T, void *state, const char *mediumName, const char *libraryName, const char *substanceName) { TwoPhaseMedium_setState_pT_C_impl_err(p, T, state, mediumName, libraryName, substanceName, ModelicaError, ModelicaWarning); } #endif // SETSTATE_PT_DEFINED ");end setState_pT;
It is strange that this error only occurs when Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate component is present in the model. So, I suspect that some part of the problem may be related to this component.
The text was updated successfully, but these errors were encountered:
Hi there,
I have created a Hydrogen model using
ExternalMedia.Media.CoolPropMedium
and I am using it as the medium in several components in my model.I got the following error when I tried to simulate my model:
As the error message indicates, the external function
ExternalMedia.Media.CoolPropMedium
could not be found in any of the dynamic libraries provided with ExternalMedia. I have validated this claim by manually looking for such function in the.dll
files above. No such function exists whileTwoPhaseMedium_setState_pT_C_impl
andTwoPhaseMedium_setState_pT_C_impl_err
do exist.I managed to temporarily solve the problem by changing the external function's name from
TwoPhaseMedium_setState_pT_C_impl_wrap
toTwoPhaseMedium_setState_pT_C_impl
at line 243 ofExternalMedia.Media.BaseClasses.ExternalTwoPhaseMedium
base class insidesetState_pT
function:It is strange that this error only occurs when
Modelica.Fluid.Fittings.GenericResistances.VolumeFlowRate
component is present in the model. So, I suspect that some part of the problem may be related to this component.The text was updated successfully, but these errors were encountered: