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

localEuler in rhoCentralFoam

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 1 Post By praveen
  • 1 Post By laurensvd

Reply
 
LinkBack Thread Tools Display Modes
Old   August 3, 2011, 05:49
Default localEuler in rhoCentralFoam
  #1
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 236
Blog Entries: 6
Rep Power: 8
praveen is on a distinguished road
In order to do steady state calculations with rhoCentralFoam, I am trying to use localEuler ddt scheme. From what I understood, this requires specifying rDeltaT as a volScalarField. I have made following additions to rhoCentralFoam in version 2.0.0

createField.H:
Code:
volScalarField rDeltaT
(
    IOobject
    (
        "rDeltaT",
        runTime.timeName(),
        mesh,
        IOobject::NO_READ,
        IOobject::AUTO_WRITE
    ),
    mesh,
    1/dimensionedScalar("maxDeltaT", dimTime, GREAT),
    zeroGradientFvPatchScalarField::typeName
);
setrDeltaT.H:
Code:
{       
        
    // Set the reciprocal time-step from the local Courant number
    rDeltaT.dimensionedInternalField() = max
    (   
        1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
        fvc::surfaceSum(amaxSf)().dimensionedInternalField()
       /(maxCo*mesh.V())
    );  

    // Update tho boundary values of the reciprocal time-step
    rDeltaT.correctBoundaryConditions();
        
}
rhoCentralFoam.C:
Code:
        surfaceScalarField aphiv_pos(phiv_pos - aSf);
        surfaceScalarField aphiv_neg(phiv_neg + aSf);

        // Reuse amaxSf for the maximum positive and negative fluxes
        // estimated by the central scheme
        amaxSf = max(mag(aphiv_pos), mag(aphiv_neg));

        #include "compressibleCourantNo.H"
        #include "readTimeControls.H"
        //#include "setDeltaT.H"
        #include "setrDeltaT.H"

        runTime++;

        Info<< "Time = " << runTime.timeName() << nl << endl;
Then in system/fvSchemes, I specify


Code:
ddtSchemes
{
    default         localEuler  rDeltaT;
}
The code compiles and runs but blows up after some iterations. With the usual rhoCentralFoam it runs fine, but it takes forever to converge. I use a maxCo of 0.1 and it is a subsonic flow. Limiters are also used (Gamma scheme). I could not find anything on localEuler in the forums so I want to know if anybody has succeeded in using it, or if you can find any mistake in my modifications.
mm.abdollahzadeh likes this.
praveen is offline   Reply With Quote

Old   September 10, 2011, 14:18
Default
  #2
New Member
 
Join Date: Aug 2010
Location: Chennai
Posts: 26
Rep Power: 5
ramhari is on a distinguished road
@praveen

Local time step

In the above thread, check my last post (which is working fine for me )...U may get some idea : )


Cheers!
Hariram
ramhari is offline   Reply With Quote

Old   January 9, 2012, 14:06
Default
  #3
Member
 
Eric M. Tridas
Join Date: May 2011
Location: Tampa, Florida
Posts: 41
Rep Power: 5
eric.m.tridas is on a distinguished road
Praveen,

Have you had any more success implementing the localEuler ddt scheme? I am very interested in this aspect as my simulations using rhoCentralFoam are take ages to compute.

Thanks,

-Eric
eric.m.tridas is offline   Reply With Quote

Old   February 23, 2012, 10:31
Default
  #4
Member
 
Laurens Van Dyck
Join Date: Jul 2011
Location: Netherlands/Germany
Posts: 34
Rep Power: 4
laurensvd is on a distinguished road
Im not sure if the poster is still following this but if you are, where did you get that definition for rDeltaT?

Code:
rDeltaT.dimensionedInternalField() = max 
(
            1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(amaxSf)().dimensionedInternalField()        /(maxCo*mesh.V())     
);
If you look at the compressible courant number definition it is formulated differently:
Code:
surfaceScalarField amaxSfbyDelta
    (
        mesh.surfaceInterpolation::deltaCoeffs()*amaxSf
    );

    CoNum = max(amaxSfbyDelta/mesh.magSf()).value()*runTime.deltaTValue();
I am trying to implement this latter equation to get rDeltaT but I am unable to get the syntax right to find the amaxSfbyDelta/mesh.magSf() for each cell. How can I find the maximum number of that value (which is I Presume calculated over the cell faces).
In other words, is there a command that finds the maximum surface value of a cell?

My current (not completely correct) implementation for rDeltaT is the following:
Quote:
// Set the reciprocal time-step from the local Courant number
surfaceScalarField amaxSfbyDelta
(
mesh.surfaceInterpolation::deltaCoeffs()*amaxSf
);


rDeltaT.dimensionedInternalField() = max
(
1/dimensionedScalar("maxDeltaT", dimTime, maxDeltaT),
fvc::surfaceSum(mag(amaxSfbyDelta/mesh.magSf()))/(2.0*maxCo)
);
Since I did not know how to find the maximum surface value of a cell I performed a surface sum of the magnitude and then divided it by 2 to get approximately the same effect as the initial definition of the compressible courant number.

When you look at the interFoamLTS source code you can also find how to implement smoothing over the rDeltaT field which you might consider implementing if you have big differences in timestep between neighboring cells.
mm.abdollahzadeh likes this.
laurensvd is offline   Reply With Quote

Old   October 21, 2012, 02:19
Default
  #5
Super Moderator
 
praveen's Avatar
 
Praveen. C
Join Date: Mar 2009
Location: Bangalore
Posts: 236
Blog Entries: 6
Rep Power: 8
praveen is on a distinguished road
Suppose \lambda_{ij} is maximum wave speed in the face normal direction across the face between cell i and cell j. Let \Delta s_{ij} be area of this face. Then time step in cell i should be

\Delta t_i \le \frac{V_i}{\sum_j \lambda_{ij} \Delta s_{ij}}

where the sum is over all face neighbouring cells of cell i.

Introducing a courant number maxCo, we get

\frac{1}{\Delta t_i} = \frac{\sum_j \lambda_{ij} \Delta s_{ij}}{maxCo * V_i}

The time step condition can be seen by applying first order upwind scheme to a scalar convection equation.
praveen is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rhoCentralFoam ramhari OpenFOAM Native Meshers: blockMesh 2 August 16, 2013 11:43
NACA0012 with rhoCentralFoam praveen OpenFOAM 16 July 11, 2013 08:29
rhoCentralFoam with totalPressure/totalTemperature at inlet of subsonic channel deepblue17 OpenFOAM Running, Solving & CFD 5 February 11, 2013 02:42
Hypersonic flow rhoCentralFoam ishaninair OpenFOAM Running, Solving & CFD 0 April 7, 2011 04:38
Always crash when solve a C-D nozzle flow field using rhoCentralFoam hawklion OpenFOAM Running, Solving & CFD 0 March 9, 2011 06:13


All times are GMT -4. The time now is 10:16.