|
[Sponsors] |
June 15, 2012, 17:23 |
time step continiuty error
|
#1 |
New Member
Join Date: Apr 2012
Posts: 19
Rep Power: 14 |
Hi,
I'm using pisoFoam solver and I added energy equation to it. But when I run it at first time step "time stem continuity error" is appeared and in the following time step, my Courant number increases. Do you have any idea why it happens? or how I can find the cell which causes the problem ? Maryam |
|
June 16, 2012, 01:28 |
|
#2 |
Senior Member
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 17 |
Dear Maryam
you should use adjustabletimestep to limit your Co number. and I suggest you to use pimpleFoam instead of pisoFoam. it works more stable than pisoFoam. |
|
June 16, 2012, 02:19 |
|
#3 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
some general advices:
1)put your initial time step at 1e-08 2) use " adjustabletimestep to limit your Co number" if you again encounter problem, 3) check your BC |
|
June 19, 2012, 09:57 |
|
#4 |
New Member
Join Date: Apr 2012
Posts: 19
Rep Power: 14 |
Thanks guys for your help. It works.
I'm trying to add energy equation to pisoFoam and I followed http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam When the code is running, it shows me residual for T, but in my results, T is constant. Do you have any idea? |
|
June 19, 2012, 13:01 |
|
#6 |
New Member
Join Date: Apr 2012
Posts: 19
Rep Power: 14 |
I have two cylinders inside each other, which fluid flows between cylinders. The inner one has constant heat (fixedGradient) and the outer one is zeroGradient. fixedValue for inlet and zeroGradient for outlet.
|
|
June 19, 2012, 13:22 |
|
#8 |
New Member
Join Date: Apr 2012
Posts: 19
Rep Power: 14 |
It shows solving, but in any time step, T file shows constant temperature.
|
|
June 19, 2012, 13:47 |
|
#10 |
New Member
Join Date: Apr 2012
Posts: 19
Rep Power: 14 |
Thanks for following up.
I added T field in creatField.H. and #include "fvCFD.H" #include "MysinglePhaseTransportModel.H" #include "turbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // int main(int argc, char *argv[]) { #include "setRootCase.H" #include "createTime.H" #include "createMesh.H" #include "createFields.H" #include "initContinuityErrs.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // Info<< "\nStarting time loop\n" << endl; while (runTime.loop()) { Info<< "Time = " << runTime.timeName() << nl << endl; #include "readPISOControls.H" #include "CourantNo.H" // Pressure-velocity PISO corrector { // Momentum predictor fvVectorMatrix UEqn ( fvm::ddt(U) + fvm::div(phi, U) + turbulence->divDevReff(U) ); UEqn.relax(); if (momentumPredictor) { solve(UEqn == -fvc::grad(p)); } // --- PISO loop for (int corr=0; corr<nCorr; corr++) { volScalarField rAU(1.0/UEqn.A()); U = rAU*UEqn.H(); phi = (fvc::interpolate(U) & mesh.Sf()) + fvc::ddtPhiCorr(rAU, U, phi); adjustPhi(phi, U, p ,T); // Non-orthogonal pressure corrector loop for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++) { // Pressure corrector fvScalarMatrix pEqn ( fvm::laplacian(rAU, p) == fvc::div(phi) ); pEqn.setReference(pRefCell, pRefValue); if ( corr == nCorr-1 && nonOrth == nNonOrthCorr ) { pEqn.solve(mesh.solver("pFinal")); } else { pEqn.solve(); } if (nonOrth == nNonOrthCorr) { phi -= pEqn.flux(); } } #include "continuityErrs.H" U -= rAU*fvc::grad(p); U.correctBoundaryConditions(); //add these lines... fvScalarMatrix TEqn ( fvm::ddt(T) + fvm::div(U, T) == fvm::laplacian(DT, T) ); TEqn.solve(); } } //done adding lines... turbulence->correct(); runTime.write(); Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" << " ClockTime = " << runTime.elapsedClockTime() << " s" << nl << endl; } Info<< "End\n" << endl; return 0; } |
|
June 19, 2012, 14:09 |
|
#12 |
New Member
Join Date: Apr 2012
Posts: 19
Rep Power: 14 |
Thanks for checking the code. I have same problem with "phi" also. At first I used "phi" then I changed it to "U"
|
|
June 19, 2012, 14:45 |
|
#13 |
Senior Member
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,267
Blog Entries: 1
Rep Power: 25 |
adjustPhi(phi, U, p ,T); ???????
i think this is wrong too! whats the role of p or T ? and if it was ok ! then change your BC , put two fixed BC for example one at 200 and the other in 500 with no inlet-out, and look whether it works at all! |
|
July 10, 2012, 12:12 |
|
#14 |
Senior Member
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15 |
Hi Everybody
Today I started looking at foam again . in pisofoam there is line "Mesh.solver" . Could any body tell to me what is that? Best Mahdi |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Transient simulation not converging | skabilan | OpenFOAM Running, Solving & CFD | 14 | December 17, 2019 00:12 |
InterFoam negative alpha | karasa03 | OpenFOAM | 7 | December 12, 2013 04:41 |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 19:44 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |