View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002611 | OpenFOAM | Bug | public | 2017-07-12 15:16 | 2017-07-21 15:49 |
Reporter | zli | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Fixed in Version | dev | ||||
Summary | 0002611: Inconsistance of Crank Nicolson shceme for alphaEqn and UEqn in interFoam | ||||
Description | The different implementation of Crank Nicolson scheme in alphaEqn and the UEqn cause an overshoot/undershoot of velocity on the first time step even when the velocity field is initialised uniform in the domain. The first time step of CrankNicolson in UEqn is implicit Euler. The first time step of CrankNicolson in alphaEqn is Crank Nicolson but alphaphi(and then rhoPhi) is recalculated to the end of time step. That makes (rho1 - rho0)/dt + sum (rhoPhi) != 0 and thus when calculate HbyA it create an undershot of the velocity and then the correction by pressure creates undershot and overshot. | ||||
Steps To Reproduce | Use interFoam Creat a square domain gravity( 0 0 -9.81) with velocity uniform (0 0 1) Make the lower part of the domain occupied by water. Calculate one time step without momentum predictor. See HbyA and U | ||||
Tags | No tags attached. | ||||
|
|
|
Which OpenFOAM version are you running? Can you provide the case? Can you provide a patch to correct the problem? See also https://bugs.openfoam.org/rules.php |
|
I am running with OF 2.4, I checked the code in 4-dev, the problem is still the same. To fix this bug I added one condition sentence to do not reconstruct the end-of-time-step rho flux for the first time step. And it works fine. In alphaEqn.H 195 if 196 ( 197 word(mesh.ddtScheme("ddt(rho,U)")) 198 == fv::EulerDdtScheme<vector>::typeName 199 ) 200 { 201 rhoPhi = phiAlpha*(rho1 - rho2) + phiCN*rho2; 202 } 203 else 204 { 205 if (ocCoeff > 0 && ! (runTime.timeIndex() == runTime.startTimeIndex() 206 || runTime.timeIndex() == runTime.startTimeIndex() + 1)) 207 { 208 // Calculate the end-of-time-step alpha flux 209 phiAlpha = (phiAlpha - (1.0 - cnCoeff)*phiAlpha.oldTime())/cnCoeff; 210 } 211 212 else 213 { 214 Info << "First Time Step, the end-of-time-step is not reconstructed" << endl; 215 phiAlpha.oldTime(); 216 } 217 218 // Calculate the end-of-time-step mass flux 219 rhoPhi = phiAlpha*(rho1 - rho2) + phi*rho2; 220 } |
|
> I checked the code in 4-dev How recent is your OpenFOAM-dev intallation? I upgraded your case to OpenFOAM-dev, set ddtSchemes { default CrankNicolson 0.95; } and looked at the U field at the end of the first time-step and it looks the same as with running Euler. Could you provide details of how you reproduced the problem in the latest OpenFOAM-dev? |
|
I cannot reproduce this problem in OpenFOAM-dev and without further information from the reporter nothing can be done. |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-07-12 15:16 | zli | New Issue | |
2017-07-12 15:16 | zli | File Added: HbyA_and_Prgh.png | |
2017-07-12 15:36 | henry | Note Added: 0008385 | |
2017-07-13 13:44 | zli | File Added: interFoam_bug_report.tar.gz | |
2017-07-13 13:44 | zli | Note Added: 0008388 | |
2017-07-19 13:42 | henry | Note Added: 0008416 | |
2017-07-21 15:49 | henry | Assigned To | => henry |
2017-07-21 15:49 | henry | Status | new => closed |
2017-07-21 15:49 | henry | Resolution | open => unable to reproduce |
2017-07-21 15:49 | henry | Fixed in Version | => dev |
2017-07-21 15:49 | henry | Note Added: 0008429 |