ibell / pdsim

Steady-State simulation code for positive displacement machines
MIT License
38 stars 23 forks source link

ValueError for certain cases of PDSim #75

Open caskandavor opened 1 year ago

caskandavor commented 1 year ago

Hi all,

I have been using PDSim to better understand scroll compressors, but something has been bugging me for a while. For some cases (typically for high discharge pressures, around 15 bar), there is a ValueError (options.p is not valid in saturation_T_pure_1D_P). As seen in the screenshot below, this seems to come from CoolProp, as we try to get a pressure from a non valid temperature (here $T = -303.394 K$).

Note that this happens at the very beginning of the run (not even the first computing iteration is completed).

Changing the radial and flank gaps can help sometimes. Since these control the mass flows in and out of the control volumes and are therefore present in the conservation equations (mass and energy), I figured that perhaps they are not well handled in some cases.

There are also cases where the error is p is not a valid number.

Have you encountered such cases as well ?

Thank you!

image

ibell commented 1 year ago

Can you share an example where this failure happens?

caskandavor commented 1 year ago

Do you mean all the parameters that I used? If yes, here is an example which generates an error: (Note all solver parameters are lest as default).

Geometry

Scroll wrap inputs

Displacement $[m^3/rev]: 0.00007643$ Volume ratio $[-]: 2.67$ Thickness of the scroll wrap $[m]$: 0.0045 Orbiting radius $[m]$: 0.002387 $\phi{i0}$ $[rad]: 2$ $\phi{is}$ $[rad]: 6.5$ $\phi_{os}$ $[rad]: 4.3$ Flank gap width $[m]: 10e-6$ Radial gap width $[m]: 10e-6$

Discharge region inputs

2 Arcs with Perfect Matching Profile Discharge port diameter $[m]: 0.015$

Tube inputs

Inlet tube length $[m]: 0.0$ Inlet tube inner diameter $[m]: 0.02$ Outlet tube length $[m]: 0.0$ Outlet tube inner diameter $[m]: 0.02$

States

Rotational speed

Rotational speed $[rad/s]: 209$

Inlet State

Fluid: Air Temperature $[K]: 293.15$ Pressure $[kPa]: 101.325$

Discharge State

Discharge pressure $[kPa: 1601.325]$

Flow model parameters

Left as default (All $X_d=0.8$)

Mechanical

Motor Model

Motor efficiency $[-]: 0.95$

Heat transfer inputs

Shell-ambient mean HTC $[kW/m^2/K]: 1.0$ Shell outer area $[m^2]: 0.0405$ Ambient temperature $[K]: 333.15 K$ HTC in the scrolls $[kW/m^2/K]: 0.2$ Fraction of motor losses: $0$

Orbiting Scroll Inputs

Left as default

Mechanical loss Models

Specified mechancial efficiency $[-]: 0.9$

ibell commented 1 year ago

Nope, I mean the script that was generated; you should see the path in the GUI in the output window. It is somewhere like ${HOME}/.pdsim_temp where ${HOME} is your home folder for your user.

caskandavor commented 1 year ago

Oh right here it is: script_0aa221a06241.txt

It also depends on the rotational speed of the compressor. For the same case, different rotational speeds can generate errors or not.

caskandavor commented 1 year ago

@ibell was this the generated script you were refering to ?

Also, as I clarification, what I meant by the following quote is not that there is a problem with CoolProp, but rather that perhaps PDSim has an issue in solving the ODEs and yields a wrong and non physical result (for instance a negative temperature in K), which in turn gets rejected by CoolProp (rightfully so !)

As seen in the screenshot below, this seems to come from CoolProp, as we try to get a pressure from a non valid temperature (Here $T=-303.394 [K]$)

ibell commented 1 year ago

How old is the GUI you are using, it is generating Python 2.7 code. Everything is in python 3, and I can't even get your script to start running :/

caskandavor commented 1 year ago

@ibell I have generated this script with the 2.9 version of the GUI (downloaded a few months ago on the PDSim website). For my work, I use PDSim 2.14 but without the GUI.