CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   no solution in second order schemes (http://www.cfd-online.com/Forums/openfoam-solving/116231-no-solution-second-order-schemes.html)

immortality April 15, 2013 12:42

no solution in second order schemes
 
my problem is running well by first order schemes like upwind but when change schemes to higher order like limitedLinear 1.0 it crashes.
the results seem fine so far should I necessarily have a run with second order to ensure accuracy or not?

hakonbar April 16, 2013 09:55

First order upwind schemes are very diffusive, and this added "numerical viscosity" can sometimes have a big impact on the solution. It's therefore highly recommended to use at least 2nd order upwind schemes. What matters, of course, is how close you get to matching your verification/validation data, so if that's satisfactory, then there's no need to go for higher order schemes.

If stability is an issue, you could try decreasing the relaxation factors for one or more of your flow variables. You could also try using the first order solution as an initial condition by switching to a second order scheme once your first order solution has converged.

immortality April 16, 2013 10:27

thank you Hakon.my case is unsteady compressible.so what are your advices?

fredo490 April 16, 2013 11:55

If you start with a upwind (first order), you can use a linearUpwind (second order). In some cases a linearUpwindV (second order) can be more robust because it is a pure upwind second order.

To use a linearUpwind, you need to give a gradient or a flux (to tell the scheme what is the direction of the flow).

it can be for example:
Code:

    div(phi,U)      Gauss upwind;
becomes
Code:

    div(phi,U)      Gauss linearUpwind grad(U);
if you want to use the leastSquare method for the grad scheme, you can also change:
Code:

    default        Gauss linear;
to become
Code:

    default        leastSquares;
or even:
Code:

    default        cellLimited  leastSquares;

fredo490 April 16, 2013 12:01

Ps. Take a look at the cases I've sent on my post:
http://www.cfd-online.com/Forums/ope...nt-work-3.html

I put my cases with all the schemes. You can look at this case to get an example.
http://www.fredo490.fr/public/rhoLTS...aca12-AOA4.zip

immortality May 22, 2013 10:37

Hi Heckman and others!
sorry for long delay,other necessary to solve problems occurred.
could you please help me with these subjects:
1)what does a "convection dominated" problem mean?mean when we call a flow simulation convective term dominated in return of diffusive dominated?
2)when a problem is called second order?mean what terms in fvSchemes at least be second order so that whole the numerical system be second order?is it sufficient to have div(phi,U) in second order scheme?
3)in rhoCentralFoam I haven't a div(phi,U),then how change it to second order schame?which terms should be changed?
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,h)      Euler;
    ddt(rho,omega)  Euler;
    ddt(rho,k)      Euler;
    ddt(rho,gas)    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((1|thermo:psi)) Gauss linear;
    grad(h) Gauss linear;
    grad(sqrt(((Cp|Cv)*(1|psi)))) Gauss linear;
    grad(sqrt(((Cp|Cv)*(1|thermo:psi)))) Gauss linear;
    grad(T) Gauss linear;
    grad(omega) Gauss linear;
    grad(k) Gauss linear;
    grad(gas) Gauss linear;
}

divSchemes
{
    default none;
    div(tauMC) Gauss linear;
    div(phi) Gauss upwind;
    div(phi,omega) Gauss upwind;
    div(phi,k) Gauss upwind;
    div(phi,gas) Gauss upwind;
}

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;
    laplacian(alphaEff,h) Gauss linear corrected;
    laplacian(muEff,gas) Gauss linear corrected;
}

interpolationSchemes
{
    default none;
    reconstruct(rho) vanLeer;
    reconstruct(U) vanLeerV;
    reconstruct(T) vanLeer;
    interpolate(rho) linear;
    interpolate(U) linear;
    interpolate(rhoU) linear;
    interpolate(muEff) linear;
    interpolate(tauMC) linear;
}

snGradSchemes
{
    default none;

    snGrad(U) corrected;

}

thanks.

fredo490 May 22, 2013 11:07

1) see page 10 of this pdf : http://www.bakker.org/dartmouth06/engs150/04-clsfn.pdf

2) a second order scheme is highly recommended in all simulations. Many phenomenon cannot "appear" with a first order. When you have shear regions, a second order scheme can give beautiful vortex while a first order might stay "laminar". Example here : http://www.innovative-cfd.com/comput...-modeling.html
It is also important for the shock waves, page 31 of this doc: http://www.bakker.org/dartmouth06/engs150/05-solv.pdf

3) As I know, rhoCentralFoam only use "linear" scheme so it is natural second order solver (except for time if you use "Euler").

msuaeronautics May 22, 2013 11:23

Quote:

Originally Posted by fredo490 (Post 420992)
In some cases a linearUpwindV (second order) can be more robust because it is a pure upwind second order.

Please explain. I have done a simple study comparing the convergence of linearUpwind vs. linearUpwindV (of course, using the limiting helps). But, I do not understand the theory behind the difference between the two. You say one is pure 2nd order- then what is the other?

fredo490 May 22, 2013 11:44

The difference is in how the scheme correct the value. The linearUpwind uses a "simple" correction that is not very accurate for some meshes (I would say some non-orthogonal meshes). The linearUpwindV improve the correction factor so that the correction factor also consider the direction of the flow.

To make it simple, from what I know, the linearUpwindV is an upwind scheme with an upwind corrector while the linearUpwind is an upwind scheme with a simple corrector ;)

So when I say that linearUpwindV is a "pure" upwind, it is because all the concepts of the scheme are of upwind type.

immortality May 22, 2013 12:28

thank you
but I didn't take the answer of 2 and 3 questions exactly,is it sufficient to change div(rho,phi) to a second order scheme so that our problem be second order?(when a run is called second order does it mean its div(phi,U) is second order?
and in rhoCentralFoam there are other divergence terms.should all of them be for example linearUpvindV?(and does linearUpwindV is used for when we have U in div like div(phi,U)?or can be udes for other div terms too?)
Code:

divSchemes
{
    default none;
    div(tauMC) Gauss linear;
    div(phi) Gauss upwind;
    div(phi,omega) Gauss upwind;
    div(phi,k) Gauss upwind;
    div(phi,gas) Gauss upwind;
}

thanks.

fredo490 May 22, 2013 12:40

As I said rhoCentralFoam is a little special... I'm not familiar with the code.

Everybody can choose what is a second order problem. There is no official definition. Ideally ALL schemes must be of second order... But because some cases are unstable with the second order turbulence some papers "forget" to say that they used all second order except for some variables

immortality May 22, 2013 12:40

and also in rhoPimpleFoam what changes seems better to be done to have a better second order solution?(for example in div(phi,K) its better to be limitedLinear or linearUpwind?)
Code:

ddtSchemes
{
    default        none;//CrankNicolson 0.5
    ddt(rho,U)      CrankNicolson 0.5;
    ddt(rho,K)      CrankNicolson 0.5;
    ddt(rho,h)      CrankNicolson 0.5;
    ddt(thermo:psi,p) CrankNicolson 0.5;
    ddt(rho)          CrankNicolson 0.5;
    ddt(p)            CrankNicolson 0.5;
    ddt(rho,gas)      CrankNicolson 0.5;
}

gradSchemes
{
    default        none;//Gauss linear
    grad(p)        Gauss linear;//faceLimited leastSquares 1.0
    grad(U)        cellLimited leastSquares 1.0;
    grad(h)        Gauss linear;
}

divSchemes
{
    default        none;
    div(phi,U)      Gauss linearUpwind grad(U);
    div(phid,p)    Gauss limitedLinear 1;
    div(phi,K)      Gauss upwind;
    div(phi,h)      Gauss limitedLinear 1;
    div(U)          Gauss linearUpwind;
    div((muEff*dev2(T(grad(U))))) Gauss linear;
    div(phi,gas)    Gauss upwind;
}

laplacianSchemes
{
    default        none;
    laplacian(Dp,p)  Gauss linear uncorrected;
    laplacian(muEff,U) Gauss linear uncorrected;
    laplacian(alphaEff,h) Gauss linear uncorrected;
    laplacian(muEff,gas) Gauss linear uncorrected;
}

interpolationSchemes
{
    default        linear;
   
}

snGradSchemes
{
    default        uncorrected;
}

fluxRequired
{
    default        no;
    p              ;


fredo490 May 22, 2013 12:57

I don't know, you need to try... As K is the kinetic energy, so it depends of U, I would say that the same second order scheme as U can be applied (linearupwind). But if your case diverge or over predict the temperature, you can try to use a limited linear scheme.

immortality May 22, 2013 14:37

then whats your opinion about this fvScheme has been used for rhoCentralFoam,is it first order or second order:
Code:

divSchemes
{
    default none;
    div(tauMC) Gauss linear;
    div(phi) Gauss upwind;
    div(phi,omega) Gauss upwind;
    div(phi,k) Gauss upwind;
    div(phi,gas) Gauss upwind;
}


fredo490 May 23, 2013 01:39

I have no idea... I don't know this solver. Part of it is hard coded. At first look Iwould ssay that it is second order with first order turbulence model.


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