CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Local time step (https://www.cfd-online.com/Forums/openfoam-solving/89552-local-time-step.html)

ramhari June 16, 2011 02:23

Local time step
 
I want to use local time steps to converge to steady state quickly. I have fixed the maxCo and want to calculate deltaT for each cell (local time step). My Openfoam rho (for e.g.) equation reads :

rho = rho - runTime.deltaT()*fvc::div(phi); ......

I checked setDelta.H, compressibleCourantNo.H which tells runTime.deltaT() as a scalar.

But I want a runtime.deltaT() as volScalarField which has delta time defined for each cell.

Can anyone help me in this regard :confused:

marupio June 16, 2011 11:10

The runTime scalar is used in the fvc and fvm namespaces in the discretization process. If you want to have any of these functions work with the local time, then you are looking at a complex problem. If, on the other hand, you just want to store a "local time" field that you use independently, that would be much easier. How do you plan to use the local time?

ramhari June 16, 2011 14:16

" If, on the other hand, you just want to store a "local time" field that you use independently, that would be much easier"

Exactly the second one. A false time field just to update rho,rhoU and rhoE For e.g.

rho = rho - runTime.deltaT()*fvc::div(phi)
rhoU = rhoU - ...
rhoE = rhoE - ...


runTime.deltaT() is very local (or which only plays around setDelta.H, readTimecontrols.H and compressibleCourantNumber.H) and nothing to do with ddt schemes I specify. (whatever ddtscheme in the fvSchemesDict)


& Hopefully, I didn't confuse you

Thanks, hari

deepsterblue June 16, 2011 14:43

Take a look at the SLTSDdtScheme in $(FOAM_SRC)/finiteVolume/ddtSchemes/SLTSDdtScheme

akidess June 17, 2011 04:02

Also, the just released new version of OpenFoam uses a local time step for their new VOF solver:

http://www.openfoam.com/version2.0.0/steady-vof.php

You might want to have a look at that.

ramhari July 6, 2011 09:37

Dear all,

( Please check the previous posts in this thread to have an idea)

I have slightly modified the inviscid solver rhoCentralFoam in order to improve the acceleration to steady state using local time step without touching any other part (e.g. reconstruct(). - flux calculations). And it seems working for my case.

If anyone have a word/doubt in my modification please post it.

//////////Local time step - false time step
forAll (mesh.C(),i)
{
cell faces = mesh.cells()[i];
denom = 0.0;
forAll (faces,j)
{
denom = denom + ( (U[i] & mesh.Sf()[j]) + c[i]*mesh.magSf()[j] );
}
falseTime[i] = maxCo * mesh.V()[i] / denom;
}


//////// Conservation equations
// --- Solve density
rho = rho - falseTime*fvc::div(phi);

// --- Solve momentum
rhoU = rhoU - falseTime*fvc::div(phiUp);

// --- Solve energy
rhoE = rhoE - falseTime*fvc::div(phiEp);

eric.m.tridas January 9, 2012 13:49

Has anyone else done this? I'm really interested in speeding up my rhoCentralFoam simulations but am having some trouble implementing it. I'd really appreciate the help anyone else can give!

Thanks,

-Eric

ehsan March 25, 2012 11:19

Dear all

I need a reference which describes by more details the new local-time stepping (LTS) approach applied in VOF in openfoam.

Thanks

mm.abdollahzadeh October 7, 2012 12:23

Quote:

Originally Posted by ramhari (Post 314930)
Dear all,

( Please check the previous posts in this thread to have an idea)

I have slightly modified the inviscid solver rhoCentralFoam in order to improve the acceleration to steady state using local time step without touching any other part (e.g. reconstruct(). - flux calculations). And it seems working for my case.

If anyone have a word/doubt in my modification please post it.

//////////Local time step - false time step
forAll (mesh.C(),i)
{
cell faces = mesh.cells()[i];
denom = 0.0;
forAll (faces,j)
{
denom = denom + ( (U[i] & mesh.Sf()[j]) + c[i]*mesh.magSf()[j] );
}
falseTime[i] = maxCo * mesh.V()[i] / denom;
}


//////// Conservation equations
// --- Solve density
rho = rho - falseTime*fvc::div(phi);

// --- Solve momentum
rhoU = rhoU - falseTime*fvc::div(phiUp);

// --- Solve energy
rhoE = rhoE - falseTime*fvc::div(phiEp);


Dear Friend

There is one question:

the falsetime that you are calculating is the local deltaT. so its changing from cell to cell.
so its almost the same as the local euler or coeuler scheme in openfoam?

secondly this scheme is not giving unsteady result. just the final result could be correct?

How can u access the simulationtime? how you will control writting the variables according the controldict writecontrol ( considering that u have local time )

Best
Mahdi

Pravin Kadu September 27, 2015 12:24

Dear friend,
Can you please provide the 'local time stepping' related theory.
Because I am not getting that how the cells will have different time steps, since they would be interdependent?

Thanks.


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