![]() ![]() In : import CoolProp.CoolProp as CP # Get the JSON structure for Water In : jj = CP. In addition, for consistency with the low-level interface, the valid phase strings in the table above may be prefixed with either “ phase_” or “ iphase_” and still be recognized as a valid phase string. If the phase string is applied to more than one of the Input key parameters If the phase string is not one of the valid phase strings in the table above If anything other than the pipe, “|”, symbol is used as the delimiter PropsSI() will return an error for any of the following syntax conditions: ![]() A phase string must be appended to an Input key string on each and every call to PropsSI() to impose the phase. On each call to PropsSI(), the imposed phase is reset to “not_imposed” as long as no imposed phase strings are used. To specify the phase to be used, add the “|” delimiter to one (and only one) of the input key strings followed by one of the phase strings in the table below: Additionally, with an input pair in the two-phase region, it can be useful to impose a liquid or gas phase to instruct PropsSI() to return the saturated liquid or saturated gas properties. However, some state points may not be able to find a suitable initial guess for the solver and being able to impose the phase manually may offer a solution if the solver is failing. ![]() If unspecified, PropsSI will attempt to determine the phase automatically.ĭepending on the input pair, there may or may not be a speed benefit to imposing a phase. For computational efficiency, PropsSI() allows the phase to be manually imposed through the input key parameters. Imposing the Phase (Optional) ¶Įach call to PropsSI() requires the phase to be determined based on the provided input pair, and may require a non-trivial flash calculation to determine if the state point is in the single-phase or two-phase region and to generate a sensible initial guess for the solver. The latent heat of vaporization can be calculated using the difference between the vapor and liquid enthalpies at the same point on the saturation curve. For example, at a saturation pressure of 1 atm, the liquid and vapor enthalpies can be returned as follows. Use a value of \(Q=1\) for the saturated vapor property or \(Q=0\) for the saturated liquid property. To retrieve either the vapor or liquid properties along the saturation curve, provide an input pair that includes either the saturation temperature, \(T\), or saturation pressure, \(p\), along with the vapor quality, \(Q\). ![]() If the state point defined by the input pair lies within 1E-4 % of the saturation pressure, then CoolProp may return an error, because both liquid and vapor are defined along the saturation curve. Likewise, if the state point lies in the liquid region, then the liquid state property at that state point will be returned. If the input pair (say, \(P,T\)) defines a state point that lies in the vapor region, then the vapor property at that state point will be returned. If speed is an issue, you can look into table-based interpolation methods using TTSE or bicubic interpolation or if you are only interested in Water properties, you can look into using the IF97 (industrial formulation) backend. \(P,T\) will be a bit slower (3-10 times), followed by input pairs where neither \(T\) nor \(\rho\) are specified, like \(P,H\) these will be much slower. The equations of state are based on \(T\) and \(\rho\) as state variables, so \(T, \rho\) will always be the fastest inputs. The sixth and last parameter is the fluid for which the output property will be calculated also a quoted string.ĭocumentation for all high-level functions exposedĪll the wrappers wrap this function in exactly the same way.įor pure and pseudo-pure fluids, two state variables are required to fix the state. The third and fifth parameters are the values of the input pair properties and will determine the state point. The output property and input pair properties are text strings and must be quoted. The second and fourth parameters are the specified input pair of properties that determine the state point where the output property will be calculated. In this example, the first parameter, \(T\), is the output property that will be returned from PropsSI. # Import the PropsSI function In : from CoolProp.CoolProp import PropsSI # Saturation temperature of Water at 1 atm in K In : PropsSI ( 'T', 'P', 101325, 'Q', 0, 'Water' ) Out: 373.1242958476844 ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |