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

steady state version of twophaseeulerfoam

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes
  • 2 Post By alberto
  • 2 Post By alberto
  • 1 Post By geth03

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 11, 2011, 17:59
Default steady state version of twophaseeulerfoam
  #1
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 15
miles_davis is on a distinguished road
Hi,

I am using the twophaseeeulerfoam solver to simulate air bubbles in water.
I want to have a steady state version of the solver.

Solution1
According to what I have read, I should first try to under-relax the resolution and raise the time step.
I do not understand why? In fact I do not understand the role of under-relaxtion factor in an unsteady solver.
Does anyone have a point on the subject or some documentation of the relaxation process in Openfoam (and in general, reading is never bad!)? This could help me to understand.

Solution2
On the other hand if I want to change the solver to be steady witch library I was thinking to do so
- Remove time dependence in the solver
- Change the vel-press scheme (I was thinking using simple scheme)
- Modify the fvsol and fvscheme dict.
Does this seem correct?
Does this seem an affordable task for an OF newbee?

Thanks for your opinions and help.

Regards,
miles_davis is offline   Reply With Quote

Old   October 13, 2011, 14:13
Default
  #2
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 15
miles_davis is on a distinguished road
Hi

I have tried the first solution but it seems that putting a subdict for relaxation at the end of fvSolution has no effect.
I am not sure if it is taken into account.

So I switched to the coding of a steady twophaseeluerfoam solver.
I am tryning to understand how the solver is coded.


I have a few questions and my sorry in advance if it seems to easy but my C++ is very bad.
1.fvVectorMatrix UbEqn(Ub, Ub.dimensions()*dimVol/dimTime)
Is it possible to modify the definition of fvVectorMatrix like that:
fvVectorMatrix UbEqn(Ub, Ub.dimensions())


  1. volScalarField rUaA(1.0/UaEqn.A())
I do not understand what is done here.
What is the definition and the purpose of rUaA and UaEqn.A() ?
Is this related to the first guess on momentum equation in the PIMPLE algorithm?


  1. Ua = rUaA*UaEqn.H()
Same question for UaEqn.H()


4. DDTU.h
What is the purpose of having a special file for the equation on UA and UB?
Can it be included in my SIMPLE loop -since I will move the scheme from pimple to simple.


Thanks for any help.


Regards,
miles_davis is offline   Reply With Quote

Old   October 13, 2011, 14:21
Default
  #3
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 15
miles_davis is on a distinguished road
for the moderator: I have placed this thread in a more apropriate forum. But i did not manage to delete it.
Sorry for that.

regards
miles_davis is offline   Reply With Quote

Old   October 14, 2011, 21:50
Default
  #4
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by miles_davis View Post
Hi,

I am using the twophaseeeulerfoam solver to simulate air bubbles in water.
I want to have a steady state version of the solver.
Two-phase flows are intrinsically unsteady. In most of the cases a steady state solution does not exist, and you would end up with a wrong result.

In OpenFOAM 2.0.x, the PIMPLE algorithm is used in twoPhaseEulerFoam. If you really have a steady-state in your system, relaxing and increasing the time step should work.

First however you have to answer the question "does a steady state exist?". If the answer is "no", the only solution is to perform the simulation dynamically, and average over time.

Best,
BlnPhoenix and granzer like this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   October 15, 2011, 20:49
Default
  #5
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 15
miles_davis is on a distinguished road
Hi,
Thanks for your help as usual !
I agree with you on the difficulty to consider a real steady state in a multiphase flow.
Nevertheless, I know the system I want to simulate has already been simulated on FLUENT with the steady state euler/euler solver.
Concerning the possibility of including under relaxation to increase my timestep I have two questions please:
1. My actual time step is 0.0002s. What can I expect with underrelaxation? To multiply the timestepd by 2 or 5 or more? I know this question may seem silly.
2. Can you please give me an example of the subdict I need to ad in fvScheme dict. I have tried it before but I think my syntax was bad.
Thanks a lot for you help.

Miles

P.S.: I do not understand the role of underrelaxation in a unsteady simulation… It’s a bit confusing.
miles_davis is offline   Reply With Quote

Old   October 15, 2011, 20:58
Default
  #6
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by miles_davis View Post
Hi,
Thanks for your help as usual !
I agree with you on the difficulty to consider a real steady state in a multiphase flow.
Nevertheless, I know the system I want to simulate has already been simulated on FLUENT with the steady state euler/euler solver.


It this the case of the air injection in liquid?

Quote:
Concerning the possibility of including under relaxation to increase my timestep I have two questions please:
1. My actual time step is 0.0002s. What can I expect with underrelaxation? To multiply the timestepd by 2 or 5 or more? I know this question may seem silly.


It depends on the system. I would say the rule of thumb is "as much as it is possible without having instabilities". The multi-fluid equations are a pain to solve due to their mathematical nature. Steady-state solvers rely on a set of tricks to stabilize the solution (local relaxation, heavy global relaxation, ...).

2.
Quote:
Can you please give me an example of the subdict I need to ad in fvScheme dict. I have tried it before but I think my syntax was bad.


Code:
relaxationFactors
{
    Ua              0.7;
    Ub              0.7;
    p                0.3;
    alpha          0.2;
    Theta         0.2;
    k                0.4;
    epsilon        0.4;
}
Quote:
P.S.: I do not understand the role of underrelaxation in a unsteady simulation… It’s a bit confusing.


It is exactly the same as in the steady-state one: it slows down the changes in the solution while you iterate to find the converged solution for that time-step. To have time accuracy you should not relax at the last iteration (OF takes care of this).

Best,
BlnPhoenix and granzer like this.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   October 16, 2011, 14:38
Default
  #7
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 15
miles_davis is on a distinguished road
Hi,

This is indeed the case of the air injected in the water box I have posted earlier.
A question about the relaxation script you have posted (thanks for that BTW):
Do I have to put the script inside the PIMPLE subdict
i.e
Code:
PIMPLE
{....
relaxationFactors 
{
Ua 0.7; 
Ub 0.7; 
p 0.3; 
alpha 0.2; 
}
}
Or in a separated subdict i.e.
Code:
PIMPLE
{
…
}
relaxationFactors 
{
Ua 0.7; 
Ub 0.7; 
p 0.3; 
alpha 0.2; 
}
Thanks again.

Sydney
miles_davis is offline   Reply With Quote

Old   October 16, 2011, 21:10
Default
  #8
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Second choice :-)
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   October 17, 2011, 04:21
Default
  #9
Member
 
Miles
Join Date: Sep 2011
Posts: 48
Rep Power: 15
miles_davis is on a distinguished road
Thanks alberto.
The strange thing is I did not get any error message with the first syntax!

Anyway I have tried the to under-relax. I am still not abble to raise the time step. I still cannot go further than 0.001s.

My fv scheme and fvsolutions look like this.
If you have the kindness to tell me if they seem correct to you I would appreciate.

Thanks for your help anyway.

Miles

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.01;
        smoother        DIC;
        nPreSweeps      0;
        nPostSweeps     2;
        nFinestSweeps   2;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

    pFinal
    {
        $p;
        tolerance       1e-08;
        relTol          0;
    }

    "(k|epsilon)"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-05;
        relTol          0.1;
    }

    "(k|epsilon)Final"
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-05;
        relTol          0;
    }

    alpha
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-10;
        relTol          0.1;
    }

    alphaFinal
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance       1e-10;
        relTol          0;
    }
}

PIMPLE
{
    nCorrectors     2;
    nNonOrthogonalCorrectors 4;
    nAlphaCorr      2;
    correctAlpha    yes;
/*pRefPoint (0.0 0.0 0);
pRefValue 20000;*/
}

relaxationFactors
{
   Ua              0.1;
   Ub              0.1;
   p                0.1;
   alpha          0.1;
   Theta         0.1;
   k                0.1;
   epsilon        0.1;
}

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

Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.0.1                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
    div(phia,Ua)    Gauss limitedLinearV 1;
    div(phib,Ub)    Gauss limitedLinearV 1;
    div(phib,k)     Gauss limitedLinear 1;
    div(phib,epsilon) Gauss limitedLinear 1;
    div(phi,alpha)  Gauss limitedLinear01 1;
    div(phir,alpha) Gauss limitedLinear01 1;
    div(phi,Theta)  Gauss limitedLinear 1;
    div(Rca)        Gauss linear;
    div(Rcb)        Gauss linear;
}

laplacianSchemes
{
    default         none;
    laplacian(nuEffa,Ua) Gauss linear corrected;
    laplacian(nuEffb,Ub) Gauss linear corrected;
    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
    laplacian(alphaPpMag,alpha) Gauss linear corrected;
    laplacian(Galphaf,alpha) Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
    laplacian(kappa,Theta) Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p               ;
}


// ************************************************************************* //
miles_davis is offline   Reply With Quote

Old   October 24, 2011, 10:25
Default
  #10
Senior Member
 
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16
Aurelien Thinat is on a distinguished road
Hi Miles,

Your time step will always be bounded by the max courant number in your domain : the faster the bubbles are, the smaller your timestep will be (on a same mesh). You can try to change the grid if you want to get a higher time step.
Aurelien Thinat is offline   Reply With Quote

Old   October 26, 2011, 12:07
Default
  #11
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Quote:
Originally Posted by Aurelien Thinat View Post
Hi Miles,

Your time step will always be bounded by the max courant number in your domain : the faster the bubbles are, the smaller your timestep will be (on a same mesh). You can try to change the grid if you want to get a higher time step.
Well, in theory this is not true, since he is using an implicit method, and an iterative method with sub-iterations. However there are other limiting factors, like the time-scale of the momentum transfer between the phases, for example, which will keep the time step small.

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   October 26, 2011, 12:20
Default
  #12
Senior Member
 
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16
Aurelien Thinat is on a distinguished road
Hi Alberto,

I was looking at bubbleFoam and on the few tests I ran, I had to decrease the time step to keep the courant number under ~0,4.
With any higher value, I got some crashs : (

Aurélien
Aurelien Thinat is offline   Reply With Quote

Old   October 26, 2011, 12:38
Default
  #13
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
What Courant number was controlling the time-step? One of the phases or the one depending on Ur?

Best,
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   October 27, 2011, 05:08
Default
  #14
Senior Member
 
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16
Aurelien Thinat is on a distinguished road
I am talking about the "Max Ur Courant Number". The "Courant Number mean" value is 10 times less than the Ur based one (at least on my case).
Aurelien Thinat is offline   Reply With Quote

Old   October 27, 2011, 15:27
Default
  #15
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,912
Rep Power: 36
alberto will become famous soon enoughalberto will become famous soon enough
Yes, that's usually the problem. I implemented the Partial Elimination Algorithm (PEA) of Spalding to fix that, and it improves things quite a bit.
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as in both physical and virtual formats (current status: http://albertopassalacqua.com/?p=1541)
OpenQBMM - An open-source implementation of quadrature-based moment methods.

To obtain more accurate answers, please specify the version of OpenFOAM you are using.
alberto is offline   Reply With Quote

Old   November 2, 2011, 04:28
Default
  #16
Senior Member
 
Aurelien Thinat
Join Date: Jul 2010
Posts: 165
Rep Power: 16
Aurelien Thinat is on a distinguished road
Hi Alberto,

Sorry to ask you that on this thread.

I'm trying to add a source term for the dispersed phase equation in bubbleFoam (or twoPhaseEulerFoam) and I have a problem with my pressure equation. I don't understand how the code is handling the surface projection of the continuity equation to get the pressure equation.

I have already opened a thread at this URL :
http://www.cfd-online.com/Forums/ope...tml#post329169

If you have few time for some help, it would be really welcome.

Thank you.
Aurelien Thinat is offline   Reply With Quote

Old   February 6, 2019, 17:26
Default Converting twoPhaseEulerFoam into steady state solver using fvSchemes
  #17
Member
 
Join Date: Apr 2016
Posts: 30
Rep Power: 10
shanvach is on a distinguished road
Hi all,

I have been following this thread and I would like to ask if there is another way to convert twoPhaseEulerFoam into a steady state solver. fvSchemes has a option called ddt schemes.
Code:
ddtSchemes
{
    default         steadyState;
}
Using steadyState as a ddt scheme basically mean that the ddt term in the equations is zero. In that situation how are the rest of the terms of the equations calculated and would that constitute a steady state solver or can certain additions be done to make it a steady state solver?

Thanks and Regards,
Shantanu
shanvach is offline   Reply With Quote

Old   March 31, 2020, 06:36
Default
  #18
Senior Member
 
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 367
Rep Power: 8
geth03 is on a distinguished road
from my understanding those multiphase solvers use the transient PIMPLE solver. before running a simulation the solver will check controlDict if PIMPLE is defined, otherwise it won't work. defining a steadyState scheme for ddtSchemes won't help much i guess. At least it didn't work for me.
granzer likes this.
geth03 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
Time step dependence of convergence behavior of steady state simulations in CFX Chander Main CFD Forum 5 December 23, 2013 06:31
Constant velocity of the material Sas CFX 15 July 13, 2010 09:56
steady state, laminar vof_model Garima Chaudhary FLUENT 0 May 24, 2007 04:11
About the difference between steady and unsteady problems Lisa Main CFD Forum 11 July 5, 2000 15:37
Steady state formulation of turbulence ?? Jitendra Main CFD Forum 1 June 27, 2000 19:49


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