Check Time Step Size on interPhaseChangeFoam

Its pretty common, actually standard, when running interPhaseChangeFoam that you have to “tune” or at the very least investigate the parameter space for the constants in the three models. For example, the Kunz model has four constants and in the published literature the values for Cc and Cv can vary by upwards of seven orders of magnitude.

When I’m investigating these constants for a particular simulation I try to run the smallest serial jobs that I can that are still representative. Then, I’m fortunate enough to have access to a 44 core E5-2699 v4 to run these serial jobs on. That brings me to the next point that when the coefficients are inappropriate then the dt will drop to ludicrously small values and the simulation will not complete in a sensible time. To check for this the following bash one liner will check the status for you:

ps aux | \
grep interPh | \
grep -v grep | \
awk -F ' ' '{print $2}' | \
xargs -I {} sh -c "grep -E 'deltaT = ' /proc/{}/cwd/log.interPhaseChangeFoam | tail -1"

Breaking this down:

  • line 1: dumps all the processes running
  • line 2: excludes all but the interPhaseChangeFoam processes
  • line 3: excludes the grep search
  • line 4: graps the process IDs
  • line 5: does the grunt work to extract the last dt value from the log file

This has been tested on RHEL6 and 7 but should be good on most *NIX flavours with no significant changes.

Finally, thanks for reading this article and please leave a comment below. If you are interested in being updated when similar items are posted then either subscribe via RSS or sign up to my mailing list below.

Site Footer