CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   Adaptive timestepping (http://www.cfd-online.com/Forums/openfoam/78857-adaptive-timestepping.html)

Jochem August 4, 2010 03:51

Adaptive timestepping
 
Hi,

I've read a lot about time stepping on this forum. I've followed the steps from the discussion, ( http://www.cfd-online.com/Forums/ope...estepping.html ) stil there is something going wrong.

I want to use this adaptive timestepping in the simpleFoam solver. I've included the 3 files (readTimeControls.H, CourantNo.H and setDeltaT.H) in the solver and 2 files( CourantNo.H and setDeltaT.H ) in the time loop.

When I then give the command "wmake", the following error appears :

cpp: Internal error: Floating point exception (program cc1)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [linux64GccDPOpt/options] Error 1
cpp: Internal error: Floating point exception (program cc1)
Please submit a full bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [linux64GccDPOpt/files] Error 1
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created


For clarity I also post the simpleFoam.C file :

#include "fvCFD.H"
#include "singlePhaseTransportModel.H"
#include "RASModel.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

int main(int argc, char *argv[])
{
#include "setRootCase.H"
#include "createTime.H"
#include "createMesh.H"
#include "createFields.H"
#include "initContinuityErrs.H"
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

Info<< "\nStarting time loop\n" << endl;


while (runTime.run())
{
Info<< "Time = " << runTime.timeName() << nl << endl;

#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
#include "CourantNo.H"
#include "setDeltaT.H"

runTime++;

p.storePrevIter();

// Pressure-velocity SIMPLE corrector
{
#include "UEqn.H"
#include "pEqn.H"
}

turbulence->correct();

runTime.write();

Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
<< nl << endl;

#include "convergenceCheck.H"
}

Info<< "End\n" << endl;

return 0;
}


Can someone tell my what i am doing wrong?

Regards,

Jochem

alberto August 8, 2010 21:38

Simply use pimpleFoam. The simpleFoam solver is for steady state calculations.

Best,

Jochem August 25, 2010 10:31

PimpleFoam Solver
 
Hi Alberto,

Sorry for the late reaction but i was abroad for 2 weeks. I've been trying to adjust the pimpleFoam tutorial to my case but i've experienced some problems.

I've now been able to run a case but the solver doesn't calculate the wind velocity and this is the main purpose of my simulation. I've tried to "include initial conditions" in 0/epsilon and 0/nuTilda but still this does not seems to work.

Maybe there is something wrong with my fvSchemes or fvSolution. This files look like this :

- fvSchemes


ddtSchemes
{
default Euler;
}

gradSchemes
{
default Gauss linear;
grad(p) Gauss linear;
grad(U) Gauss linear;
}

divSchemes
{
default none;
div(phi,U) Gauss linearUpwindV Gauss linear;;
div(phi,k) Gauss upwind;;
div(phi,omega) Gauss upwind;
div(phi,epsilon)Gauss limitedLinear 1;
div(phi,R) Gauss limitedLinear 1;
div(R) Gauss linear;
div(phi,nuTilda) Gauss limitedLinear 1;
div((nuEff*dev(grad(U).T()))) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
interpolate(U) linear;
}

snGradSchemes
{
default corrected;
}

fluxRequired
{
default no;
p ;
}


- fvSolution

solvers
{
p
{
solver GAMG;
tolerance 1e-06;
relTol 0.01;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}

pFinal
{
solver GAMG;
tolerance 1e-06;
relTol 0;
smoother GaussSeidel;
cacheAgglomeration true;
nCellsInCoarsestLevel 10;
agglomerator faceAreaPair;
mergeLevels 1;
}

U
{
solver smoothSolver;
smoother GaussSeidel;
tolerance 1e-8;
relTol 0.1;
nSweeps 1;
}

UFinal
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}

k
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}

epsilon
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0;
}
omega
{
solver PBiCG;
preconditioner DILU;
tolerance 1e-05;
relTol 0.1;
};

}

PIMPLE
{
nOuterCorrectors 2;
nCorrectors 2;
nNonOrthogonalCorrectors 0;
pRefCell 0;
pRefValue 0;
}

relaxationFactors
{
U 1;
k 1;
epsilon 1;
}




Can u help me solve this problem?

Regards,

Jochem

alberto August 25, 2010 10:40

Quote:

Originally Posted by Jochem (Post 272696)
Hi Alberto,

Sorry for the late reaction but i was abroad for 2 weeks. I've been trying to adjust the pimpleFoam tutorial to my case but i've experienced some problems.

I've now been able to run a case but the solver doesn't calculate the wind velocity and this is the main purpose of my simulation. I've tried to "include initial conditions" in 0/epsilon and 0/nuTilda but still this does not seems to work.

Could you provide a description of the problem you are trying to solve?

Best,

Jochem August 26, 2010 03:11

Hi Alberto,

I am trying to simulate the airflow past the different building of our campus.
I have added a triSurface in the constant-directory, because I am working with an .stl file of our campus.

I have used one inlet and one outlet. I've been abled to run the case, but in every timestep I see omega and k changing but Ux,Uy,UZ stays zero. Altough i've included 'initial conditions' in the U file in the 0-directory and give an input of 3 m/s in the initial conditions file.

Regards,

Jochem

alberto August 26, 2010 14:40

Is the equation for U solved during the iterations?

Do you specify a value of U at the inlet? Or simply patch the initial condition?

Best,

Jochem August 27, 2010 04:08

Problem solved
 
Alberto,

Thanks for the tip. I think I now know what the problem was. Indeed I've patched the "initial conditions" in the U-file. The problem was that I run the case in parallel.

So the case was divided into 6 processors and OpenFoam didn't copy the hole 0-directory. The "initial conditions" file wasn't in the 0-directory of every processor. I've copied this file and pasted in every processor*/0-directory and the problem was solved.

Thanks a lot for the help,

Regards,

Jochem


All times are GMT -4. The time now is 18:24.