CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

time step continiuty error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 15, 2012, 16:23
Default time step continiuty error
  #1
New Member
 
Join Date: Apr 2012
Posts: 19
Rep Power: 14
MultiphaseFlowsLab is on a distinguished road
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
MultiphaseFlowsLab is offline   Reply With Quote

Old   June 16, 2012, 00:28
Default
  #2
Senior Member
 
niaz's Avatar
 
A_R
Join Date: Jun 2009
Posts: 122
Rep Power: 16
niaz is on a distinguished road
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.
niaz is offline   Reply With Quote

Old   June 16, 2012, 01:19
Default
  #3
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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
nimasam is offline   Reply With Quote

Old   June 19, 2012, 08:57
Default
  #4
New Member
 
Join Date: Apr 2012
Posts: 19
Rep Power: 14
MultiphaseFlowsLab is on a distinguished road
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?
MultiphaseFlowsLab is offline   Reply With Quote

Old   June 19, 2012, 11:48
Default
  #5
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
whats your BC?
nimasam is offline   Reply With Quote

Old   June 19, 2012, 12:01
Default
  #6
New Member
 
Join Date: Apr 2012
Posts: 19
Rep Power: 14
MultiphaseFlowsLab is on a distinguished road
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.
MultiphaseFlowsLab is offline   Reply With Quote

Old   June 19, 2012, 12:15
Default
  #7
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
it's weird does it solve for T at all ?
compare your code with code in heat transfer folder, you will find how to add energy equation
nimasam is offline   Reply With Quote

Old   June 19, 2012, 12:22
Default
  #8
New Member
 
Join Date: Apr 2012
Posts: 19
Rep Power: 14
MultiphaseFlowsLab is on a distinguished road
It shows solving, but in any time step, T file shows constant temperature.
MultiphaseFlowsLab is offline   Reply With Quote

Old   June 19, 2012, 12:37
Default
  #9
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
put your code here
nimasam is offline   Reply With Quote

Old   June 19, 2012, 12:47
Default
  #10
New Member
 
Join Date: Apr 2012
Posts: 19
Rep Power: 14
MultiphaseFlowsLab is on a distinguished road
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;
}
MultiphaseFlowsLab is offline   Reply With Quote

Old   June 19, 2012, 13:00
Default
  #11
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
replace it
fvm::ddt(T)
+ fvm::div(U, T) == fvm::laplacian(DT, T)
with
fvm::ddt(T)
+fvm::div(phi, T) == fvm::laplacian(DT, T)
nimasam is offline   Reply With Quote

Old   June 19, 2012, 13:09
Default
  #12
New Member
 
Join Date: Apr 2012
Posts: 19
Rep Power: 14
MultiphaseFlowsLab is on a distinguished road
Thanks for checking the code. I have same problem with "phi" also. At first I used "phi" then I changed it to "U"
MultiphaseFlowsLab is offline   Reply With Quote

Old   June 19, 2012, 13:45
Default
  #13
Senior Member
 
Nima Samkhaniani
Join Date: Sep 2009
Location: Tehran, Iran
Posts: 1,266
Blog Entries: 1
Rep Power: 24
nimasam is on a distinguished road
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!
nimasam is offline   Reply With Quote

Old   July 10, 2012, 11:12
Default
  #14
Senior Member
 
mahdi abdollahzadeh
Join Date: Mar 2011
Location: Covilha,Portugal
Posts: 153
Rep Power: 15
mm.abdollahzadeh is on a distinguished road
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
mm.abdollahzadeh is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Transient simulation not converging skabilan OpenFOAM Running, Solving & CFD 14 December 16, 2019 23:12
InterFoam negative alpha karasa03 OpenFOAM 7 December 12, 2013 03:41
How to install CGNS under windows xp? lzgwhy Main CFD Forum 1 January 11, 2011 18:44
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 19:08
error while compiling the USER Sub routine CFD user CFX 3 November 25, 2002 15:16


All times are GMT -4. The time now is 01:09.