Hi,
I have coded this function and there are some errors. I don't understand what is the problem.
Thanks,
CODE

function CalculHforce
input Modelica.SIunits.AbsolutePressure p "Pressure";
input Modelica.SIunits.Temperature T "Temperature";
input Modelica.SIunits.MassFraction X[:] "Mass fractions";
input Modelica.SIunits.MassFlowRate mdot;
input Modelica.SIunits.Length Dhyd;
input Modelica.SIunits.Area Area;
output Modelica.SIunits.CoefficientOfHeatTransfer alpha;
protected
Real Re;
Real Pr;
Real Nu;
algorithm

Re:=ThermoFluidPro.CharacteristicNumbers.ReynoldsNumber(mdot,Dhyd,Area,
ThermoFluidPro.Media.Air.NoncondensingAir.dynamicViscosity(
ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX(p, T, X)));
Pr:=ThermoFluidPro.CharacteristicNumbers.PrandtlNumber(
ThermoFluidPro.Media.Air.NoncondensingAir.dynamicViscosity(
ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX(p, T, X)),
ThermoFluidPro.Media.Air.NoncondensingAir.specificHeatCapacityCp( ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX(p, T, X)),
ThermoFluidPro.Media.Air.NoncondensingAir.thermalConductivity( ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX(p, T, X)));

if abs(Re)<5000 then
Nu:=0.664*Re^0.5*Pr^(1./3.);
else
Nu :=0.037*abs(Re)^0.8*Pr/(1 + 2.443*abs(Re)^(-0.1)*(Pr^(2./3.) - 1));
end if;
alpha:=Nu*Polynomials_Temp.evaluate({(-4.8737307422969E-008), 7.67803133753502E-005, 0.0241814385504202},
T)/Dhyd;
end CalculHforce;

CODE
Error: Unknown function ThermoFluidPro.Media.Air.NoncondensingAir.ThermodynamicState_Unique'"146A1C80"' in  (function ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX).
Error: Unknown function ThermoFluidPro.Media.Air.NoncondensingAir.ThermodynamicState_Unique'"146A1C80"' in  (function ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX).
Errors found in:
state = (if size(X, 1) == (if size({"water", "air"}, 1) == 1 then 0 else size({"water",
"air"}, 1)) then ThermoFluidPro.Media.Air.NoncondensingAir.ThermodynamicState_Unique'"146A1C80"'
() else ThermoFluidPro.Media.Air.NoncondensingAir.ThermodynamicState_Unique'"146A1C80"'
())
File: C:/Program Files/Dymola/Modelica/Library/ThermoFluidPro 1.4.2/package.moe, line 23438
Error: argument 1 in call of unknown function ThermoFluidPro.Media.Air.NoncondensingAir.specificHeatCapacityCp
is a record in:
ThermoFluidPro.Media.Air.NoncondensingAir.specificHeatCapacityCp(
ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX(p, T, X))
Error: argument 1 in call of unknown function ThermoFluidPro.Media.Air.NoncondensingAir.thermalConductivity
is a record in:
ThermoFluidPro.Media.Air.NoncondensingAir.thermalConductivity(ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX(p, T, X))
Error: For equation
Pr = ThermoFluidPro.CharacteristicNumbers.PrandtlNumber(ThermoFluidPro.Media.Air.NoncondensingAir.dynamicViscosity(...), ThermoFluidPro.Media.Air.NoncondensingAir.specificHeatCapacityCp
(ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX(p, T, X)), ThermoFluidPro.Media.Air.NoncondensingAir.thermalConductivity(
ThermoFluidPro.Media.Air.NoncondensingAir.setState_pTX(p, T, X)));
found in class Truck.CalculHforce, declaration window at line 22.

Failed to expand:Truck.CalculHforce(101325, 300, {1}, 1, 1, 1)