Coder Social home page Coder Social logo

Comments (3)

sjoelund avatar sjoelund commented on July 25, 2024

I don't know why it's complaining about ExternalMediaLib.dll, since I'm using libExternalMediaLib.a

Static libraries .a can only be used when it's been linked into the model. If a value is needed during compile-time, a dynamic library .dll is required.

from externalmedia.

ferrucci-franco avatar ferrucci-franco commented on July 25, 2024

Hi again,

I found a workaround for the error: I filled the externalFluidConstants record by hand (so the code does not call woPhaseMedium_getCriticalPressure_C_impl and TwoPhaseMedium_getMolarMass_C_impl C functions, which apparently OM cannot find).

The media definition is now:

package NH3CoolProp "CoolProp model of NH3"
extends ExternalMedia.Media.CoolPropMedium(
mediumName = "Ammonia",
substanceNames = {"NH3"},
inputChoice=ExternalMedia.Common.InputChoice.pT,
externalFluidConstants=FluidConstants(
iupacName="Ammonia",
casRegistryNumber="7664-41-7",
chemicalFormula="H_{3}N_{1}",
structureFormula="unknown",
molarMass=0.01703026,
criticalTemperature=4.054e+02,
criticalPressure=11333000,
criticalMolarVolume=7.569004444444444e-05,
acentricFactor=0.253,
triplePointTemperature=1.95495e+02,
triplePointPressure=6.091223108131509e+03,
meltingPoint=195.4200,
normalBoilingPoint=2.398235545665792e+02,
dipoleMoment=1.42));
end NH3CoolProp;

NOTE: I removed the line:
ThermoStates = Modelica.Media.Interfaces.Choices.IndependentVariables.pT
since I couldn't see its use (Could someone confirm this???. Instead, I added the the following line:
inputChoice=ExternalMedia.Common.InputChoice.pT
which actually changed the state selection. I know this beacuse, if I changed to
inputChoice=ExternalMedia.Common.InputChoice.ph
then, the initialization process needed to solve a non-linear system of equations.

from externalmedia.

casella avatar casella commented on July 25, 2024

@ferrucci-franco your Test1 model compiles correctly with the new 3.3.2 version. It then fails at runtime with

ExternalMedia error: unable to solve 1phase PY flash with Tmin=195.494, Tmax=239.585 due to error: HSU_P_flash_singlephase_Brent could not find a solution because Hmolar [0 J/mol] is below the minimum value of 1.94632523329 J/mol

but I guess that's another story.

We'll release 3.3.2 anytime soon, in the meantime you can get it from the latest binaries here.

from externalmedia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.