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

how to modify fvScheme to converge?

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

Like Tree4Likes
  • 2 Post By Traib
  • 2 Post By mturcios777

Reply
 
LinkBack Thread Tools Display Modes
Old   January 8, 2013, 10:41
Default how to modify fvScheme to converge?
  #1
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
hi
if i want to obtain more stability for not to diverge what modifications is better to perform on fvSchemes and what schemes is better to change?
my fvscheme is such:
Code:
fluxScheme      Kurganov;

ddtSchemes
{
    default         none;
    ddt(rho)        Euler;
    ddt(rhoU)       Euler;
    ddt(rhoE)       Euler;
    ddt(rho,U)      Euler;
    ddt(rho,e)      Euler; 
    ddt(rho,omega)  Euler;
    ddt(rho,k)      Euler;
}

gradSchemes
{
    default         none;
    grad(U) Gauss linear;
    grad(rho) Gauss linear;
    grad(rhoU) Gauss linear;
    grad((1|psi)) Gauss linear;
    grad(e) Gauss linear;
    grad(sqrt(((Cp|Cv)*(1|psi)))) Gauss linear;
    grad(c) Gauss linear;// grad(c) Gauss linear;
    grad(T) Gauss linear;
    grad(omega) Gauss linear;
    grad(k) Gauss linear; 
}

divSchemes
{
    default none;
    div(tauMC) Gauss linear;

    div(phi) Gauss linear;
    div(phi,omega) Gauss linear;
    div(phi,k) Gauss linear;
    div(phiEp) Gauss linaer;//div(phiEp) Gauss linaer;
    div(phiUp) Gauss linear;//div(phiUp) Gauss linear;
    div(sigmaDotU) Gauss linear;//div(sigmaDotU) Gauss linear;
}

laplacianSchemes
{
    default         none;
    laplacian(muEff,U) Gauss linear corrected;
    laplacian(alphaEff,e) Gauss linear corrected;
    laplacian(alpha,e) Gauss linear corrected;
    laplacian(k,T) Gauss linear corrected;
    laplacian(DepsilonEff,omega) Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DomegaEff,omega) Gauss linear corrected;
}

interpolationSchemes
{
    default none;
    reconstruct(rho) vanLeer;
    reconstruct(U) vanLeerV;
    reconstruct(T) vanLeer;

    interpolate(rho) linear;
    interpolate(U) linear;
    interpolate(T) linear;//interpolate(T) linear;
    interpolate(e) linear;//interpolate(e) linear;
    interpolate(c) linear;//interpolate(c) linear;
    interpolate(rhoU) linear;
    interpolate(rPsi) linear;//interpolate(rPsi) linear;
    interpolate(muEff) linear;
    interpolate(tauMC) linear;
}

snGradSchemes
{
    default none;

    snGrad(U) corrected;

}


// ************************************************************************* //
immortality is offline   Reply With Quote

Old   January 8, 2013, 12:03
Default
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 629
Rep Power: 17
mturcios777 will become famous soon enough
It really depends on your solver, case, mesh and accuracy needs. In other words its unique to your case. What type of simulation are you running?
mturcios777 is offline   Reply With Quote

Old   January 8, 2013, 12:23
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
thanks.unsteady compressible one.
immortality is offline   Reply With Quote

Old   January 9, 2013, 04:24
Default
  #4
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
is upwind more stable?how to set it to fvScheme sentences?
immortality is offline   Reply With Quote

Old   January 9, 2013, 07:28
Default
  #5
New Member
 
Traib
Join Date: Sep 2012
Posts: 27
Rep Power: 3
Traib is on a distinguished road
Hi ehsan,

How is your work going?

Like Marco said, it depends largely on your particular problem. For compressible cases, linear interpolation schemes are not always applicable, while upwind schemes are generally good choices. For better convergence for scalars, you can use TVD schemes with a coefficient e.g. limitedLinear 1.0, limitedVanLeer 1.0, etc. Also, use relaxationFactors in fvSolution dictionary to control the values' changes.

That's the basic, but of course mostly depends on any particular case. Sometimes you need to make sure the courant number is not too low, and of course not too high. You can try schemes other than linear interpolation schemes in divergence schemes [especially those with flux 'phi'] as well as for interpolation schemes and see how it works.

Regards,
Traib
kiddmax and immortality like this.
Traib is offline   Reply With Quote

Old   January 9, 2013, 09:48
Default
  #6
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
hello dear friend Traib and thank you for your nice and complete reply.
I'm working on "Wave Rotor" simulation.imagine a tube with length of .069m and .004m in height.it is 2D a rectangle like shock tube.but the smaller sides are opening to environment so that each one gradually open from wall to that environment and then wall again and again to another environment.its an interesting simple device for increasing gas turbines efficiency.however if the errors end I can end my thesis!
when used limitedVanLeer this error showed,what may be the cause.did i use
it wrong?thank you very much dear Traib.

Create mesh for time = 0

Reading thermophysical properties

Selecting thermodynamics package ePsiThermo<pureMixture<constTransport<specieThermo <hConstThermo<perfectGas>>>>>
Reading field U



--> FOAM FATAL IO ERROR:
Unknown discretisation scheme limitedVanLeer

Valid schemes are :

59
(
Gamma
GammaV
LUST
MUSCL
MUSCLV
Minmod
MinmodV
OSPRE
OSPREV
Phi
QUICK
QUICKV
SFCD
SFCDV
SuperBee
SuperBeeV
UMIST
UMISTV
biLinearFit
blended
clippedLinear
cubic
cubicUpwindFit
downwind
filteredLinear
filteredLinear2
filteredLinear2V
filteredLinear3
filteredLinear3V
fixedBlended
limitWith
limitedCubic
limitedCubicV
limitedLinear
limitedLinearV
limiterBlended
linear
linearFit
linearPureUpwindFit
linearUpwind
linearUpwindV
localBlended
localMax
localMin
midPoint
outletStabilised
pointLinear
quadraticFit
quadraticLinearFit
quadraticLinearUpwindFit
quadraticUpwindFit
reverseLinear
skewCorrected
upwind
vanAlbada
vanAlbadaV
vanLeer
vanLeerV
weighted
)


file: /home/thesis/Desktop/WR_1/system/fvSchemes::interpolationSchemes::interpolate(rhoU) at line 84.

From function surfaceInterpolationScheme<Type>::New(const fvMesh&, Istream&)
in file /home/opencfd/OpenFOAM/OpenFOAM-2.1.0/src/finiteVolume/lnInclude/surfaceInterpolationScheme.C at line 82.

FOAM exiting
immortality is offline   Reply With Quote

Old   January 9, 2013, 09:53
Default
  #7
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
when I changed to limitedLinear 1.0 and limitedLinearV 1.0 an error again appeared.
Code:
fluxScheme      Kurganov;

ddtSchemes
{
    default         none;
    ddt(rho)        Euler;
    ddt(rhoU)       Euler;
    ddt(rhoE)       Euler;
    ddt(rho,U)      Euler;
    ddt(rho,e)      Euler; 
    ddt(rho,omega)  Euler;
    ddt(rho,k)      Euler;
}

gradSchemes
{
    default         none;
    grad(U) Gauss upwind;
    grad(rho) Gauss upwind;
    grad(rhoU) Gauss upwind;
    grad((1|psi)) Gauss upwind;
    grad(e) Gauss Gauss upwind;
    grad(sqrt(((Cp|Cv)*(1|psi)))) Gauss upwind;
   // grad(c) Gauss upwind;
    grad(T) Gauss upwind;
    grad(omega) Gauss upwind;
    grad(k) Gauss upwind; 
}

divSchemes
{
    default none;
    div(tauMC) Gauss upwind;

    div(phi) Gauss upwind;
    div(phi,omega) Gauss upwind;
    div(phi,k) Gauss upwind;
    //div(phiEp) Gauss upwind;
    //div(phiUp) Gauss upwind;
    //div(sigmaDotU) Gauss upwind;
}

laplacianSchemes
{
    default         none;
    laplacian(muEff,U) Gauss upwind;
    laplacian(alphaEff,e) Gauss upwind;
    laplacian(alpha,e) Gauss upwind;
    laplacian(k,T) Gauss upwind;
    laplacian(DepsilonEff,omega) Gauss upwind;
    laplacian(DkEff,k) Gauss upwind;
    laplacian(DomegaEff,omega) Gauss upwind;
}

interpolationSchemes
{
    default none;
    reconstruct(rho) limitedLinear 1.0;
    reconstruct(U) limitedLinearV 1.0;
    reconstruct(T) limitedLinear 1.0;
    interpolate(rho) limitedLinear 1.0;
    interpolate(U) limitedLinearV 1.0;
    interpolate(T) limitedLinear 1.0;
    //interpolate(e) limitedLinear 1.0;
    //interpolate(c) limitedLinear 1.0;
    interpolate(rhoU) limitedLinear 1.0;
    //interpolate(rPsi) limitedLinear 1.0;
    interpolate(muEff) limitedLinear 1.0;
    interpolate(tauMC) limitedLinear 1.0;
}

snGradSchemes
{
    default none;

    snGrad(U) corrected;

}
the error:

Code:
Selecting thermodynamics package ePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>>>>>
Reading field U



--> FOAM FATAL IO ERROR: 
wrong token type - expected word, found on line 83 the doubleScalar 1

file: /home/thesis/Desktop/WR_1/system/fvSchemes::interpolationSchemes::interpolate(rhoU) at line 83.

    From function operator>>(Istream&, word&)
    in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting
Thank you very much
immortality is offline   Reply With Quote

Old   January 9, 2013, 12:55
Default
  #8
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 629
Rep Power: 17
mturcios777 will become famous soon enough
Ehsan, these errors occur either because OpenFOAM does not recognize the scheme you have selected and is offering alternatives. Trying to select randomly from previous ones won't be of much use, so it is best to be systematic. It seems you are quite new to CFD in general and OpenFOAM in particular, which is fine. That just means you have to work a little harder to understand the underlying theory.

CFD Online has a list of good resources, including online courses in CFD
http://www.cfd-online.com/Links/educ...#onlinecourses
Traib and cts like this.
mturcios777 is offline   Reply With Quote

Old   January 9, 2013, 13:05
Default
  #9
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
thanks dear Marco.what are you meaning?! I just changed second order terms into first order upwind.please say more speciefic what terms are incorrect or could be better to change?change to what?I want more stability.
thank you very much taking your time.
immortality is offline   Reply With Quote

Old   January 10, 2013, 22:27
Default
  #10
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
any idea??!!
immortality is offline   Reply With Quote

Old   January 11, 2013, 13:56
Default
  #11
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 629
Rep Power: 17
mturcios777 will become famous soon enough
Unfortunately I can't advise you further as tuning your fvSchemes would require me to see your results over several runs, which I don't have time for and would be difficult through the forum. This is one of those areas where research and experience come into play. You'll have to do some reading; start here:

http://en.wikipedia.org/wiki/Numeric...tial_equations

Good luck!
mturcios777 is offline   Reply With Quote

Old   January 15, 2013, 11:29
Default
  #12
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
my fvScheme is as below.please anyone say to me what schemes is better to change (to upwind for example) for more stability.may case is unstedy and compressible and the solver is rhoPimpleFoam.its a tube with varying with time side boundary conditions.
thank you.
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         Euler;
}

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

divSchemes
{
    default         none;
    div(phi,U)      Gauss limitedLinearV 1;
    div(phid,p)     Gauss limitedLinear 1;
    div(phi,K)      Gauss linear;
    div(phi,h)      Gauss limitedLinear 1;
    div(phi,k)      Gauss limitedLinear 1;
    div(phi,epsilon) Gauss limitedLinear 1;
    div(phi,R)      Gauss limitedLinear 1;
    div(phi,omega)  Gauss limitedLinear 1;
    div((rho*R))    Gauss linear;
    div(R)          Gauss linear;
    div(U)          Gauss linear;
    div((muEff*dev2(T(grad(U))))) Gauss linear;
    div(tauMC)  Gauss linear;
}

laplacianSchemes
{
    default         none;
    laplacian(muEff,U) Gauss linear corrected;
    laplacian(mut,U) Gauss linear corrected;
    laplacian(DkEff,k) Gauss linear corrected;
    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
    laplacian(DREff,R) Gauss linear corrected;
    laplacian(DomegaEff,omega) Gauss linear corrected;
    laplacian((rho*(1|A(U))),p) Gauss linear corrected;
    laplacian(alphaEff,h) Gauss linear corrected;
    laplacian(k,T)   Gauss linear corrected;  
    laplacian(alpha,e) Gauss linear corrected;
    laplacian(alphaEff,e)  Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

fluxRequired
{
    default         no;
    p               ;
}

Last edited by immortality; January 15, 2013 at 12:30.
immortality is offline   Reply With Quote

Old   January 15, 2013, 12:15
Default
  #13
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 629
Rep Power: 17
mturcios777 will become famous soon enough
Ehsan, your CODE tags are not working properly. To see how they are supposed to work, select a portion of the post you want to enclose in code, then select the formatting button with a # symbol. The tooltip that should come up is "Wrap [CODE] tags around selected text". Right now it is not appearing properly.
mturcios777 is offline   Reply With Quote

Old   January 15, 2013, 18:16
Default
  #14
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
i corrected it.sorry.
immortality is offline   Reply With Quote

Old   January 16, 2013, 08:52
Default
  #15
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,167
Rep Power: 15
immortality is on a distinguished road
any hint or comment?please say it!
immortality is offline   Reply With Quote

Old   January 16, 2013, 13:06
Default
  #16
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 629
Rep Power: 17
mturcios777 will become famous soon enough
Ehsan, asking for replies does not mean you will receive them sooner. There are rules of etiquiette that should be followed. I know you are in a difficult situation, but by following good practice the chances of getting a good answer are greatly enhanced:

How to give enough info to get help

If you look into what the schemes available are (check the user guide section 4.4), you will be able to make better decisions about the type of schemes you should be choosing. However, you should make sure that it isn't your boundary conditions or initial conditions that are causing problems. It is very dependant on your case setup, mesh, and the physics you are simulating.

If you treat CFD like a black box, you will spend a lot of time frustrated at what seem like random errors and difficulties. Learn the underlying framework and things will make more sense.
mturcios777 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
how to set periodic boundary conditions Ganesh FLUENT 13 January 22, 2014 04:11
How to modify fvScheme automatically inside the code? matteoL OpenFOAM Running, Solving & CFD 2 July 27, 2011 18:31
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55
HELP !In relaxtion factor converge is taken or not MANOJ KUMAR FLUENT 5 September 22, 2005 04:16
Converge problem for multiphase flow Jen FLUENT 4 July 20, 2005 16:52


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