potentialFoam creates unphysical velocity field in motorBike tutorial
Summary
In OpenFOAM v2112, potentialFoam creates an unphysical velocity field.
This ultimately leads to the crash of the simulation.
In OpenFOAM v2012, this issue was not present.
Tested in serial as well as in parallel execution, on different Linux versions and on different hardware.
Steps to reproduce
Copy the motorBike tutorial case, execute the Allrun script, look at the 0/U field in paraview.
Example case
motorBike tutorial
What is the current bug behaviour?
What is the expected correct behavior?
Relevant logs and/or images
Environment information
- OpenFOAM version : v2112: latest stable release and dev version 'patch = 220310, build = f8dc1929-20220507'
- Operating system : ArchLinux and OpenSUSE Tumbleweed
- Hardware info : AMD EPYC 7452 and Intel Xeon CPU E5-2650
- Compiler : gcc
Possible fixes
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Activity
- Kutalmış Berçin added community label
added community label
- Kutalmış Berçin assigned to @kuti
assigned to @kuti
- Maintainer
Hi @ae - many thanks for your ticket.
I couldn't reproduce the issue yet by using
simpleFoam/motorBike
:- develop branch (HEAD:5d945618)
- v2112 (HEAD:14aeaf8d)
- Clang 9.0.1, Open MPI 1.10.7.0.5e373bf1fd, openSUSE Leap 15.3, linux64ClangDPInt32Opt
I will test the f8dc1929.
Edited by Kutalmış Berçin - Author
Hi @kuti thanks for your reply!
I tried the tutorial again with 5d945618, but still have the same unphysical results.
Edited by Aaron Endres - Author
I believe that the error has to occur in the U calculation after solving for phi. The output of potentialFoam of each version is:
2112:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2112 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : f8dc192941-20220507 OPENFOAM=2112 patch=220310 version=v2112 Arch : "LSB;label=64;scalar=64" Exec : potentialFoam Date : May 17 2022 Time : 15:15:26 Host : PID : 22063 I/O : uncollated Case : nProcs : 1 trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 potentialFlow: Operating solver in PISO mode Reading velocity field U Constructing pressure field p Constructing velocity potential field Phi No MRF models present Calculating potential flow GAMG: Solving for Phi, Initial residual = 1, Final residual = 0.00846543, No Iterations 8 GAMG: Solving for Phi, Initial residual = 0.0459006, Final residual = 0.000221529, No Iterations 3 GAMG: Solving for Phi, Initial residual = 0.00168872, Final residual = 1.56708e-05, No Iterations 4 GAMG: Solving for Phi, Initial residual = 0.000208416, Final residual = 1.39762e-06, No Iterations 4 GAMG: Solving for Phi, Initial residual = 2.56765e-05, Final residual = 1.91724e-07, No Iterations 4 GAMG: Solving for Phi, Initial residual = 6.69714e-06, Final residual = 6.27339e-08, No Iterations 4 GAMG: Solving for Phi, Initial residual = 2.9162e-06, Final residual = 7.87026e-08, No Iterations 2 GAMG: Solving for Phi, Initial residual = 1.59776e-06, Final residual = 4.64962e-08, No Iterations 2 GAMG: Solving for Phi, Initial residual = 9.58503e-07, Final residual = 9.68698e-08, No Iterations 1 GAMG: Solving for Phi, Initial residual = 6.44061e-07, Final residual = 6.29491e-08, No Iterations 1 GAMG: Solving for Phi, Initial residual = 4.32672e-07, Final residual = 4.92198e-08, No Iterations 1 Continuity error = 2.91765e-06 Interpolated velocity error = 0.39427 ExecutionTime = 3.02 s ClockTime = 3 s End
2012:
/*---------------------------------------------------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2012 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ Build : _7bdb509494-20201222 OPENFOAM=2012 Arch : "LSB;label=32;scalar=64" Exec : potentialFoam Date : May 17 2022 Time : 15:18:53 Host : PID : 22532 I/O : uncollated Case : nProcs : 1 trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE). fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20) allowSystemOperations : Allowing user-supplied system call operations // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Create time Create mesh for time = 0 potentialFlow: Operating solver in PISO mode Reading velocity field U Constructing pressure field p Constructing velocity potential field Phi No MRF models present Calculating potential flow GAMG: Solving for Phi, Initial residual = 1, Final residual = 0.00846543, No Iterations 8 GAMG: Solving for Phi, Initial residual = 0.0459006, Final residual = 0.000221529, No Iterations 3 GAMG: Solving for Phi, Initial residual = 0.00168872, Final residual = 1.56708e-05, No Iterations 4 GAMG: Solving for Phi, Initial residual = 0.000208416, Final residual = 1.39762e-06, No Iterations 4 GAMG: Solving for Phi, Initial residual = 2.56765e-05, Final residual = 1.91724e-07, No Iterations 4 GAMG: Solving for Phi, Initial residual = 6.69714e-06, Final residual = 6.27339e-08, No Iterations 4 GAMG: Solving for Phi, Initial residual = 2.9162e-06, Final residual = 7.87026e-08, No Iterations 2 GAMG: Solving for Phi, Initial residual = 1.59776e-06, Final residual = 4.64962e-08, No Iterations 2 GAMG: Solving for Phi, Initial residual = 9.58503e-07, Final residual = 9.68698e-08, No Iterations 1 GAMG: Solving for Phi, Initial residual = 6.44061e-07, Final residual = 6.29491e-08, No Iterations 1 GAMG: Solving for Phi, Initial residual = 4.32672e-07, Final residual = 4.92198e-08, No Iterations 1 Continuity error = 2.91765e-06 Interpolated velocity error = 0.000278895 ExecutionTime = 3.56 s ClockTime = 4 s End
Up to continuity error everything is the same. The Interpolated velocity error is however much higher with version 2112. This indicates that the error is caused by one of the two following functions in potentialFoam (lines 189 and 190):
U = fvc::reconstruct(phi); U.correctBoundaryConditions();
Interestingly, only the y and z-component of the U field are affected:
Edited by Aaron Endres - Owner
This may be related to issue #2434 (closed) that showed some strange gcc behaviour - can you try the fix in commit 2090d312 or test again using a recent master/develop branch build (or v2206) ?
- Author
Yes, you are right! The issue does not occur anymore in the current release v2206. Thank you for your help and the update!
- Owner
Great to hear!
- Andrew Heather closed
closed
- Mark OLESEN marked this issue as related to #3024
marked this issue as related to #3024