Fluid material selection ... CoolProp installation [Solved]

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
tpa
Posts: 49
Joined: Fri Mar 16, 2012 11:35 pm

Re: Fluid material selection ... CoolProp installation [Solved]

Post by tpa »

Some numbers to chew. The case is the duct above where various parameters are either provided by CoolProp (ML) or constant (C) or - in case of density - by own formula (UL) - Bon appetit, and thank you for your being so helpful.

Code: Select all

ML = Material Law
C  = Constant
UL = User Law (density = rho0*(293.15/temperature);)

Air, k-e, 50 iterations, single CPU, two threads.
 Matrix bandwidth for volume mesh :          61491
 Matrix profile/lines for volume mesh :      22235


                             Dens Visc SpcH TCnd
./RESU/20231030-1941         ML   ML   ML   ML
Calculation time summary:

  User CPU time:            331.540 s
  System CPU time:            1.464 s

  Elapsed time:             204.167 s
  CPU / elapsed time          1.631

  Total elapsed time for  CoolProp (TTSE&HEOS):  46.584 s

./RESU/20231030-1946         ML   ML   ML   C
Calculation time summary:

  User CPU time:            320.180 s
  System CPU time:            1.240 s

  Elapsed time:             190.581 s
  CPU / elapsed time          1.687

  Total elapsed time for  CoolProp (TTSE&HEOS):  37.175 s

./RESU/20231030-1950         ML   ML   C    C
Calculation time summary:

  User CPU time:            308.492 s
  System CPU time:            1.340 s

  Elapsed time:             180.402 s
  CPU / elapsed time          1.717

  Total elapsed time for  CoolProp (TTSE&HEOS):  26.870 s

./RESU/20231030-1953         ML   C    C    C
Calculation time summary:

  User CPU time:            299.348 s
  System CPU time:            1.084 s

  Elapsed time:             168.838 s
  CPU / elapsed time          1.779

  Total elapsed time for  CoolProp (TTSE&HEOS):  17.286 s

./RESU/20231030-1958         C    C    C    C
Calculation time summary:

  User CPU time:            237.760 s
  System CPU time:            3.864 s

  Elapsed time:             130.127 s
  CPU / elapsed time          1.857

  Total elapsed time for  CoolProp (HEOS):  0.000 s

./RESU/20231030-2019         UL   C    C    C
Calculation time summary:

  User CPU time:            299.888 s
  System CPU time:            7.384 s

  Elapsed time:             180.888 s
  CPU / elapsed time          1.699

  Total elapsed time for  CoolProp (HEOS):  0.000 s

Edit: Added info for "Total elapsed time for CoolProp (TTSE&HEOS)"
Last edited by tpa on Tue Oct 31, 2023 6:04 pm, edited 1 time in total.
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Fluid material selection ... CoolProp installation [Solved]

Post by Yvan Fournier »

Hello,

Thanks for the data. Since your results are quite different between a constant and a user law, I assume varying density also has some impact on the convergence behavior, making the comparison a bit more tricky, but it is good to know that although using CoolProp adds some computational cost, it is now "reasonabe" compared to the ×10 we had in older versions (recomputing everything at all cells instead of using CoolProp's tabulation mechanism).

Best regards,

Yvan
tpa
Posts: 49
Joined: Fri Mar 16, 2012 11:35 pm

Re: Fluid material selection ... CoolProp installation [Solved]

Post by tpa »

Three basic observations:

1. More variables (opposed to constants) to be calculated require more time
2. The difference between the Material law ML and User Law (UL) for density is in significant.
3. Biggest difference seems to be between all constant or not all constant.
Maybe the call to external routines in general is expensive (program logistics)
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Fluid material selection ... CoolProp installation [Solved]

Post by Yvan Fournier »

Hello,

You can actually get the time required specifically for calls to CoolProp in the "Physical property computations" sectoon of the "performance.log" file.

Best regards,

Yvan
tpa
Posts: 49
Joined: Fri Mar 16, 2012 11:35 pm

Re: Fluid material selection ... CoolProp installation [Solved]

Post by tpa »

Added info for "Total elapsed time for CoolProp (TTSE&HEOS)"

Code: Select all

Run	1958	1953	1950	1946	1941	2019
Elapsed	130.13	168.84	180.40	190.58	204.17	180.89
CoolPr.	0.00	17.29	26.87	37.18	46.58	0.00
Prop%	0.0%	10.2%	14.9%	19.5%	22.8%	28.1%
Rho	C	ML	ML	ML	ML	UL
Visc	C	C	ML	ML	ML	C
SpHt	C	C	C	ML	ML	C
ThCd	C	C	C	C	ML	C
Incr.	0.00	38.71	11.56	10.18	13.59	50.76
Incr.%	0.00%	10.24%	4.66%	4.61%	3.31%	28.06%
  • Incr. is the added amount of time spent in CoolProp compared to the run to the left (which has one calculated property less) except 2019 which compares to 1958
  • Incr.% is the absolute difference in the Prop% compared to the run to the left (which has one calculated property less) except 2019 which compares to 1958
  • By comparing percentages is to reduce the effect of differences in iteration among the different runs
  • It seems cheaper to use CoolProp density function than the user formula. As 1950 and 2019 are both around 180s elapsed time it seems that one can have the Viscosity calculation for free.
  • Each additional value besides density (viscosity, specific heat, or thermal conductivity) costs 3-5% for this problem
It doesn't look that bad, does it?
Yvan Fournier
Posts: 4080
Joined: Mon Feb 20, 2012 3:25 pm

Re: Fluid material selection ... CoolProp installation [Solved]

Post by Yvan Fournier »

Hello,

Yes, that is good news. The computational cost now seems small enough to use CoolProp without a significant penalty.

Best regards,

Yvan
Post Reply