CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Verification & Validation (https://www.cfd-online.com/Forums/openfoam-verification-validation/)
-   -   OpenFOAM V&V (https://www.cfd-online.com/Forums/openfoam-verification-validation/89580-openfoam-v-v.html)

Martin Hegedus June 16, 2011 18:14

OpenFOAM V&V
 
I'm interested in finding Verification and Validation data on OpenFOAM for incompressible and compressible external aerodynamics for basic test cases.

The root of this question is a posting I made at Symscape, http://www.symscape.com/blog/new-str...fd-wind-tunnel

I realize that OpenFOAM is used by industry, academia, and hobbyists. There is even a workshop for it.

However, I am having difficulty finding systematic quantitative (i.e. not qualitative pretty colored pictures or top level slides) V&V information for OpenFOAM for simple geometries, i.e., flat plate, bump, forward/backward steps, lidded cavities, airfoils, wings, etc. This includes grid convergence studies.

Examples of what I am referring to, in regards to a NASA code CFL3D, are, http://cfl3d.larc.nasa.gov/Cfl3dv6/c...testcases.html or http://turbmodels.larc.nasa.gov/, or even http://aaac.larc.nasa.gov/tsab/cfdlarc/aiaa-dpw/

Does such information, to the extent one can reproduce the results, exist for OpenFOAM? Or is it up to each individual/group to work through V&V cases from scratch on their own?

wyldckat June 19, 2011 16:24

Greetings Martin,

I just saw this blog post and remembered about your thread: http://cfdtoy.blogspot.com/2011/05/m...ification.html

Best regards,
Bruno

santiagomarquezd June 21, 2011 16:53

Quote:

Originally Posted by Martin Hegedus (Post 312344)
I'm interested in finding Verification and Validation data on OpenFOAM for incompressible and compressible external aerodynamics for basic test cases.

However, I am having difficulty finding systematic quantitative (i.e. not qualitative pretty colored pictures or top level slides) V&V information for OpenFOAM for simple geometries, i.e., flat plate, bump, forward/backward steps, lidded cavities, airfoils, wings, etc. This includes grid convergence studies.

Does such information, to the extent one can reproduce the results, exist for OpenFOAM? Or is it up to each individual/group to work through V&V cases from scratch on their own?

We did some of this work (and we continue to do it, but the extra part isn't not published yet) and is published here:

COMPARISON OF SINGLE PHASE LAMINAR AND LARGE EDDY SIMULATION (LES) SOLVERS USING THE OPENFOAM(R) SUITE

VOLUME OF FLUID SIMULATION OF BORDA MOUTHPIECES

Results are checked against experiments and Fluent.

Hope this help

Martin Hegedus June 21, 2011 17:33

Thanks, it's a start.

In general, I've seen others raise the issue about grid convergence. (Lid-Driven Cavity from first paper).

Did you figure out why the lid driven cavity did not converge?

The fact that the residuals do not converge to machine zero is a little scary.

santiagomarquezd June 21, 2011 17:42

Hi, Do you refer to the problem of p residuals?

Regards.

Martin Hegedus June 21, 2011 17:49

Yes, that is correct.

santiagomarquezd June 21, 2011 18:00

Martin, this problem was reported several times, but I couldn't find a cure at that time. This is related to PISO loop and tolerances and type in p solver (I never played enough time with GAMG solver for example), I'm working in that now. If you could find a set of parameters that perform better It would be nice to share it with the community, particularly avoiding the plateau at ~1E-6.

Regards.

Martin Hegedus June 21, 2011 19:49

I don't use OpenFOAM that much. I get very frustrated with it. The vast majority of my cases are steady state external aero, both compressible and incompressible. In general I haven't had much luck with OpenFOAM. I figure it is my own personal issue since so many others use the code. So, instead, I wrote my own solver from scratch (compressible with equations coupled). That's been a lot of work. Especially the V&V stuff. However, at some point it would be nice to have more confidence in OpenFOAM and use it more.

If I come up with something that works for the lidded cavity, I'll share it here on this forum. BTW, is there a better place to share cases and solutions for OpenFOAM? http://www.cfd-online.com/Wiki/Valid...and_test_cases seems sparse and www.openfoam.com doesn't seem to be very, well, open in the sense of supplying a place for the OpenFOAM community to go to.

santiagomarquezd June 21, 2011 22:44

Quote:

Originally Posted by Martin Hegedus (Post 312986)
So, instead, I wrote my own solver from scratch (compressible with equations coupled). That's been a lot of work. Especially the V&V stuff. However, at some point it would be nice to have more confidence in OpenFOAM and use it more.

Well you're the kind of person which is essential as a user/developer in OpenFOAM, you have a lot of experience and a very critical vision of a code. I'm working with FOAM to write customized solvers and re-implementing some of them in Matlab (my advisor is working on that since he works with it the most), this task is very instructive but a bit slow.

Quote:

If I come up with something that works for the lidded cavity, I'll share it here on this forum. BTW, is there a better place to share cases and solutions for OpenFOAM? http://www.cfd-online.com/Wiki/Valid...and_test_cases seems sparse and www.openfoam.com doesn't seem to be very, well, open in the sense of supplying a place for the OpenFOAM community to go to.
Well, some vendors as ANSYS, etc. show a lot of benchmarks in their slide-shows, etc. but the real validation is ever spread in a lot of papers, since the validations are usually connected to a specific application.

Regards.

Martin Hegedus June 22, 2011 00:21

Quote:

Originally Posted by santiagomarquezd (Post 313003)
Well, some vendors as ANSYS, etc. show a lot of benchmarks in their slide-shows, etc. but the real validation is ever spread in a lot of papers, since the validations are usually connected to a specific application.

Regards.

Papers are an important part of the process, but I'm also hoping there is a web resource where one can place grids, input decks, and results and "blog" (i.e. informally write) about the results. Another nice feature would be if others could comment on the results and contribute their own results. Something similar to these forum threads, but more focused on results than questions.

I haven't found one yet. A wiki (such as the V&V here at CFD Online), in my opinion, may not be appropriate. Wiki's are very formal and polished.

pbohorquez June 22, 2011 08:45

At low Reynolds numbers (i.e. incompressible and laminar flow) we have reported successful comparison between OpenFOAM and wind tunnel experiments for external flows both for steady and unsteady regime. You could find more information in the following paper:

Bohorquez, P., Sanmiguel-Rojas, E., Sevilla, A., Jiménez-González, J., Martínez-Bazán, C. Stability and dynamics of the laminar wake past a slender blunt-based axisymmetric body. Journal of Fluid Mechanics, 676: 110-144 (2011) http://dx.doi.org/10.1017/s0022112011000358

Quote:

Originally Posted by Martin Hegedus (Post 312986)
I don't use OpenFOAM that much. I get very frustrated with it. The vast majority of my cases are steady state external aero, both compressible and incompressible. In general I haven't had much luck with OpenFOAM. I figure it is my own personal issue since so many others use the code. So, instead, I wrote my own solver from scratch (compressible with equations coupled). That's been a lot of work. Especially the V&V stuff. However, at some point it would be nice to have more confidence in OpenFOAM and use it more.

If I come up with something that works for the lidded cavity, I'll share it here on this forum. BTW, is there a better place to share cases and solutions for OpenFOAM? http://www.cfd-online.com/Wiki/Valid...and_test_cases seems sparse and www.openfoam.com doesn't seem to be very, well, open in the sense of supplying a place for the OpenFOAM community to go to.


santiagomarquezd June 22, 2011 09:52

Another ref. for my thesis!! Thanks for it and the downloading link.

Regards.

Martin Hegedus June 22, 2011 12:55

Quote:

Originally Posted by pbohorquez (Post 313071)
At low Reynolds numbers (i.e. incompressible and laminar flow) we have reported successful comparison between OpenFOAM and wind tunnel experiments for external flows both for steady and unsteady regime. You could find more information in the following paper:

Bohorquez, P., Sanmiguel-Rojas, E., Sevilla, A., Jiménez-González, J., Martínez-Bazán, C. Stability and dynamics of the laminar wake past a slender blunt-based axisymmetric body. Journal of Fluid Mechanics, 676: 110-144 (2011) http://dx.doi.org/10.1017/s0022112011000358

Clearly a lot of work went into the paper and I found the results and topic interesting. I found the shift from steady axisymmetric, to steady non-axisymmetric, to unsteady cool. And I believe in the real world this transition exists. However, something usually sets off the transition, i.e. transitioning from steady axisymmetric to steady non-axisymmetric. In the case of the wind tunnel results I assume it is the sting which comes out the side of the model, i.e. the plane of symmetry for the non-axisymmetric, but symmetric, result is aligned with the side sting. But what transitions it for the axisymmetric CFD geometry? I assume it is the non-axisymmetric grid that was used. But was it? Where the results converged all the way? How was convergence measured? Depending on the solution algorithm and the case, I expect the results sometimes to converge non-axisymmetricly on a non-axisymmetric grid, at least until the residual has died down a lot. And the process is very non linear. The solution sits for a while and then moves rapidly to a new location, i.e. the axis. The flow is on the verge of being unstable, so all the perturbations (solution, grid, numerics, etc.) must be removed to the extent possible to get a true answer. Otherwise things get masked, i.e. the effects of the wind tunnel and sting. Or, bugs in the code.

Martin Hegedus June 22, 2011 13:16

Quote:

Originally Posted by Martin Hegedus (Post 313135)
The solution sits for a while and then moves rapidly to a new location, i.e. the axis.

Let me rephrase, The solution state sits for a while and then moves rapidly to a new state location, i.e. axisymmetric.

pbohorquez June 22, 2011 14:25

Yes, you are right. On the numerical side there are lots of parameters that affect the solution of any problem because they introduce errors: the topology of the mesh, cell elements, the implementation (segregated/coupled), the order of consistency, etc. And they affect the results because the mesh is always coarser than we want in the absence of exceptional numerical facilities.

But this happens with any numerical solver, not just with OpenFOAM. There are suitable problems that can be solved if you know how to drive the tool, otherwise the numericist wont succeed. Numerical algorithms are designed for specific purpose and, consequently, they continue growing. OpenFOAM implements a classical FVM formulations, it is not the Panacea.

Martin Hegedus June 22, 2011 14:57

Quote:

Originally Posted by pbohorquez (Post 313144)
But this happens with any numerical solver, not just with OpenFOAM. There are suitable problems that can be solved if you know how to drive the tool, otherwise the numericist wont succeed. Numerical algorithms are designed for specific purpose and, consequently, they continue growing. OpenFOAM implements a classical FVM formulations, it is not the Panacea.

Very true, and I definitely agree with "know how to drive the tool, otherwise the numericist wont succeed" That's the frustrating part. I'm not confident that I know how to drive OpenFOAM. Therefore, my personal chance of numerical success with the code is low. And sometimes I feel like I'm driving blind. Even with my experience writing and driving various research codes.

A question then. Were you able to converge the residuals for your steady results to machine zero, or at least to the point where you were very confident the residuals were heading there? I assume you did, but I'm looking for data points not based on my assumptions.

pbohorquez June 22, 2011 15:27

In the case described in the paper, if the boundary condition of the body is set to slip, then the pressure and velocity residual drop to zero. When using 'no slip' the pressure residual may reach an asymptotic value (usually between 10^{-6} and 10^{-4}). However, I cannot ensure that it is due to the boundary condition. Why can you use a different interpolation and discretization scheme for each differential operator in each equation? Is there an optimal choice to guarantee the "well balanced" property and drop the residuals to machine accuracy?

Anyway, we are very happy with OpenFOAM results for incompressible flows. They converge as the mesh is refined and it is able to reproduce many non-linear transitions for a wide range of physical problems, even in the presence of the pressure plateau.

Martin Hegedus June 22, 2011 16:11

Quote:

Originally Posted by pbohorquez (Post 313154)
In the case described in the paper, if the boundary condition of the body is set to slip, then the pressure and velocity residual drop to zero. When using 'no slip' the pressure residual may reach an asymptotic value (usually between 10^{-6} and 10^{-4}). However, I cannot ensure that it is due to the boundary condition. Why can you use a different interpolation and discretization scheme for each differential operator in each equation? Is there an optimal choice to guarantee the "well balanced" property and drop the residuals to machine accuracy?

Interesting. You mention boundary condition, or could it be the shear stress in the cell? For example the ratio of shear stress vs. delta pressure. You mentioned a range of asymptotic values. Is this a function of Reynolds number? An increase in the viscosity has the effect of dropping the Reynolds number. So, as the Reynolds number drops, does OpenFOAM have a harder time to converge? (sorry, asking the question doesn't mean I know the remedy. I don't.)

One of the reasons this is interesting is that eddy viscosity in the RANS equation basically lowers the local Reynolds number, i.e. viscosity goes up. Thus there is somewhat of a connection between the flows I usually deal with, and your low Reynolds number shapes.

This seems to match with santiagomarquezd.

Has anyone done a flat plate analysis with OpenFOAM and converged it to machine zero? (Edit: Oh, at low to high reynolds numbers)

pbohorquez June 22, 2011 17:03

Nice thoughts. The flat plane analysis is a good suggestion. If someone knows the answer please share it.

With respect to the shear stress in the cell, figure 16 in Alves, Oliveira & Pinho (2003), www.fe.up.pt/~fpinho/pdfs/ijnmf1.pdf, came to my mind. I don't know if it is a crazy idea but iterations in SIMPLE are analogous to "pseudo-time", so maybe there is some analogy between the asymptotic values for the pressure and for \tau_{xx}.

Martin Hegedus June 22, 2011 17:24

I did I quick internet search and found OpenFOAM results for flat plates, both laminar and turbulent. I have not seen any residual plots and the results I saw are for x stations that have much higher Rex than the reynolds number of interest here. So nothing conclusive.

Martin Hegedus June 22, 2011 22:56

Interesting, I ran 0 degrees angle of attack on the simpleFoam airfoil2D example and it failed to converge and then ran 2.2e-6 degrees and it converged.

http://www.cfd-online.com/Forums/ope...tml#post313183

Not sure what the story is. Maybe I missed a switch or something. Anyone have an idea?

FelixL June 23, 2011 04:17

1 Attachment(s)
Quote:

Originally Posted by Martin Hegedus (Post 313156)
Has anyone done a flat plate analysis with OpenFOAM and converged it to machine zero? (Edit: Oh, at low to high reynolds numbers)

Hello, Martin,


I just did a quick simulation of a test case on a 136x96 CVs structured mesh:

http://turbmodels.larc.nasa.gov/flatplate.html

The Reynolds number based on length "1" is 5e6, I used the SpalartAllmaras turbulence model and the simpleFoam algorithm for solving the coupled, steady state incompressible NS-equations.
It's converged below 1e-8 an the residuals decrease is logarithmic (see attached plot).

As for the numerical settings, those are as follows:

fvSolution:

Code:

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

solvers
{
    p
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance      1e-12;
        relTol          0.01;
    }

    U
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-12;
        relTol          0.01;
    }

    nuTilda
    {
        solver          PBiCG;
        preconditioner  DILU;
        tolerance      1e-12;
        relTol          0.01;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell        0;
    pRefValue      0;

    residualControl
    {
        p              1e-8;
        U              1e-8;
        nuTilda        1e-8;
    }
}

relaxationFactors
{
    default        0;
    p              0.3;
    U              0.7;
    nuTilda        0.7;
}


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

fvSchemes:

Code:

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

ddtSchemes
{
    default        steadyState;
}

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

divSchemes
{
    default        none;

    div(phi,U)      Gauss linearUpwind grad(U);
    div(phi,nuTilda) Gauss linearUpwind grad(nuTilda);

//    div(phi,U)      Gauss upwind;
//    div(phi,nuTilda) Gauss upwind;

    div((nuEff*dev(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        none;
    laplacian(nuEff,U) Gauss linear corrected;
    laplacian((1|A(U)),p) Gauss linear corrected;
    laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
    laplacian(1,p)  Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
    interpolate(U)  linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p              ;
}


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

If you have further questions, feel free to ask.


Greetings,
Felix.

Martin Hegedus June 23, 2011 04:57

Thanks, can you post the input decks for the state variables? I'm interested in knowing the boundary conditions you used.

FelixL June 23, 2011 06:59

You're welcome.

Of course, I will add the boundary conditions later when I come home from work.

So far I can tell you:

INLET:

U: fixedValue (1 0 0)
p: zeroGradient
nuTilda: fixedValue 5e-7 (i guess...)
nut: calculated

OUTLET:

U: zeroGradient
p: fixedValue 0
nuTilda: zeroGradient
nut: calculated

WALL:

U: fixedValue (0 0 0)
p: zeroGradient
nuTilda: fixedValue 0
nut: fixedValue 0

TOP and BOTTOM (in front of the plate):

all: symmetryPlane


I used 2e-7 as viscosity to achieve a reynolds number of 5e6 with the specified inlet velocity.


Greetings,
Felix

FelixL June 23, 2011 12:44

Here are the BC files, as promised.


U:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volVectorField;
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 1 -1 0 0 0 0];

internalField  uniform (1 0 0);

boundaryField
{
    "(bottom|top)"
    {
        type            symmetryPlane;
    }

    outlet
    {
        type            zeroGradient;
    }

    inlet
    {
        type            fixedValue;
        value          $internalField;
    }

    plate
    {
        type            fixedValue;
        value          uniform (0 0 0);
    }

    "(front|back)"
    {
        type            empty;
    }
}

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

p:
Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -2 0 0 0 0];

internalField  uniform 0;

boundaryField
{
    "(bottom|top)"
    {
        type            symmetryPlane;
    }

    outlet
    {
        type            fixedValue;
        value          $internalField;
    }

    inlet
    {
        type            zeroGradient;
    }

    plate
    {
        type            zeroGradient;
    }

    "(front|back)"
    {
        type            empty;
    }
}

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

nuTilda:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      nuTilda;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField  uniform 5.0e-7;

boundaryField
{
    "(bottom|top)"
    {
        type            symmetryPlane;
    }

    outlet
    {
        type            zeroGradient;
    }

    inlet
    {
        type            fixedValue;
        value          $internalField;
    }

    plate
    {
        type            fixedValue;
        value          uniform 0;
    }

    "(front|back)"
    {
        type            empty;
    }
}

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

nut:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.0.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      volScalarField;
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 2 -1 0 0 0 0];

internalField  uniform 5.0e-7;

boundaryField
{
    "(bottom|top)"
    {
        type            symmetryPlane;
    }

    "(outlet|inlet)"
    {
        type            calculated;
    }

    plate
    {
        type            fixedValue;
        value          uniform 0;
    }

    "(front|back)"
    {
        type            empty;
    }
}

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


santiagomarquezd June 23, 2011 17:52

Martin, threads I was referring to are:

SimpleFoam convergence problems

Comparison of axisymmetric case, Starccm+ and OpenFOAM


nevertheless today I found this one:

Convergence

where Henry W. explains the topic about p residuals stagnation, in post #2 he states:

"We don't normalise the residuals the same way as other codes and one consequence is that p may appear not to converge adequately. However, we find that so long as U has converged well it doesn't matter that the p residual is higher. The best thing is to look at the way the fields are evolving."

Problem isn't clear for me, though.

Regards

Martin Hegedus June 23, 2011 19:01

Quote:

Originally Posted by santiagomarquezd (Post 313323)
Martin, threads I was referring to are:

SimpleFoam convergence problems

Comparison of axisymmetric case, Starccm+ and OpenFOAM


nevertheless today I found this one:

Convergence

where Henry W. explains the topic about p residuals stagnation, in post #2 he states:

"We don't normalise the residuals the same way as other codes and one consequence is that p may appear not to converge adequately. However, we find that so long as U has converged well it doesn't matter that the p residual is higher. The best thing is to look at the way the fields are evolving."

Problem isn't clear for me, though.

Regards

Yes, there are different ways of determining residuals, one can use the L2-norm of the state vector or the right hand side vector. If the L2-norm of the RHS is used, then it can be used in it's raw form or normalized to represent how the solution marches forward for a local time step or constant time step method.

However, if something isn't clear to so many people, then there might be a problem. I know, OpenFOAM has been used by a lot of people and one would expect this issue to be taken care of in the past... So the problem isn't clear for me either. If I didn't know that so many people used the code for such a length of time, from past experience developing my own codes, I'd say there is a good chance there is a bug in the code. Sadly, I have a lot of experience with bugs, more than I want! Thus the strong need for V&V.

However, on this thread FelixL presented residuals that went past 1.e-8 and seemed to keep going. Given that the airfoil2D case residuals, except at zero angle of attack, fell to the region of 1.0e-10 to 1.0e-12, I suspect that FelixL's flat plate will bottom out at 1.0e-12 or a little past that, probably 1.0e-13. Therefore it seems that 1.0e-6 is not machine zero for OpenFOAM.

For the airfoil case I ran 8, 4, 2, 1, 0.5, 0.01, 0.001, 2.2e-6, and 0 degrees angle of attack. For angles of attack greater than 0.01, the residuals dropped below 1.0e-10. Angles less than 0.01 will be a little different because of the fine vertical grid spacing at z=0 and the fact that the wake must exit the back end. There will be a little bit of a convergence battle going on there. However, that does not explain the jump in residual from an angle of attack of 2.2e-6 to 0.

Martin Hegedus June 23, 2011 19:21

Quote:

Originally Posted by FelixL (Post 313302)
Here are the BC files, as promised.

Thanks for the decks. I'm trying to compile OpenFOAM 2.0 now and ran into "calls to overloaded 'XYZ' is ambigous' errors. I guess I'll need to update my version of gcc.

Can you do me a favor and run your flat plate case with the top farfield B.C. as freestream rather than symmetry? If you don't have the time, I understand.

The numerics of the freestream and symmetry boundary are somewhat similar in the sense they both impose a value of p and tangential velocity (which should be somewhat similar since the boundary is sufficiently far away) and the normal velocity is 0. The idea is to see if the airfoil2D issue shows up.

FelixL June 24, 2011 02:21

1 Attachment(s)
Good morning, everyone,

I'm making this quick, will comment later.

I ran the test Martin requested using freestream as the top boundary condition. My experience with this BC isn't really good so I tend to avoid it. The plot below shows, that the pressure-residuals stall at about 1e-5 and the other residuals stall later as a consequence of that.


Greetings,
Felix.

Martin Hegedus June 24, 2011 02:49

Quote:

Originally Posted by pbohorquez (Post 313160)
Nice thoughts. The flat plane analysis is a good suggestion. If someone knows the answer please share it.

With respect to the shear stress in the cell, figure 16 in Alves, Oliveira & Pinho (2003), www.fe.up.pt/~fpinho/pdfs/ijnmf1.pdf, came to my mind. I don't know if it is a crazy idea but iterations in SIMPLE are analogous to "pseudo-time", so maybe there is some analogy between the asymptotic values for the pressure and for \tau_{xx}.

Patricio, when you ran your bullet case, what did you use as your outer boundary condition? Freestream at zero angle of attack?

Martin Hegedus June 24, 2011 03:03

Quote:

Originally Posted by FelixL (Post 313353)
Good morning, everyone,

I'm making this quick, will comment later.

I ran the test Martin requested using freestream as the top boundary condition. My experience with this BC isn't really good so I tend to avoid it. The plot below shows, that the pressure-residuals stall at about 1e-5 and the other residuals stall later as a consequence of that.


Greetings,
Felix.

Thanks. I assume, based on the 2D airfoil case, if you gave it an epsilon of w velocity it would converge. There is also the possibility that if you set the plate to symmetry the case still would not converge, assuming the interior was initialized to something other than freestream. If the code worked correctly it should converge to freestream.

I have no idea why the code is doing this, other than to say there is a bug.

FelixL June 24, 2011 03:27

Good morning, Martin,


at first let me comment on your post #28:

Quote:

The numerics of the freestream and symmetry boundary are somewhat similar in the sense they both impose a value of p and tangential velocity (which should be somewhat similar since the boundary is sufficiently far away) and the normal velocity is 0. The idea is to see if the airfoil2D issue shows up.
This is not entirely correct. The freestream boundary condition doesn't set a velocity value tangential to the boundary - basically it just works like an inletOutlet-BC for the velocity (and scalars other than pressure) and zeroGradient for pressure.
It means: when the flux vector at the boundary points inwards, the velocity is set to a fixed value of freestreamValue and the pressure is set to zeroGradient. If the flux vector points outwards, it's vice versa.

According to your experiences there might be an explanation: if the freestream velocity is parallel to the boundary (like in my flat plate case), the flux vector component normal to the boundary is zero. This could be causing all this trouble getting the residuals down to machine precision. This might actually explain why it's working for you when you set a slight velocity component in boundary normal direction. Or is the domain of your airfoil case circular?


Greetings,
Felix.

Martin Hegedus June 24, 2011 04:07

Quote:

Originally Posted by FelixL (Post 313365)
Good morning, Martin,


at first let me comment on your post #28:



This is not entirely correct. The freestream boundary condition doesn't set a velocity value tangential to the boundary - basically it just works like an inletOutlet-BC for the velocity (and scalars other than pressure) and zeroGradient for pressure.
It means: when the flux vector at the boundary points inwards, the velocity is set to a fixed value of freestreamValue and the pressure is set to zeroGradient. If the flux vector points outwards, it's vice versa.

Interesting, I didn't realize. So instead one should use fixedValue for actually setting the B.C. values to freestream conditions?

Quote:

According to your experiences there might be an explanation: if the freestream velocity is parallel to the boundary (like in my flat plate case), the flux vector component normal to the boundary is zero. This could be causing all this trouble getting the residuals down to machine precision. This might actually explain why it's working for you when you set a slight velocity component in boundary normal direction. Or is the domain of your airfoil case circular?


Greetings,
Felix.
The airfoil2D case is the one supplied with OpenFOAM. Its a C grid. So, yes, it's got the same condition as the flat plate outer B.C.

Is the switch for in/out for the freestream B.C. based on the local normal velocity or the freestream normal velocity component, i.e. Vinf dot n? The plate example should be forcing the flow outward by a small amount, granted very small.

FelixL June 24, 2011 04:18

It is common practice to set U, nuTilda, k, epsilon etc. to fixedValue and pressure to zeroGradient everywhere where the flux vector is expected to point inside the domain. Accordingly, U, nuTilda, and so on have to be set to zeroGradient and pressure to a fixedValue everywhere where the flux vector points outside the domain.

Problem is, sometimes (e.g. when you have a vortex shedding problem) you might have regions with inflow at the outlet. That's where the inletOutlet BC comes in handy.


As far as I know, the switch for in/out is determined by the freestream velocity. So the velocity vector should be tangential at the top boundary at my flat plate test case, no outward flow there (i.e. same as symmetry). But to confirm that I would need to check the results which I can't access right now.


Greetings,
Felix.

pbohorquez June 24, 2011 09:39

Quote:

Originally Posted by Martin Hegedus (Post 313359)
Patricio, when you ran your bullet case, what did you use as your outer boundary condition? Freestream at zero angle of attack?

I employed slip and zeroGradient BCs for velocity and pressure fields, respectively.

pbohorquez June 24, 2011 11:14

1 Attachment(s)
Quote:

Originally Posted by Martin Hegedus (Post 313359)
Patricio, when you ran your bullet case, what did you use as your outer boundary condition? Freestream at zero angle of attack?

A better convergence result was found by eliminating the outer domain (which was aligned with the free stream) and by replacing it with a hemisphere. Then, setting as inlet (outlet) boundary condition fixedValue (zeroGradient) for velocity and zeroGradient (fixedValue) for pressure, I reached machine zero.

Martin Hegedus June 24, 2011 15:14

1 Attachment(s)
I messed up describing the outer boundary for the airfoil2D case. It is a box with the inlet being the front, top, and bottom sides. Not a C grid. The back side is the outlet.

I changed the inlet condition to a wall and set the values (fixedValue) to the freestream values. It converged. Plot is shown below.

I then took the case above and set the pressure to zero gradient for the inlet boundary, and that converged to.

I then wanted to set the front face to freestream V and zero gradient pressure and the top and bottom to freestream p and zero gradient V, unfortunately I didn't have the time to extract the front face from the inlet boundary. The cell faces for the front face are not a continuous set.

Martin Hegedus June 24, 2011 15:36

Thanks for all the input.


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