CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   turbulentDFSEMInlet boundaryData and U, R, L, generation (https://www.cfd-online.com/Forums/openfoam-solving/235935-turbulentdfseminlet-boundarydata-u-r-l-generation.html)

mjavrincon May 6, 2021 07:50

turbulentDFSEMInlet boundaryData and U, R, L, generation
 
Hi guys,

I am trying to set up an LES simulation with turbulentDFSEMInlet boundary condition. In order to do so, I run a precursor RANS simulation with uniform inlet conditions and k-omega SST model of the same geometry. During the RANS simulation I extract the data at the outlet with the following code in controlDict:

Code:

    sampledPlanes
    {
        type                    surfaces;
        functionObjectLibs ( "libsampling.so" );
        outputControl        timeStep;
        outputInterval      1000;
        enabled                true;
        surfaceFormat      boundaryData;
        fields                    ( U turbulenceProperties:R turbulenceProperties:L );
        interpolationScheme cellPatchConstrained;
        surfaces                ( outlet { type patch ; patches ( outlet ) ; interpolate false ; } );
    }

Afterwards, I edit the case to adjust it for LES, take the data of U, R, L under postProcessing/sampledPlanes/ and copy it with the right format under constant/boundaryData. The problem is that I always get the following error when trying to decompose or run the case with turbulentDFSEMInlet:

Code:

Time = 0
Turbulent DFSEM patch inlet: interpolating field R from "/data/MJRP/fullCases/LES/constant/boundaryData/inlet/0/R"
Turbulent DFSEM patch inlet: interpolating field L from "/data/MJRP/fullCases/LES/constant/boundaryData/inlet/0/L"
Turbulent DFSEM patch inlet: interpolating field U from "/data/MJRP/fullCases/LES/constant/boundaryData/inlet/0/U"


--> FOAM FATAL ERROR:
Reynolds stress (2.3018333e-31 7.4816001e-32 -1.3597915e-31 -3.9599454e-32 -2.22473e-32 -1.2211324e-31) at face 1 leads to an invalid Cholesky decomposition due to the constraint R_yy - sqr(a_xy) >= 0

    From static bool Foam::turbulentDFSEMInletFvPatchVectorField::checkStresses(const symmTensorField&)
    in file fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C at line 992.

FOAM exiting

I have tried everything that I know including improving the mesh and extract the data in different ways at the outlet. I have not seen any solution to the problem online and perhaps I have an error of concept on how the BC works, but I hope that you could help me.

Thus, does anyone faced the same problem and knows what is failing here?

Thanks in advance!

HPE May 10, 2021 07:35

Hi,

One of the input Reynolds stress tensor element contains only zero-valued elements.

That's physically not possible. Therefore, OpenFOAM complains.

Hope this helps.

mjavrincon May 17, 2021 02:59

Solved
 
1 Attachment(s)
Thank you for your reply.

I have found the issue and I finally made it work.

The main problem is that I was extracting the data exactly at the inlet patch, where the Reynolds Stress tensor is zero.

I had to extract the simulation data from RANS at a certain distance from the inlet, where the flow is fully developed in my case. Doing so and then adjusting the case before running the LES in constant/boundaryData gives no problems when decomposing the case. Here you can see the function in controlDict to sample a plane:

Code:

sampledSurface
    {
        type            surfaces;
        executeControl  runTime;
        executeInterval 0.15;
        writeControl    runTime;
        writeInterval  500;
        enabled        true;
        surfaceFormat  boundaryData;
        interpolationScheme none;
        interpolate    false;
        triangulate    false;
        fields          ( U turbulenceProperties:R turbulenceProperties:L UPrime2Mean );
        surfaces        ( inletSurface {
                                    type plane ;
                                    planeType pointAndNormal ;
                                    pointAndNormalDict {
                                              point ( -0.07 0 0 ) ;
                                              normal ( 1 0 0 ) ;
                                              interpolate false ;
                                              triangulate false ;
                                              }
                                      } );
    }

As a reference, attached you can see the difference between having uniform inlet conditions and using DFSEM. I hope it helps if anyone else find themselves in trouble.

Sandeep lamba June 11, 2021 23:58

hi Mario Javier Rincón, It is of great help for me. Thanks for sharing.

HPE June 12, 2021 09:10

- sorry posted as a mistake -

XJ_Wang August 12, 2022 12:07

Hi Mario,

Thanks for sharing.

I also found a problem in the old version of OpenFOAM.com

For example in v1912,
OpenFOAM-v1912/src/finiteVolume/fields/fvPatchFields/derived/turbulentDFSEMInlet/turbulentDFSEMInletFvPatchVectorField.C
line 995:
Code:

scalar a_yz = (R.yz() - a_xy*a_xz)*a_yy;
this should be:
Code:

scalar a_yz = (R.yz() - a_xy*a_xz)/a_yy;
I have found it has been corrected in v2112.(not sure in which version it was corrected for the first time)

Hope this will be helpful if other foamers encounter this problem.


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