public Expression GetLiquidHeatCapacityExpression(ThermodynamicSystem system, MolecularComponent comp, Variable T) { var func = comp.GetFunction(EvaluatedProperties.LiquidHeatCapacity); var expr = system.CorrelationFactory.CreateExpression(func.Type, func, T, comp.GetConstant(ConstantProperties.CriticalTemperature), comp.GetConstant(ConstantProperties.CriticalPressure)); expr *= Unit.GetConversionFactor(func.YUnit, system.VariableFactory.Internal.UnitDictionary[PhysicalDimension.HeatCapacity]); Variable prop = new Variable(system.CorrelationFactory.GetVariableNameForProperty(func.Property) + "(" + T.FullName + ")", 1); prop.Subscript = comp.ID; prop.BindTo(expr); return(prop); }
public Variable GetVaporViscosityExpression(ThermodynamicSystem system, MolecularComponent comp, Variable T, Variable p) { var func = comp.GetFunction(EvaluatedProperties.VaporViscosity); var expression = system.CorrelationFactory.CreateExpression(func.Type, func, T, null, null); expression *= Unit.GetConversionFactor(func.YUnit, system.VariableFactory.Internal.UnitDictionary[PhysicalDimension.DynamicViscosity]); Variable prop = new Variable(system.CorrelationFactory.GetVariableNameForProperty(func.Property) + "(" + T.FullName + ")", 1); prop.LowerBound = 0; prop.Subscript = comp.ID; prop.BindTo(expression); return(prop); }
public Variable GetVaporPressure(ThermodynamicSystem system, MolecularComponent comp, Variable T) { var func = comp.GetFunction(EvaluatedProperties.VaporPressure); var expr = system.CorrelationFactory.CreateExpression(func.Type, func, T, comp.GetConstant(ConstantProperties.CriticalTemperature), comp.GetConstant(ConstantProperties.CriticalPressure)); expr *= Unit.GetConversionFactor(func.YUnit, system.VariableFactory.Internal.UnitDictionary[PhysicalDimension.Pressure]); //var exprmax = system.CorrelationFactory.CreateExpression(func.Type, func, comp.GetConstant(ConstantProperties.CriticalTemperature), comp.GetConstant(ConstantProperties.CriticalTemperature), comp.GetConstant(ConstantProperties.CriticalPressure)); //var maxVal = exprmax.Eval(new Evaluator()); Variable prop = new Variable(system.CorrelationFactory.GetVariableNameForProperty(func.Property) + "(" + T.FullName + ")", 1); prop.Subscript = comp.ID; // prop.UpperBound = 1e9; prop.BindTo(expr); return(prop); }
public Variable GetLiquidDensityExpression(ThermodynamicSystem system, MolecularComponent comp, Variable T, Variable p) { var func = comp.GetFunction(EvaluatedProperties.LiquidDensity); var TC = comp.GetConstant(ConstantProperties.CriticalTemperature); var expression = system.CorrelationFactory.CreateExpression(func.Type, func, T, TC, null); expression *= Unit.GetConversionFactor(func.YUnit, system.VariableFactory.Internal.UnitDictionary[PhysicalDimension.MolarDensity]); var expresssionDENV = GetVaporDensityExpression(system, comp, T, p); Variable prop = new Variable(system.CorrelationFactory.GetVariableNameForProperty(func.Property) + "(" + T.FullName + ")", 1); prop.LowerBound = 1e-6; prop.UpperBound = 1e8; prop.Subscript = comp.ID; prop.BindTo(new SafeLiquidDensity(expression, expresssionDENV)); //prop.BindTo(expression); return(prop); }
public Expression GetLiquidHeatCapacityIntegralExpression(ThermodynamicSystem system, MolecularComponent comp, Variable T, Variable Tref) { Expression expression = null; var func = comp.GetFunction(EvaluatedProperties.LiquidHeatCapacity); switch (func.Type) { case FunctionType.Polynomial: expression = system.CorrelationFactory.CreateIntegratedExpression(FunctionType.PolynomialIntegrated, func, T, Tref); expression *= Unit.GetConversionFactor(func.YUnit, system.VariableFactory.Internal.UnitDictionary[PhysicalDimension.HeatCapacity]); break; case FunctionType.AlyLee: expression = system.CorrelationFactory.CreateIntegratedExpression(FunctionType.Dippr117, func, T, Tref); expression *= Unit.GetConversionFactor(func.YUnit, system.VariableFactory.Internal.UnitDictionary[PhysicalDimension.HeatCapacity]); break; } Variable prop = new Variable(system.CorrelationFactory.GetVariableNameForProperty(func.Property) + "_INT" + "(" + T.FullName + ")", 1); prop.Subscript = comp.ID; prop.BindTo(expression); return(prop); }