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

Modified simpleFOAM using given Reynolds stress field

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 24, 2016, 12:55
Default Modified simpleFOAM using given Reynolds stress field
  #1
K62
New Member
 
Martin Schmelzer
Join Date: Aug 2012
Location: TU Delft
Posts: 4
Rep Power: 14
K62 is on a distinguished road
Dear OpenFOAM-users,

My aim is to run a RANS simulation with a given Reynolds-stress tensor field R_{ij}. This R_{ij} will come from a previous RANS simulation of the same case but will be (slightly) modified, i.e. R_{ij} \rightarrow R^*_{ij}. In order to write a solver, which is able to do that, I used simpleFoam (OF2.3.0). The UEqn.C file contains the following lines

Code:
tmp<fvVectorMatrix> UEqn
    (
        fvm::div(phi, U)
      + turbulence->divDevReff(U)
      ==
        fvOptions(U)
    );

The pointer
Code:
turbulence->divDevReff(U)
is defined e.g. in LRR.C
Code:
tmp<fvVectorMatrix> LRR::divDevReff(volVectorField& U) const
{
...

return
        (
            fvc::div(R_)
          + fvc::laplacian(nut_, U, "laplacian(nuEff,U)")
          - fvm::laplacian(nuEff(), U)
        );
}

This leads to the following implementation of my new solver
Code:
tmp<fvVectorMatrix> UEqn
    (
        fvm::div(phi, U)
      + fvc::div(R)
      + fvc::laplacian(nut, U, "laplacian(nuEff,U)")
      - fvm::laplacian(nu+nut, U)
      ==
        fvOptions(U)
    );
Also the line
Code:
turbulence->correct();
is commented, since it is not necessary anymore.

My workflow is like that.

STEP 1: I run a simulation using the un-modified simpleFoam solver until the residuals go to machine accuracy or drop a value of 1e-10 or so. I then run the utility R, which computes the Reynolds stresses using the Boussinesq approximation

Code:
tmp<volSymmTensorField> kEpsilon::R() const
{
    return tmp<volSymmTensorField>
    (
        new volSymmTensorField
        (
            IOobject
            (
                "R",
                runTime_.timeName(),
                mesh_,
                IOobject::NO_READ,
                IOobject::NO_WRITE
            ),
            ((2.0/3.0)*I)*k_ - nut_*twoSymm(fvc::grad(U_)),
            k_.boundaryField().types()
        )
    );
}
STEP 2: The output field R is used as an input for the modified solver described above, so that no additional transport equation for R_{ij} is solved and it stays (so far) unmodified. Since, the field is exactly the one which is the output of the step 1, I naively (?) assumed that using it as an input for the modified solver will lead to the same U and p fields as in STEP 1.

For the cases I am looking at I observe that for a smooth geometry (2D hill), the modified solver converges but gives velocity and pressure fields which show differences at the wall of up to 5%. I guess this has to do with the fact how boundaries are treated by the different differential operators (laplacian, div and grad) in OpenFOAM, but I wasn't able to get to the core of this problem. Does anybody have an idea about that?

Best wishes,
Martin
K62 is offline   Reply With Quote

Old   March 23, 2017, 04:14
Default
  #2
New Member
 
Yangmo Zhu
Join Date: Jan 2016
Posts: 3
Rep Power: 10
zym604 is on a distinguished road
Thanks you Martin, your thought is exactly the same as mine. Regarding the 5% difference, did you use the same system files in both case? For example, fvscheme.
zym604 is offline   Reply With Quote

Old   March 24, 2017, 04:41
Default
  #3
New Member
 
Yangmo Zhu
Join Date: Jan 2016
Posts: 3
Rep Power: 10
zym604 is on a distinguished road
Hi Martin, although I didn't work out your method, I found another way to deal with it. I want to share it with you:

1. Calculate nut according to R;
2. Add nut to nu as an internal field;
3. Solve the problem as laminar flow;
4. Done.
zym604 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
[Other] dynamicTopoFVMesh and pointDisplacement RandomUser OpenFOAM Meshing & Mesh Conversion 6 April 26, 2018 08:30
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Resolved Reynolds Stress in LES yinyueqiang FLUENT 3 July 24, 2013 12:48
Standard K-Epsilon TO Reynolds Stress calculation (for convergence) wjarrah Main CFD Forum 2 May 27, 2010 06:32
Questions about the Reynolds stress model empirer2002 Main CFD Forum 1 January 5, 2006 08:37


All times are GMT -4. The time now is 15:21.