EBSILON®Professional Online Documentation
EbsScript / EbsScript Interface Units / InterfaceUnit Fluid
In This Topic
    InterfaceUnit Fluid
    In This Topic

    InterfaceUnit-Fluid


    These functions are used to access substance compositions of fluids and to calculate substance values.

    In order to use these functions, the ‘Fluid’ interface unit must be integrated into an EbsScript in which the substance value functions themselves and the data types used in these functions are defined:

    uses @Fluid;

    The definitions can be viewed via the EbsScript Editor menu command ‘EbsScript’ -> ‘Open Interface Unit’ -> ‘Fluid’.  However, the implementation of these functions is not contained in this unit, but is realised internally in EBSILON®Professional..

     

    Note on the values of the PhaseEnum data type (defined in the @System interface unit), which is returned by the FuncPHASE_OF_PH substance value function:

    PHASE (P,H) : Determination of phase from pressure and enthalpy:  0: no phase calculated
                                                                                                                  1: for liquid phase (in the one-phase region,)
                                                                                                                  2: for gaseous phase (in the one-phase region)
                                                                                                                  3: in the two-phase region liquid/gaseous
                                                                                                                  4: for solid phase
                                                                                                                  5: in the two-phase region solid/liquid 
                                                                                                                  6: in the two-phase region solid/gaseous

    The FluidData data type used as a parameter in many function calls contains all the data required for the respective fluid, which can vary greatly depending on the fluid (fluidType).
    For more details, take a look at the definitions in the interface unit itself.

    type FluidData =
      record

       ncv : Real;                       //  net calorific value [kJ/kg]; on electric lines "ncv" is used for PHEL (Phase shift between voltage and current)

       fluidType:FluidTypeEnum;          //  composition-type

       fluidAnalysis : FluidAnalysisType;//  composition

       fluidPhaseLiq : FluidAnalysisType;//  fraction of liquid phases

       fugit:Real;                       //  fugitive portions (coal only)

       rho:Real;                         //  density

       zfac:Real;                        //  Z factor (oil only)

       coalType:CoalTypeEnum;            //  coal type (coal only)

       cpcorr:Real;                      //  ash cp correction factor

       realGasCorrection:RealGasCorrectionEnum;     //  real-gas-correction to be used

       medium:Integer;                   //  media type (2-phase fluid only)

       salt:Real;                        //  salt content (salt water only)

       fkal:Integer;                     //  media type of Kalina-fluid (1:Ammonia/Water; 2:Water/Lithium Bromide)

       xi:Real;                          //  mass fraction of refrigerant medium

       NCVCalculationMethod:NCVCalculationMethodEnum; // net calorific value calculation method

       NCVReferenceTemperature:Real;                  // 

       NCVCalculationMethodElementary:NCVCalculationMethodElementaryEnum; // net calorific value calculation method

       fluidExtension:smartptr FluidExtension;         // may contain additional data

       universalFluid:smartptr UniversalFluidType;     // may contain UniversalFluid

       nasaFluid:smartptr NASAFluidType;               // may contain NASA-Fluid

       waterSteamFormulation:SteamTableEnum;           // steam-table use
       gasFormulation:GasTableEnum;                    // gas-table used
       electric_phases:Integer;                        // number of phases (electric-lines only)

       electric_phase_shift:Real;                      // phases-shift (electric-lines only) in degrees

    end;

    Basic functions for accessing substance or fluid compositions and material data calls  

    Name

    Purpose

    Arguments

    Return value

    Example

    fluidGetAnalysis

    retrieves the material composition of an Ebsilon object (either a pipe or component 1 or 33)

    1: ebsData: Ebsilon object to be considered

    2: FluidData: the requested material composition

    3: CompositionDefined ByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error

    fluidGetAnalysis (BoundaryValue, fluidData, CompositionDefinedByVolume);
    rO2:=fluidData.fluidAnalysis [SubstanceO2];
    rCO2:=fluidData.fluidAnalysis [SubstanceCO2];

    fluidSetAnalysis

    modifies the material composition for an Ebsilon object (component 1 or 33)

     

     

    1: ebsData: Ebsilon object to be modified

    2: FluidData: the specified material composition

    3: CompositionDefined ByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: Error

    fluidSetAnalysis (BoundaryValue, fluidData, CompositionDefinedByVolume);

    fluidTranslateAnalysis

    transfer a material composition from one type of presentation to another

     

    1:FluidData:  the material composition under consideration

    2: CompositionDefined ByEnum:present type of specification

    3: CompositionDefined ByEnum: desired type of specification

    BOOLEAN:
    true: o.k.
    false: error

    fluidTranslateAnalysis (fluidData, CompositionDefinedByVolume, CompositionDefinedByMass );

    fluidTable

    calls a property table function for a specified fluid

     

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only be calculatedwith explicit call (PHASE (P, H))

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:FuncEnum: type of the function to be called

    6:FluidData: the considered material composition

    7: CompositionDefined ByEnum:  the requested way of specification of the composition (e.g. mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error

    uses @Fluid;
    var fluidData:fluidData;
    Phase:PhaseEnum;
    r1,r2,rResult:real;
    r1:=1.013;
    r2:=20.0;
    fluidGetAnalysis(Air, fluidData);
    fluidTable ( rResult, Phase, r1, r2, FuncH_OF_PT, fluidData, CompositionDefinedByVolume);

    fluidTable3

    calls a property table function for a specified fluid

     

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only be calculated with explicit call (PHASE (P, H))

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:REAL: 3nd argument for the material table function

    6:FuncEnum: type of the function to be called

    7:FluidData: the considered material composition

    8: CompositionDefined ByEnum:  the requested way of specification of the composition (e.g. mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error

    uses @Fluid;
    var fluidData:fluidData;
    Phase:PhaseEnum;
    r1,r2,r3,rResult:real;
    r1:=1.013;
    r2:=0.6;
    r3:=0.02;
    fluidGetAnalysis( HumidAir, fluidData); //Humid Air line
    fluidTable3 ( rResult, Phase, r1, r2, r3, FuncT_OF_PPHI, fluidData);

    fluidNormalize

    normalizes a material composition. In the NormalizeControl structure, you can define which parts of the composition shall fixed and which shall modified for the normalization.

    Note that this function modifies the FluidData structure only, not the Ebsilon object in the model.

    1: FluidData: the material composition under consideration

    2: CompositionDefined ByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    3:NormalizeControl: structure to specify the way of normalization

    BOOLEAN:
    true: o.k.
    false: error

    fluidGetAnalysis (BoundaryValue, fluidData, CompositionDefinedByVolume);
    fluidData.fluidAnalysis[SubstanceO2]:=0.04;
    control.action:=NormalizeFillUpSelected;
    control.selection[SubstanceCO2]:=true;
    fluidNormalize (fluidData, CompositionDefinedByVolume, control);
    fluidSetAnalyis (BoundaryValue, fluidData, CompositionDefinedByVolume);

    Two practical shortcuts for the sequence fluidGetAnalysis, fluidTable:

    fluidTableObject

    You can directly activate the physical properties for an object with this function. The function automatically recognizes which type of fluid it is and then activates the appropriate function. If a composition or further parameters are needed, these are adopted from the specified object.

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:FuncEnum: type of the function to be called

    6:ebsData: Object                  

    BOOLEAN:
    true: o.k.
    false: error

    uses @Fluid;

    var r:real;
    phase:PhaseEnum;
    begin
       fluidTableObject ( r, phase, 1, 500, FuncH_OF_PT, Fluegas_1 );
    println (r);

    end.

    fluidTable3Object

    You can directly activate the physical properties for an object with this function. The function automatically recognizes which type of fluid it is and then activates the appropriate function. If a composition or further parameters are needed, these are adopted from the specified object.

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:REAL: 3rd argument for the material table function

    6:FuncEnum: type of the function to be called

    7:ebsData: Object                  

    BOOLEAN:
    true: o.k.
    false: error

    uses @Fluid;
    var  r1,r2,r3,rResult:real;

    begin
    r1:=1.013;
    r2:=0.6;
    r3:=0.02
    fluidTable3Object ( rResult, Phase, r1, r2, r3, FuncT_OF_PPHI, HumidAir);
    end.

     

    Further Thermal Properties Functions for material data calls for specific line types

    These sets of functions have been implemented for calculating physical properties. For these, the (obsolete) parameter “Phase” is no longer required.

    In the first set, the calculated result is returned as a parameter, while the return code contains the information whether the calculation has been successful (true) or not (false).

    This first set consists of the following functions:

    fluidPropertyCall
    fluidPropertyCallAnalysis
    fluidPropertyCallFlueGas
    fluidPropertyCallWST and fluidPropertyCallWaterSteam
    fluidPropertyCallSalt
    fluidPropertyCallBinaryMixture
    fluidPropertyCallUser2Phase
    fluidPropertyCallThermoLiquid
    fluidPropertyCallThermoLiquidUser
    fluidPropertyCallHumidAir
    fluidProperty3Call (with three arguments)
    fluidProperty3CallAnalysis
    fluidProperty3CallFlueGas
    fluidProperty3CallHumidAi
    fluidProperty3CallThermoLiquidUser
    fluidProperty3CallUser2Phase
       

    The second set is to be used functionally, i.e. the calculated result is returned as return value. In an optional argument it is possible to specify which value is to be returned in the event of an error. The default error value is -999.

    This is useful e. g. in text fields to display a calculated value in the model directly.

    This second set consists of the following functions:

    fluidProperty
    fluidPropertyAnalysis
    fluidPropertyFlueGas
    fluidPropertyWST and fluidPropertyWaterSteam
    fluidPropertySalt
    fluidPropertyBinaryMixture
    fluidPropertyUser2Phase
    fluidPropertyThermoLiquid
    fluidPropertyThermoLiquidUser
    fluidPropertyHumidAir
    fluidProperty3 (with three arguments)
    fluidProperty3Analysis
    fluidProperty3FlueGas
    fluidProperty3HumidAir
    fluidProperty3ThermoLiquidUser
    fluidProperty3User2Phase
      

    The first function set

    Name

    Purpose

    Arguments

    Value returned

    Example

    fluidPropertyCall

    calls a property table function for a specified fluid

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:EBSDATA: object

    BOOLEAN:
    true: o.k.
    false: error

    r1:=1.013;
    r2:=20.0;
    fluidPropertyCall( rResult, r1, r2, FuncH_OF_PT, ebsData);

    fluidPropertyCallAnalysis

    calls a property table function for a specified fluid

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:FluidData: the specified material composition

    6:CompositionDefinedByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error

    r1:=1.013;
    r2:=20.0;
    fluidPropertyCallAnalysis( rResult, r1, r2, FuncH_OF_PT, fluidData, CompositionDefinedByMass);

    fluidPropertyCallFlueGas calls a property table function for a fluid of the classical type "flue gas"

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:FluidData: the specified material composition

    6:CompositionDefinedByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error
    r1:=1.013;
    r2:=20.0;
    fluidPropertyCallFlueGas ( rResult, r1, r2, FuncH_OF_PT, fluidData, CompositionDefinedByMass);

    fluidPropertyCallWST

    or

    fluidPropertyCallWaterSteam

    calls a property table function for a fluid of the classical type "water/steam"

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    var r1,r2,rResult:real;    
    begin
        r1:=1.013;
        r2:=20.0
        fluidPropertyCallWST ( rResult,  r1, r2, FuncH_OF_PT);  
        println (rResult);
    end.

    fluidPropertyCallSALT

    calls a property table function for a fluid of classical type "salt water"

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:REAL: salt (Content of the salt in the total mass)

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    var  r1,r2,rResult:real;
    begin

        r1:=1.013
        r2:=20.0;

        fluidPropertyCallSalt ( rResult, r1, r2, FuncH_OF_PT, 0.035);
        println (rResult);
    end.

    fluidPropertyCallBinaryMixture

    calls a property table function for a fluid of type "binary mixture"

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5: INTEGER: Type of binary mixture:
       1=Ammonia/Water
       2=Water/Lithiumbromid

    6: REAL: XI (Mass fraction of refrigerant of total mass)

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    varr1,r2,rResult:real;

    begin

        r1:=1.013;
        r2:=30.0;
        fluidPropertyCallBinaryMixture( rResult, r1, r2, FuncH_OF_PT, 1, 0.8);
        println (rResult);
    end.

    fluidPropertyCallUser2Phase

    calls a property table function for a fluid of type "User2Phase"

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5: INTEGER: medium type

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;
    var r1,r2,rResult:real;

    begin

        r1:=1.013;
        r2:=20.0;
        fluidPropertyCallUser2Phase (rResult, r1, r2, FuncH_OF_PT, -1022);   
        // ethanol

        println (rResult);
    end.

    fluidPropertyCallThermoLiquid

    You can activate the library for thermoliquids for a predefined fluid (thermal oil, molten salt) with this function.

    :REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5: ThermoLiquidTypeEnum: Thermoliquid type

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    var   r1,r2,rResult:real;

    begin

        r1:=20;
        r2:=380.0;
        fluidPropertyCallThermoLiquid (rResult, r1, r2, FuncH_OF_PT, ThermoLiquidTypeDowtherm_A);   
        
    println (rResult);

    end.

    fluidPropertyCallThermoLiquidUser

    With this function, you can activate the library for thermoliquids for a fluid defined on your own. The required material parameters have to be set in EbsScript before .

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    4:const fluidExtensionThermo
       liquid: FluidExtensionThermo
       liquid

    BOOLEAN:
    true: o.k.
    false: error

    uses @Fluid;

    var r:real;
    flAttr:FluidExtensionThermoLiquid;

    begin

    flAttr.thermoLiquidType:=ThermoLiquidTypeUserDefined;
    flAttr.mol_weight :=100;
    flAttr.t_min :=200;
    flAttr.t_max :=400;
    flAttr.viscosity:= ThermoLiquidUserDefinedViscosityUseEta;
    flAttr.cp[0]:=1.5;
    flAttr.cp[0]:=0.005;
    fluidTableThermoLiquidUser( r, 20, 380, FuncH_OF_PT, flAttr );

    println (r);
    end. 

    fluidPropertyCallHumidAir

    calls a property table function for a fluid of type "humid air"

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:REAL: XI (Specified water content)

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    var r1,r2,rResult:real;    

    begin

        r1:=2;
        r2:=25;
        fluidPropertyCallHumidAir (rResult, r1, r2, FuncH_OF_PT, 0.005);  

        println (rResult);

    end.

    fluidProperty3Call

    (with 3 arguments)

    calls a property table function for a fluid of type with 3 arguments

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:REAL: 3rd argument for the material table function

    5:FuncEnum: type of the function to be called

    4:EBSDATA: object

    BOOLEAN:
    true: o.k.
    false: error

                   

     

     

    fluidProperty3CallAnalysis

    calls a property table function for a specified fluid

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:REAL: 3rd argument for the material table function (e.g phi for FuncXIW OF PTPhi; Tf for FuncXIW OF  PTTf)
    5:FuncEnum: type of the function to be called

    6:FluidData: the specified material composition

    7:CompositionDefinedByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error

    r1:=1.013;
    r2:=20.0;
    r3:=0,8;
    fluidProperty3CallAnalysis( rResult, r1, r2, r3,FuncXIW_OF_PTPhi, fluidData, CompositionDefinedByMass);

    fluidProperty3CallFlueGas calls a material value function of the flue gas table (classical fluid) for a given flue gas, which requires 3 arguments

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:REAL: 3rd argument for the material table function

    5:FuncEnum: type of the function to be called

    6:FluidData: the specified material composition of the flue gas

    7:CompositionDefinedByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error
    fluidProperty3CallHumidAir calls a material value function of the LibHuAirXiw humidity-air table for a given humid air, which requires 3 arguments

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:REAL: 3rd argument for the material table function

    5:FuncEnum: type of the function to be called

    6:REAL: xi: Water content

    BOOLEAN:
    true: o.k.
    false: error
    fluidProperty3CallThermoLiquidUser calls a material value function for a given oil / melt, which requires 3 arguments

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:REAL: 3rd argument for the material table function

    5:FuncEnum: type of the function to be called

    6:fluidData:  the specified material composition of the oil / melt

    BOOLEAN:
    true: o.k.
    false: error

    fluidProperty3CallUser2Phase

    calls a property table function for a fluid of type "User2Phase" with three arguments

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:REAL: 3rd argument for the material table function

    5:FuncEnum: type of the function to be called

    6: INTEGER: medium type

    BOOLEAN:
    true: o.k.
    false: error

                   

     

     

    The second function set

    Name

    Purpose

    Arguments

    Value returned

    Example

    fluidProperty

    calls a property table function for a specified fluid

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4:EBSDATA: object

    5:REAL: return on error value (default is -999)

    REAL: calculated result

    uses @Fluid;
    var r, rError:real;

    begin
       r:=fluidProperty (1.0135199, 370, FuncH_OF_PT, Fluegas_1);
       println (r)
    end.

    fluidPropertyAnalysis

    calls a property table function for a specified fluid

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4:FluidData: the specified material composition

    5:CompositionDefinedByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    6:REAL: return on error value (default is -999) 

    REAL: calculated result

    r1:=1.013;
    r2:=20.0;
    rResult:=fluidPropertyAnalysis( rResult, r1, r2, FuncH_OF_PT, fluidData,CompositionDefinedByMass);

    fluidPropertyWST

      or

    fluidPropertyWaterSteam

    calls a property table function for a fluid of the classical type "water/steam"

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4:REAL: return on error value (default is -999)

    REAL: calculated result

    uses @fluid;
    var  r1,r2,rResult:real;   
    begin
        r1:=1.013;
        r2:=20.0;
        rResult:=fluidPropertyWST( r1, r2, FuncH_OF_PT);  
        println (rResult);
    end.

    fluidPropertyFlueGas calls a property table function for a fluid of the classical type "flue gas"

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4:FluidData: the specified material composition

    5:CompositionDefinedByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    6:REAL: return on error value (default is -999)

    REAL: calculated result

    fluidPropertySalt

    calls a property table function for a fluid of the classical type "salt water"

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4:REAL: salt (Proportion of salt in the total mass)

    5:REAL: return on error value (default is -999)

    REAL: calculated result

    uses @fluid;

    var  r1,r2,rResult:real;

    begin

        r1:=1.013;
        r2:=20.0;
        rResult:= fluidPropertySalt  (r1, r2, FuncH_OF_PT,0.035);
        println (rResult);

    end.

    fluidPropertyBinaryMixture

    calls a property table function for a fluid of type "binary mixture"

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4: INTEGER: type of binary mixture:
       1=Ammonia/Water
       2=Water/Lithiumbromid

    5: REAL: XI (Mass fraction of refrigerant v. total mass)

    6:REAL: return on error value (default is -999)

    REAL: calculated result

    uses @fluid;

    var r1,r2,rResult:real;

    begin

        r1:=1.013;
        r2:=30.0;
        rResult:=fluidPropertyBinaryMixture( r1, r2, FuncH_OF_PT, 1, 0.8);
        println (rResult);

    end.

    fluidPropertyUser2Phase

    calls a property table function for a fluid of type "User2phase"

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4: INTEGER: type of medium

    5:REAL: return on error value (default is -999)

    REAL: calculated result

    uses @fluid;

    var r1,r2,rResult:real;

    begin

        r1:=1.013;
        r2:=20.0;
        rResult := fluidPropertyUser2Phaser (r1, r2, FuncH_OF_PT, -1022);   
        // ethanol
        println (rResult);

    end.

    fluidPropertyThermoLiquid

    You can activate the library for thermoliquids for a predefined fluid (thermal oil, molten salt) with this function.

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4: ThermoLiquidTypeEnum: Thermoliquid-Type

    5:REAL: return on error value (default is -999)

    6:REAL: return on error value (default is -999)

    REAL: calculated result

    uses @fluid;

    var  r1,r2,rResult:real;
    begin

        r1:=20;
        r2:=380.0;
        rResult:= fluidPropertyThermoLiquid (r1, r2, FuncH_OF_PT, ThermoLiquidTypeDowtherm_A);                     
        println (rResult);
    end.

    fluidPropertyThermoLiquidUser

    With this function, you can activate the library for thermoliquids for a fluid defined on your own. The required material parameters have to be set in EbsScript before .

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4:CONST: fluidExtensionThermo
       liquid: FluidExtensionThermo
       liquid

    5:REAL: return on error value (default is -999)

    REAL: calculated result

    uses @Fluid;
    var r:real;
    flAttr:FluidExtensionThermoLiquid;

    begin
       flAttr.thermoLiquidType := ThermoLiquidTypeUserDefined;
       flAttr.mol_weight :=100;
        flAttr.t_min :=200;
        flAttr.t_max :=400;
        flAttr.viscosity:= ThermoLiquidUserDefinedViscosityUseEta;
        flAttr.cp[0] :=1.5;
        flAttr.cp[0] :=0.005;
        r:= fluidPropertyThermoLiquidUser ( 20, 380, FuncH_OF_PT, flAttr );
        println (r);
    end.

    fluidPropertyHumidAir

    calls a property table function for a fluid of type "Humid air"

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:FuncEnum: type of the function to be called

    4:REAL: XI (Specific water content)

    5:REAL: return on error value (default is -999)

    REAL: calculated result

    uses @fluid;
    var   r1,r2,rResult:real;   
    begin

        r1:=2;
        r2:=25;
        rResult:= fluidPropertyHumidAir (r1, r2, FuncH_OF_PT, 0.005);  
        println (rResult);

    end.

    fluidProperty3

    (with 3 arguments)

    calls a property table function for a fluid of type with three  arguments

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:REAL: 3rd argument for the material table function

    4FuncEnum: type of the function to be called

    5:EBSDATA: object

    6:REAL: return on error value (default is -999)

    REAL: calculated result

                   

     

    fluidProperty3Analysis

    calls a property table function for a specified fluid with 3 arguments

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:REAL: 3rd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:FluidData: the specified material composition

    6:CompositionDefinedByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    7:REAL: return on error value (default is -999)

    REAL: calculated result

     

    fluidProperty3FlueGas calls a material value function that requires three arguments for a fluid of the classic flue gas type

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:REAL: 3rd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:FluidData: the specified material composition of the flue gas

    6:CompositionDefinedByEnum: the requested way of specification of the composition (e.g. mass or volume fractions)

    7:REAL: return on error value (default is -999)

    REAL: calculated result
    fluidProperty3HumidAir calls a material value function that requires three arguments for a fluid of the type humid air

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:REAL: 3rd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:REAL: ix: water content

    6:REAL: return on error value (default is -999)

    REAL: calculated result

     

    fluidProperty3User2Phase

    calls a property table function for a fluid of type "User2Phase" with three arguments

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:REAL: 3rd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:INTEGER: type of medium

    6:REAL: return on error value (default is -999)

    REAL: calculated result

                   

     

    fluidProperty3ThermoLiquidUser calls a material value function that requires three arguments for a fluid of the type oil/melt

    1:REAL: 1st argument for the material table function

    2:REAL: 2nd argument for the material table function

    3:REAL: 3rd argument for the material table function

    4:FuncEnum: type of the function to be called

    5:FluidExtensionThermoLiquid: oil / melt to be used

    6:REAL: return on error value (default is -999)

    REAL: calculated result

     

    Group of deprecated functions - use functions fluidProperty(Call)... instead

    Name Purpose Arguments Return value Eample

    fluidTableWST

    calls a property table function for a fluid of type water/steam

     

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit
    Call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:FuncEnum: type of the function to be called

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    var    

        r1,r2,rResult:real;

        iphase:PhaseEnum;

    begin

        r1:=1.013;

        r2:=20.0;

        fluidTableWST( rResult, iPhase, r1, r2, FuncH_OF_PT);   

        println (rResult);

    end.

    fluidTableSalt

    calls a property table function for a fluid of type saltwater

     

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit
    Call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:FuncEnum: type of the function to be called

    6: REAL: salt fraction (mass fraction of salt from total mass)

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    var    

        r1,r2,rResult:real;

        iphase:PhaseEnum;

    begin

        r1:=1.013;

        r2:=20.0;

        fluidTableSalt( rResult, iPhase, r1, r2, FuncH_OF_PT, 0.05);

        println (rResult);

    end.

    fluidTableBinaryMixture

    calls a property table function for a fluid of type binary mixture

     

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:FuncEnum: type of the function to be called

    6: INTEGER: type of the binary mixture:
       1=ammonia/water
       2=water/lithium bromide

    7: REAL: mass fraction of the cooling medium

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    var    

        r1,r2,rResult:real;

        iphase:PhaseEnum;

    begin

        r1:=1.013;

        r2:=-30.0;

        fluidTableBinaryMixture( rResult, iPhase, r1, r2, FuncH_OF_PT, 1, 0.8);

        println (rResult);

    end.

    fluidTableUser2Phase

    calls a property table function for a fluid of type user2phase

     

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit
    Call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:FuncEnum: type of the function to be called

    6: INTEGER: medium type

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;

    var    

        r1,r2,rResult:real;

        iphase:PhaseEnum;

    begin

        r1:=1.013;

        r2:=20.0;

        fluidTableUser2Phase( rResult, iPhase, r1, r2, FuncH_OF_PT, -1022);    // ethanol

        println (rResult);

    end.

    fluidTableThermoLiquid

    You can activate the library for thermoliquids for a predefined fluid (thermal oil, molten salt) with this function.

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: type of the function to be called

    5: ThermoLiquidTypeEnum: Thermoliquid-Type

    BOOLEAN:
    true: o.k.
    false: error

    uses @Fluid;

    var r:real;

    begin

    fluidTableThermoLiquid( r, 20, 380, FuncH_OF_PT, ThermoLiquidTypeDowtherm_A );

    println (r);

    end.

    fluidTableThermoLiquidUser

    With this function, you can activate the library for thermoliquids for a fluid defined on your own. The required material parameters have to be set in EbsScript before:

    1:REAL: calculated result

    2:REAL: 1st argument for the material table function

    3:REAL: 2nd argument for the material table function

    4:FuncEnum: Function to call

    5:FluidExtensionThermoliquid: const fluidExtensionThermoLiquid

    BOOLEAN:
    true: o.k.
    false: error

    uses @Fluid;
    var r:real; flAttr:FluidExtensionThermoLiquid;

    begin
       flAttr.thermoLiquidType :=ThermoLiquidTypeUserDefined;
       flAttr.mol_weight :=100;
       flAttr.t_min :=200;
       flAttr.t_max :=400;
       flAttr.viscosity := ThermoLiquidUserDefinedViscosityUseEta
       flAttr.cp[0] :=1.5;
       flAttr.cp[0] :=0.005;
       fluidTableThermoLiquidUser( r, 20, 380, FuncH_OF_PT, flAttr );
       println (r);
    end. 

    fluidTableHumidAir

    calls the property table functions for humid air

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit
    Call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:FuncEnum: type of the function to be called

    6: REAL: mass fraction of water as a fraction of total mass

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;
    var    r1,r2,rResult:real;                   
        iPhase:PhaseEnum;   

    begin
        r1:=2;
        r2:=25;
        fluidTableHumidAir( rResult ,iPhase,  r1, r2, FuncH_OF_PT, 0.005);  
        println (rResult);
    end.

    fluidGetUniversalFluid

    retrieves the data for the data structure of an universal fluid from an Ebsilon object (a pipe or a component 1 or 33) with the fluid type "universal fluid"

    1: ebsData: Ebsilon object to be considered

    2: UniversalFluidType: data structure for retrieval of the universal fluid data

    3: UniversalCompositionDefinedByEnum: requested kind of specification (mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error

    if (fluidGetUniversalFluid (obj, universalData,
       UniversalCompositionDefinedByMass)) then

    begin
        nLibs:=length(universalData.libraries);
        for iLib:=1 to nLibs do  begin
            lib:=universalData.libraries[iLib-1];
            println("Library ",lib.library,": ",lib.fraction,"\n");
            if (lib.fraction > 1.0e-7) then begin
                nParts:=length(lib.substanceParts);
                for iPart:=1 to nParts do begin
                    part:=lib.substanceParts[iPart-1];
                    if (part.fraction > 1.0e-7) then begin
                        println ("Substance ",part.substance,
                       ": ",part.fraction);
                    end;
                end;
            end;
        end;
    end;

    fluidSetUniversalFluid

    inserts the data of a universal fluid data structure to an Ebsilon object (a pipe or a component 1 or 33)

    1: ebsData: Ebsilon object to be modified

    2: UniversalFluidType: data structure with data for the universal fluid

    3: UniversalCompositionDefinedByEnum: requested kind of specification (mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: Error

    uses @fluid;
    var    universalData: UniversalFluidType;
    begin
        setLength (universalData.libraries, 2);
        universalData.libraries[0]. library :=UniversalLibraryLIBIF97;
        universalData.libraries[1]. library :=UniversalLibraryFDBR;
        universalData.libraries[0]. fraction:=0.1;  
        universalData.libraries[1]. fraction:=0.9;
        setLength(universalData.l ibraries[1].substanceParts, 2);
       universalData.libraries[1]. substanceParts[0]. substance:= UniversalSubstanceN2;
        universalData.libraries[1]. substanceParts[0]. fraction:= 0.7;               
        universalData.libraries[1]. substanceParts[1]. substance:= UniversalSubstanceO2;
       universalData.libraries[1]. substanceParts[1]. fraction:= 0.3;  
        if (fluidSetUniversalFluid (Startvalue, universalData, UniversalCompositionDefinedByMass)) then begin
            println ("ok");
        end;
    end.

    fluidTableUniversalFluid

    calls a property table function for a fluid of type universal fluid

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit
    Call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:FuncEnum: type of the function to be called

    6:UniversalFluidType: data structure with data for the universal fluid

    7:UniversalCompositionDefinedByEnum: requested kind of specification (mass or volume fractions)

    BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;
    varr1,r2,rResult:real;
        iphase:PhaseEnum;
        universalData:UniversalFluidType;

    begin

        setLength (universalData.libraries, 2)
        universalData.libraries[0] .library :=UniversalLibraryLIBIF97;
        universalData.libraries[1] .library :=UniversalLibraryFDBR;
        universalData.libraries[0] .fraction :=0.1;  
        universalData.libraries[1] .fraction :=0.9;
        setLength (universalData.libraries[1] .substanceParts, 2);
       universalData.libraries[1] .substanceParts[0].substance :=UniversalSubstanceN2;
        universalData.libraries[1] .substanceParts[0].fraction := 0.7; 
       universalData.libraries[1] .substanceParts[1].substance :=UniversalSubstanceO2;
       universalData.libraries[1] .substanceParts[1].fraction :=0.3;  

        r1:=1.013;
        r2:=20.0
        fluidTableUniversalFluid( rResult, iPhase, r1, r2, FuncH_OF_PT, universalData, UniversalCompositionDefinedByMass );   
        println (rResult);
    end.

    fluidTable3UniversalFluid calls up a material value function for a fluid of the type ‘universal fluid’ With an additional 3rd argument BOOLEAN:
    true: o.k.
    false: error

    fluidTable3User2Phase

    calls a property table function for a fluid of type user2phase

     

    1:REAL: calculated result

    2:PhaseEnum: Phase is not calculated (value 0)
    Note: phase can only with explicit
    Call (PHASE (P, H)) can be calculated.

    3:REAL: 1st argument for the material table function

    4:REAL: 2nd argument for the material table function

    5:REAL: 3rd argument for the material table function

    6:FuncEnum: type of the function to be called

    7: INTEGER: medium type

    BOOLEAN:
    true: o.k.
    false: error

                   

     

    fluidTable3ThermoLiquid

    as above With an additional 3rd argument BOOLEAN:
    true: o.k.
    false: error
    fluidTable3ThermoLiquidUser as above With an additional 3rd argument BOOLEAN:
    true: o.k.
    false: error
    fluidTable3HumidAir as above With an additional 3rd argument BOOLEAN:
    true: o.k.
    false: error

    uses @fluid;
    var phase:PhaseEnum; result:real;
    begin
       fluidTable3HumidAir (result, phase, 1.1, 35.53, 28.77, FuncXIW_of_PTTf, 0.0);
    end.

     

    <