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/)
-   -   Compressor Simulation using rhoPimpleDyMFoam (https://www.cfd-online.com/Forums/openfoam-solving/143340-compressor-simulation-using-rhopimpledymfoam.html)

Jetfire October 22, 2014 06:25

Compressor Simulation using rhoPimpleDyMFoam
 
Hi

I am simulating compressor stage of a turbocharger with the rhoPimpleDyMFoam solver. running moveDynamicMesh -checkAMI was smooth without any errors which assures that my mesh rotates properly and i have defined my interfaces correctly , please point out if i am assuming this wrong.

However running the solver my simulation crashes showing this
Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.3.0                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 2.3.0-f5222ca19ce6
Exec  : rhoPimpleDyMFoam
Date  : Oct 22 2014
Time  : 15:58:22
Host  : "EAT-Standalone"
PID    : 4587
Case  : /home/eatin/OpenFOAM/eatin-2.3.0/run/tutorials/TurboCharger/Trial_4
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster
allowSystemOperations : Disallowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Selecting dynamicFvMesh solidBodyMotionFvMesh
Selecting solid-body motion function rotatingMotion
Applying solid body motion to cellZone FLUID_ROTOR

PIMPLE: Operating solver in PISO mode

Reading thermophysical properties

Selecting thermodynamics package
{
    type            hePsiThermo;
    mixture        pureMixture;
    transport      sutherland;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleEnthalpy;
}

AMI: Creating addressing and weights between 1900 source faces and 32076 target faces
AMI: Patch source sum(weights) min/max/average = 0.995594, 1, 0.999764
AMI: Patch target sum(weights) min/max/average = 0.432794, 1, 0.996788
AMI: Creating addressing and weights between 17748 source faces and 5456 target faces
AMI: Patch source sum(weights) min/max/average = 0.435302, 1.03344, 1.00009
AMI: Patch target sum(weights) min/max/average = 0.816766, 1.00271, 0.999924
AMI: Creating addressing and weights between 17839 source faces and 1957 target faces
AMI: Patch source sum(weights) min/max/average = 0.86998, 1, 0.999108
AMI: Patch target sum(weights) min/max/average = 0.991279, 1, 0.99992
Reading field U

Reading/calculating face flux field phi

Creating turbulence model

Selecting turbulence model type RASModel
Selecting RAS turbulence model kEpsilon
#0  Foam::error::printStack(Foam::Ostream&) in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::sigFpe::sigHandler(int) in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  in "/lib/x86_64-linux-gnu/libc.so.6"
#3  Foam::compressible::mutkWallFunctionFvPatchScalarField::calcMut() const in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#4  Foam::compressible::mutWallFunctionFvPatchScalarField::updateCoeffs() in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#5  Foam::fvPatchField<double>::evaluate(Foam::UPstream::commsTypes) in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/rhoPimpleDyMFoam"
#6  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::evaluate() in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/rhoPimpleDyMFoam"
#7  Foam::compressible::RASModels::kEpsilon::kEpsilon(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&, Foam::word const&) in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#8  Foam::compressible::RASModel::adddictionaryConstructorToTable<Foam::compressible::RASModels::kEpsilon>::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#9  Foam::compressible::RASModel::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#10  Foam::compressible::turbulenceModel::addturbulenceModelConstructorToTable<Foam::compressible::RASModel>::NewturbulenceModel(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libcompressibleRASModels.so"
#11  Foam::compressible::turbulenceModel::New(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::fluidThermo const&, Foam::word const&) in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/lib/libcompressibleTurbulenceModel.so"
#12 
 in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/rhoPimpleDyMFoam"
#13  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#14 
 in "/home/eatin/OpenFOAM/OpenFOAM-2.3.0/platforms/linux64GccDPOpt/bin/rhoPimpleDyMFoam"
Floating point exception (core dumped)

I am not able to identify what exactly is the problem and i suppose this is not due to the AMI interfaces as moveDynamicMesh was running perfectly. I have understood after reading few threads that it might be related to my boundary conditions, fvSchemes or fvSolution but i have no idea how to correct this. Please help me solve this and let me know if you need anymore details regarding my simulation.

Thanks

Jetfire October 22, 2014 06:35

Coming to my simulation i have to simulate compressor stage of a turbocharger
Meshing was done using ANSYS ICEM CFD , i had 3 mesh files
1. Inlet&Outlet
2.Volute
3.Rotor
I imported them to openfoam using fluent3DMeshToFoam and then used mergeMeshes to make the complete domain, after that used
splitMeshRegions -makeCellZones -overwrite to distinguish between the rotating zone and stationary zone.

I am attaching few pictures of the domain so you could get a clear picture.Please have a look at them

Jetfire October 22, 2014 06:38

1 Attachment(s)
This is the complete domain of my simulation

vasava October 22, 2014 07:39

1. How are you merging your three meshes that you have imported from fluent?
2. How did you create AMI patches?
3. Do you have 'sets' folder (with several domains) inside the constant folder?

Jetfire October 23, 2014 03:36

@vasava

As i have 3 mesh files
1.I created 3 case folders 1.Rotor 2.Volute 3.Inlet_Outlet
2. Placed the 3 mesh files into corresponding case folders and used fluent3DMeshToFoam fluent.msh -scale 0.001 for each to convert to meters
3.merged Rotor and volute , and then merged the combined mesh with Inlet_Outlet
4.used splitMeshRegions -makeCellZones -overwrite to create cell zones of different regions , 3 in my case

To create the AMI patches i used the createPatchDict, I will attach it for your reference
Code:

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

// Do a synchronisation of coupled points after creation of any patches.
// Note: this does not work with points that are on multiple coupled patches
//      with transformations (i.e. cyclics).
pointSync false;

// Patches to create.
patches
(
    {
        //- Master side patch
        name            AMI1;
        patchInfo
        {
            type            cyclicAMI;
            matchTolerance  0.0001;
            neighbourPatch  AMI2;
            transform      noOrdering;
     
        }
        constructFrom patches;
        patches (INT_STA_ROT_master);
    }

    {
        //- Slave side patch
        name            AMI2;
        patchInfo
        {
            type            cyclicAMI;
            matchTolerance  0.0001;
            neighbourPatch  AMI1;
            transform      noOrdering;
     
        }
        constructFrom patches;
        patches (INT_STA_ROT_slave);
    }

    {
        //- Master side patch
        name            AMI3;
        patchInfo
        {
            type            cyclicAMI;
            matchTolerance  0.0001;
            neighbourPatch  AMI4;
            transform      noOrdering;
           
        }
        constructFrom patches;
        patches (INT_ROT_STA_master);
    }

    {
        //- Slave side patch
        name            AMI4;
        patchInfo
        {
            type            cyclicAMI;
            matchTolerance  0.0001;
            neighbourPatch  AMI3;
            transform      noOrdering;
       
        }
        constructFrom patches;
        patches (INT_ROT_STA_slave);
    }


    {
        //- Master side patch
        name            AMI5;
        patchInfo
        {
            type            cyclicAMI;
            matchTolerance  0.0001;
            neighbourPatch  AMI6;
            transform      noOrdering;
           
        }
        constructFrom patches;
        patches (INT_OUTLET_HOUSING_master);
    }

    {
        //- Slave side patch
        name            AMI6;
        patchInfo
        {
            type            cyclicAMI;
            matchTolerance  0.0001;
            neighbourPatch  AMI5;
            transform      noOrdering;
           
        }
        constructFrom patches;
        patches (INT_OUTLET_HOUSING_slave);
    }

);

Yes, i have sets in my constant folder with different domains

tomf October 23, 2014 05:50

Hi,

Your problem seems to be in the turbulence model, I am guessing you have put epsilon equal to zero somewhere in either a boundary patch or the internalField. Change this to a sensible value for your case.

Regards,
Tom

vasava October 23, 2014 09:01

Your mesh setup seems alright. I agree with tomf, get some appropriate values for turbulence and use them in initial condition.

Also can you post your boundary file here?

Jetfire October 27, 2014 01:04

Hi ,

Sorry for the late reply and thanks for your response
I have checked my epsilon file and have not put zero anywhere and ya as you have suggested i am working on my initial and boundary conditions as this might be the source of error.

@vasava
Here is my boundary file
Code:

FoamFile
{
    version    2.0;
    format      binary;
    class      polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

16
(
    WALL_HUB
    {
        type            wall;
        inGroups        1(wall);
        nFaces          32413;
        startFace      16826280;
    }
    WALL_BACK_PLATE_ROT
    {
        type            wall;
        inGroups        1(wall);
        nFaces          14330;
        startFace      16858693;
    }
    WALL_SHOURD
    {
        type            wall;
        inGroups        1(wall);
        nFaces          36540;
        startFace      16873023;
    }
    WALL_BLADE
    {
        type            wall;
        inGroups        1(wall);
        nFaces          96768;
        startFace      16909563;
    }
    WALL_HOUSING
    {
        type            wall;
        inGroups        1(wall);
        nFaces          265149;
        startFace      17006331;
    }
    WALL_BACK_PLATE_STA
    {
        type            wall;
        inGroups        1(wall);
        nFaces          39172;
        startFace      17271480;
    }
    WALL_FREESLIP_INLET
    {
        type            wall;
        inGroups        1(wall);
        nFaces          6004;
        startFace      17310652;
    }
    WALL_FREESLIP_OUTLET
    {
        type            wall;
        inGroups        1(wall);
        nFaces          17404;
        startFace      17316656;
    }
    OUTLET
    {
        type            patch;
        nFaces          1957;
        startFace      17334060;
    }
    INLET
    {
        type            patch;
        nFaces          2945;
        startFace      17336017;
    }
    AMI1
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          1900;
        startFace      17338962;
        matchTolerance  0.0001;
        transform      noOrdering;
        neighbourPatch  AMI2;
   
    }
    AMI2
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          32076;
        startFace      17340862;
        matchTolerance  0.0001;
        transform      noOrdering;
        neighbourPatch  AMI1;
     
    }
    AMI3
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          17748;
        startFace      17372938;
        matchTolerance  0.0001;
        transform      noOrdering;
        neighbourPatch  AMI4;
     
    }
    AMI4
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          5456;
        startFace      17390686;
        matchTolerance  0.0001;
        transform      noOrdering;
        neighbourPatch  AMI3;
       
    }
    AMI5
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          17839;
        startFace      17396142;
        matchTolerance  0.0001;
        transform      noOrdering;
        neighbourPatch  AMI6;
       
    }
    AMI6
    {
        type            cyclicAMI;
        inGroups        1(cyclicAMI);
        nFaces          1957;
        startFace      17413981;
        matchTolerance  0.0001;
        transform      noOrdering;
        neighbourPatch  AMI5;
       
    }
)

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

One question , I have many boundaries i.e 16 in my boundary file. Is it necessary to define initial and boundary conditions for all these in my 0 folder?

vasava October 27, 2014 01:20

Quote:

Originally Posted by Jetfire (Post 516082)
Hi ,
One question , I have many boundaries i.e 16 in my boundary file. Is it necessary to define initial and boundary conditions for all these in my 0 folder?

Yes you have to else openFoam will complain even before your calculation starts.

The boundary file looks ok but did you try any other turbulence setup??

Jetfire October 27, 2014 01:30

1 Attachment(s)
Hi vasava,

Do you mean any of these two? I started with K-Epsilon as it was the basic turbulence model to start with.
1.K-omega SST
2.Spalart-Allmaras

I am attaching my 0 folder , please take a look at my initial and boundary conditions and help me correct them. I have copied and modified the files from annularThermalMixer tutorial.

tomf October 27, 2014 04:16

You have provided a relative pressure of 0 Pa, you should put the absolute pressure. OpenFOAM does not use a "gauge pressure" or similar for compressible solvers. The solver now tried to solve for an absolute vacuum, which it could not do. I guess it only found out when density was required to calculated some part of the turbulence model.

For incompressible cases 0 m2/s2 is allowed since in that case the absolute pressure does not matter.

Regards,
Tom

Jetfire October 27, 2014 05:02

Quote:

Originally Posted by tomf (Post 516109)
You have provided a relative pressure of 0 Pa, you should put the absolute pressure. OpenFOAM does not use a "gauge pressure" or similar for compressible solvers. The solver now tried to solve for an absolute vacuum, which it could not do. I guess it only found out when density was required to calculated some part of the turbulence model.

For incompressible cases 0 m2/s2 is allowed since in that case the absolute pressure does not matter.

Regards,
Tom

Hi tomf,
I changed the pressure file as suggested by you creating a pressure difference between inlet and outlet but i still end up getting the same error .

Alexeym has suggested this might be the cause of my error:

Hi,

as you've got FPE in mutkWallFunctionFvPatchScalarField::calcMut(), look at the source of the wall function:

Code:

tmp<scalarField> mutkWallFunctionFvPatchScalarField::calcMut() const
{
    const label patchi = patch().index();
    const turbulenceModel& turbModel =
        db().lookupObject<turbulenceModel>("turbulenceModel");
    const scalarField& y = turbModel.y()[patchi];
    const scalarField& rhow = turbModel.rho().boundaryField()[patchi];
    const tmp<volScalarField> tk = turbModel.k();
    const volScalarField& k = tk();
    const scalarField& muw = turbModel.mu().boundaryField()[patchi];

    const scalar Cmu25 = pow025(Cmu_);

    tmp<scalarField> tmutw(new scalarField(patch().size(), 0.0));
    scalarField& mutw = tmutw();

    forAll(mutw, faceI)
    {
        label faceCellI = patch().faceCells()[faceI];

        scalar yPlus =
            Cmu25*y[faceI]*sqrt(k[faceCellI])/(muw[faceI]/rhow[faceI]);

        if (yPlus > yPlusLam_)
        {
            mutw[faceI] = muw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1);
        }
    }

    return tmutw;
}

There's several possible reasons for FPE:
1. rhow[faceI] == 0
2. muw[faceI] == 0
3. k[faceCellI] < 0
4. E_*yPlus <= 0 (this is not the case, cause yPlus > yPlusLam_)

So you need to check if any of conditions 1-3 is true in your case.

I am able to figure out that these conditions come from the equations to have a proper solution but unable to understand which values i should correct.Please explain me if you can interpret what the problem exactly is.

Thanks

tomf October 27, 2014 05:09

Could you just show the p file, I was not talking about a pressure difference between inlet and outlet, I meant that you cannot have 0 Pa anywhere in the domain (internalField or any boundary condition), it should be around your absolute operating pressure (101325 Pa for standard atmosphere conditions).

I guess it should look something like this:

Code:

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

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

internalField  uniform 101325;

boundaryField
{
    WALL_HUB
    {
        type            zeroGradient;
    }
    OUTLET
    {
        type            fixedValue;
        value          uniform 101325;
    }
    INLET
    {
        type            zeroGradient;
    }
    WALL_BACK_PLATE_ROT
    {
        type            zeroGradient;
    }
    WALL_SHOURD
    {
        type            zeroGradient;
    }
    WALL_BACK_PLATE_STA
    {
        type            zeroGradient;
    }
    WALL_BLADE
    {
        type            zeroGradient;
    }
    WALL_HOUSING
    {
        type            zeroGradient;
    }
    WALL_FREESLIP_INLET
    {
        type            zeroGradient;
    }
    WALL_FREESLIP_OUTLET
    {
        type            zeroGradient;
    }
    AMI1
    {
        type            cyclicAMI;
        value          uniform 101325;
    }
    AMI2
    {
        type            cyclicAMI;
        value          uniform 101325;
    }
    AMI3
    {
        type            cyclicAMI;
        value          uniform 101325;
    }
    AMI4
    {
        type            cyclicAMI;
        value          uniform 101325;
    }
    AMI5
    {
        type            cyclicAMI;
        value          uniform 101325;
    }
    AMI6
    {
        type            cyclicAMI;
        value          uniform 101325;
    }
}


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

Regards,
Tom

Jetfire October 27, 2014 05:31

@tomf,

Thank you very much.
Just changed my p-file as suggested by you, now my simulation started running!! :)
I was always worried about the mut-file , dint expect the error was in my p-file.:confused:


For now the simulation is running but too slow,have to run it in parallel and maybe some changes in my fvSchemes and fvSolution will do. il come back to you in case of any queries, thanks a lot!

Jetfire November 6, 2014 03:02

Hi ,

I am simulating compressor of a turbocharger using rhoPimpleDyMFoam with kOmegaSST turbulence model.
Boundary conditons are as follows:

mass flow outlet : 0.04 kg/s
total pressure inlet:101325
total temperature inlet:298k
compressor rpm: 300,000

Can you help me with my FvSchemes and FvSolutions as to what modifications i should be doing for better results. let me know if you need any more details about the simulation.

FvSchemes
Code:

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

ddtSchemes
{
    default        Euler;
}

gradSchemes
{
    default        Gauss linear;
}

divSchemes
{
    default        none;

    div(phi,U)      Gauss linearUpwind grad(U);
    div(phi,h)      Gauss linearUpwind grad(h);
    div(phi,K)      Gauss linear;
    div(meshPhi,p)  Gauss linear;
    div(phi,k)      Gauss upwind;
    div(phi,omega) Gauss upwind;
    div((muEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default        Gauss linear corrected;
}

interpolationSchemes
{
    default        linear;
}

snGradSchemes
{
    default        corrected;
}

fluxRequired
{
    default        no;
    p              ;
    pcorr          ;
}


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

FvSolution
Code:

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

solvers
{
    p
    {
        solver          GAMG;
        smoother        GaussSeidel;
        cacheAgglomeration on;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 10;
        mergeLevels      1;
        tolerance      1e-6;
        relTol          0.01;
    }

    pFinal
    {
        $p;
        relTol          0;
    }

    pcorr
    {
        $p;
        tolerance      1e-2;
        relTol          0;
    }

    "(rho|U|h|k|epsilon|omega)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance      1e-06;
        relTol          0.1;
    }

    "(rho|U|h|k|epsilon|omega)Final"
    {
        $U;
        relTol          0;
    }

}

PIMPLE
{
    momentumPredictor  yes;
    transonic          no;
    nOuterCorrectors    1;
    nCorrectors        3;
    nNonOrthogonalCorrectors 1;
    rhoMin          rhoMin [ 1 -3 0 0 0 ] 0.5;
    rhoMax          rhoMax [ 1 -3 0 0 0 ] 2.0;
}

relaxationFactors
{
    fields
    {
    }
    equations
    {
        "(U|h|k|epsilon|omega).*" 1;
    }
}


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

Thanks

RodriguezFatz November 6, 2014 09:24

Whats the matter with your current results? Any problems?

Jetfire November 6, 2014 23:00

Hi RodriguezFatz,

I have started running the simulation and each timestep is taking a lot of time. Is there anything to do with my FvSolution or FvSchemes files to speed up my simulation? I am already running it on 8 cores.

Tobi November 7, 2014 02:26

So at least there is no problem ...

Jetfire November 7, 2014 02:33

Hi tobi,

My simulation has been running from past 1 day and still going on
Here is the output
Code:

Courant Number mean: 0.000114809 max: 1
deltaT = 1.41799e-09
Time = 5.81839e-07

solidBodyMotionFunctions::rotatingMotion::transformation(): Time = 5.81839e-07 transformation: ((0 0 0) (0.999958 (0.00913938 0 0)))
AMI: Creating addressing and weights between 1900 source faces and 32076 target faces
AMI: Patch source sum(weights) min/max/average = 0.99546, 1, 0.999763
AMI: Patch target sum(weights) min/max/average = 0.467982, 1, 0.996805
AMI: Creating addressing and weights between 17748 source faces and 5456 target faces
AMI: Patch source sum(weights) min/max/average = 0.538509, 1.06046, 1.00015
AMI: Patch target sum(weights) min/max/average = 0.685009, 1.00305, 0.999864
AMI: Creating addressing and weights between 17839 source faces and 1957 target faces
AMI: Patch source sum(weights) min/max/average = 0.86998, 1, 0.999108
AMI: Patch target sum(weights) min/max/average = 0.991279, 1, 0.99992
GAMG:  Solving for pcorr, Initial residual = 1, Final residual = 0.00998453, No Iterations 47
GAMG:  Solving for pcorr, Initial residual = 0.0244185, Final residual = 0.00465247, No Iterations 1
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
rhoEqn max/min : 2.15688 0.182153
smoothSolver:  Solving for Ux, Initial residual = 3.26172e-05, Final residual = 2.14196e-09, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 0.00157835, Final residual = 1.29594e-07, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 0.00176688, Final residual = 1.35932e-07, No Iterations 1
smoothSolver:  Solving for h, Initial residual = 0.000933756, Final residual = 7.49315e-08, No Iterations 1
GAMG:  Solving for p, Initial residual = 7.71888e-05, Final residual = 3.25475e-13, No Iterations 1
GAMG:  Solving for p, Initial residual = 1.49854e-09, Final residual = 1.49854e-09, No Iterations 0
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0.00014808, global = -0.000129601, cumulative = -0.0697627
rho max/min : 2 0.5
GAMG:  Solving for p, Initial residual = 1.52653e-07, Final residual = 1.52653e-07, No Iterations 0
GAMG:  Solving for p, Initial residual = 1.52653e-07, Final residual = 1.52653e-07, No Iterations 0
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0.000148089, global = -0.000129601, cumulative = -0.0698923
rho max/min : 2 0.5
GAMG:  Solving for p, Initial residual = 1.52573e-07, Final residual = 1.52573e-07, No Iterations 0
GAMG:  Solving for p, Initial residual = 1.52573e-07, Final residual = 1.52573e-07, No Iterations 0
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0.000148089, global = -0.000129601, cumulative = -0.0700219
rho max/min : 2 0.5
smoothSolver:  Solving for omega, Initial residual = 2.31798e-06, Final residual = 1.30867e-10, No Iterations 1
bounding omega, min: -6301.47 max: 5.70133e+09 average: 2.17771e+06
smoothSolver:  Solving for k, Initial residual = 2.69839e-05, Final residual = 1.04992e-09, No Iterations 1
ExecutionTime = 62085.4 s  ClockTime = 83417 s

Courant Number mean: 0.000114789 max: 1
deltaT = 1.41799e-09
Time = 5.83257e-07

solidBodyMotionFunctions::rotatingMotion::transformation(): Time = 5.83257e-07 transformation: ((0 0 0) (0.999958 (0.00916165 0 0)))
AMI: Creating addressing and weights between 1900 source faces and 32076 target faces
AMI: Patch source sum(weights) min/max/average = 0.995459, 1, 0.999763
AMI: Patch target sum(weights) min/max/average = 0.468157, 1, 0.996805
AMI: Creating addressing and weights between 17748 source faces and 5456 target faces
AMI: Patch source sum(weights) min/max/average = 0.537877, 1.06201, 1.00015
AMI: Patch target sum(weights) min/max/average = 0.681757, 1.00303, 0.999863
AMI: Creating addressing and weights between 17839 source faces and 1957 target faces
AMI: Patch source sum(weights) min/max/average = 0.86998, 1, 0.999108
AMI: Patch target sum(weights) min/max/average = 0.991279, 1, 0.99992
GAMG:  Solving for pcorr, Initial residual = 1, Final residual = 0.00918253, No Iterations 49
GAMG:  Solving for pcorr, Initial residual = 0.0244148, Final residual = 0.00465114, No Iterations 1
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
rhoEqn max/min : 2.15666 0.1872
smoothSolver:  Solving for Ux, Initial residual = 3.25967e-05, Final residual = 2.1407e-09, No Iterations 1
smoothSolver:  Solving for Uy, Initial residual = 0.00157519, Final residual = 1.29333e-07, No Iterations 1
smoothSolver:  Solving for Uz, Initial residual = 0.00176436, Final residual = 1.35799e-07, No Iterations 1
smoothSolver:  Solving for h, Initial residual = 0.000915801, Final residual = 7.35108e-08, No Iterations 1
GAMG:  Solving for p, Initial residual = 7.69707e-05, Final residual = 3.22893e-13, No Iterations 1
GAMG:  Solving for p, Initial residual = 1.49221e-09, Final residual = 1.49221e-09, No Iterations 0
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0.000148538, global = -0.000130024, cumulative = -0.0701519
rho max/min : 2 0.5
GAMG:  Solving for p, Initial residual = 1.51827e-07, Final residual = 1.51827e-07, No Iterations 0
GAMG:  Solving for p, Initial residual = 1.51827e-07, Final residual = 1.51827e-07, No Iterations 0
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0.000148547, global = -0.000130024, cumulative = -0.0702819
rho max/min : 2 0.5
GAMG:  Solving for p, Initial residual = 1.51748e-07, Final residual = 1.51748e-07, No Iterations 0
GAMG:  Solving for p, Initial residual = 1.51748e-07, Final residual = 1.51748e-07, No Iterations 0
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
time step continuity errors : sum local = 0.000148547, global = -0.000130024, cumulative = -0.0704119
rho max/min : 2 0.5
smoothSolver:  Solving for omega, Initial residual = 2.31335e-06, Final residual = 1.3162e-10, No Iterations 1
bounding omega, min: -3196.96 max: 5.70337e+09 average: 2.17777e+06
smoothSolver:  Solving for k, Initial residual = 2.69244e-05, Final residual = 1.05185e-09, No Iterations 1
ExecutionTime = 62226.4 s  ClockTime = 83606 s

Courant Number mean: 0.000114768 max: 1
deltaT = 1.41798e-09
Time = 5.84675e-07

solidBodyMotionFunctions::rotatingMotion::transformation(): Time = 5.84675e-07 transformation: ((0 0 0) (0.999958 (0.00918393 0 0)))
AMI: Creating addressing and weights between 1900 source faces and 32076 target faces
AMI: Patch source sum(weights) min/max/average = 0.995457, 1, 0.999763
AMI: Patch target sum(weights) min/max/average = 0.468334, 1, 0.996805
AMI: Creating addressing and weights between 17748 source faces and 5456 target faces
AMI: Patch source sum(weights) min/max/average = 0.537262, 1.06316, 1.00015
AMI: Patch target sum(weights) min/max/average = 0.678559, 1.00301, 0.999883
AMI: Creating addressing and weights between 17839 source faces and 1957 target faces
AMI: Patch source sum(weights) min/max/average = 0.86998, 1, 0.999108
AMI: Patch target sum(weights) min/max/average = 0.991279, 1, 0.99992

Do i need to change solver for pressure and modify the tolerances. Please suggest

Tobi November 7, 2014 02:54

Hi,

my simulations are running on 40 cores 2 weeks ...
But you time step is very small and your density is wrong (I think)
Code:

rho max/min : 2 0.5
you make something wrong.
I dont know what because you do not share many details. You should check out you time steps... maybe your pressure, velocity, k, epsilon are expoding. As I can see, you should use the correct form of the PIMPLE algorithm. Maybe it will be stabilized. Checkout my blog or also available at the wiki.

Jetfire November 7, 2014 03:12

1 Attachment(s)
Quote:

Originally Posted by Tobi (Post 517844)
Hi,

my simulations are running on 40 cores 2 weeks ...
But you time step is very small and your density is wrong (I think)
Code:

rho max/min : 2 0.5
you make something wrong.
I dont know what because you do not share many details. You should check out you time steps... maybe your pressure, velocity, k, epsilon are expoding. As I can see, you should use the correct form of the PIMPLE algorithm. Maybe it will be stabilized. Checkout my blog or also available at the wiki.


Hi tobi,
My density is calculated based on inlet pressure and inlet temperature and it is 1.1845kg/m3. I have taken the FvSchemes and FvSolution files from the annularThermalMixer Tutorial under rhoPimpleDyMFoam as i am using the same solver and modified them. Can you please explain what values i should be giving for rho max/min: for my case.

My time step is calculated using courant no. formula co=delT*U/delX
I have set co max=1, my maximum velocity =78m/sec calculated using v = w*r
w=31415 rad/sec , radius of impeller r = 5cm. min cell volume from my mesh is 5.37e-16 so delX is approx =8e-06, delT i found is 5.2e-09.Is this the right approach???

I have invested a lot of time in setting up my boundary conditions in the 0 folder.
Attached is my 0 folder , please take a look and correct me if there is anything wrong.

You can also find detailed explaination of my simulation in this thread http://http://www.cfd-online.com/For...ledymfoam.html

Thanks

Tobi November 7, 2014 03:50

Quote:

Originally Posted by Jetfire (Post 517847)
You can also find detailed explaination of my simulation in this thread http://www.cfd-online.com/Forums/openfoam-solving/143340-compressor-simulation-using-rhopimpledymfoam.html

Thanks

Why do you make double posts?

@Bruno - please move all posts refered to Jetfire question to the given thread.
@Jetfire - double posts are not wished

I will answer you in your thread!


PS your link is wrong

Jetfire November 7, 2014 04:08

Sorry.

The correct link is
http://www.cfd-online.com/Forums/ope...ledymfoam.html

RodriguezFatz November 7, 2014 04:15

Hi,
Since Tobias uses this solver he will probably be the better contact, but here are some general things:
  1. Your omega equation is bounded, this is not good. You need to find the source of that. I would try to use "Gauss linear uncorrected" for the laplacian scheme (at least for omega equation).
  2. You run many solvers without any iteration. I would reduce the tolerance (if needed) or just reduce the number of innner iterations of the solver.
  3. Your first pcorr solving takes 49 iterations. I don't think this is good.
  4. You have a max Co number of 1. I don't think this is needed for solver "PIMPLE". Also the average Co is 1e-4. Thus, your mean flow moves 10000 times slower than in the fast / small cells. Can you try to spot the high Co cells and try to modify them, so Co gets smaller there?

Tobi November 7, 2014 04:16

Hello,

some hints and question:

  • I did not read the above things but are you familiar with openFOAM?
  • In my simulations the target and source faces are always the same for the AMI interface. In your case there are significant differences
  • Which density do you expect? I ask because your solver calculates higher and lower densitys that you wish to have. Therefor you cut it:

Code:

// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();

Calculation is done in pEqn.H and you can see it out of your output
Code:

rhoEqn max/min : 2.15688 0.182153 .
.
GAMG:  Solving for p, Initial residual = 1.49854e-09, Final residual = 1.49854e-09, No Iterations 0
rho max/min : 2 0.5  // CUTTED

That is because you set your min and max values in your fvSolution:
Code:

    rhoMin          rhoMin [ 1 -3 0 0 0 ] 0.5;   
    rhoMax          rhoMax [ 1 -3 0 0 0 ] 2.0;

Additionally you have problems with your omega (bounding extrem).
As I told you befor, you should use the correct PIMPLE ALGO with underrelaxation. I refer (again) to my blog or to the wiki. There you will get how to set up these parameters:
Code:

PIMPLE
{
    momentumPredictor  yes;
    transonic          no;
    nOuterCorrectors    1;
    nCorrectors        3;
    nNonOrthogonalCorrectors 1;
.
.
.
    residualControl {} ...
}

I suspect that you AMI interface is wrong
Code:

AMI: Creating addressing and weights between 1900 source faces and 32076 target faces
AMI: Patch source sum(weights) min/max/average = 0.99546, 1, 0.999763
AMI: Patch target sum(weights) min/max/average = 0.467982, 1, 0.996805
AMI: Creating addressing and weights between 17748 source faces and 5456 target faces
AMI: Patch source sum(weights) min/max/average = 0.538509, 1.06046, 1.00015
AMI: Patch target sum(weights) min/max/average = 0.685009, 1.00305, 0.999864
AMI: Creating addressing and weights between 17839 source faces and 1957 target faces
AMI: Patch source sum(weights) min/max/average = 0.86998, 1, 0.999108
AMI: Patch target sum(weights) min/max/average = 0.991279, 1, 0.99992

Never had something like that. Do you have more rotating zones?
Did you ever checked out if your mesh is okay?
Code:

checkMesh -constant
And did you ever control your AMI ?
Code:

moveDynamicMesh -checkAMI
  • change your smoother to PBiCG
  • If you are not certain which scheme you should use, first try always UPWIND, the reason is the physics! you can find a lot of schemes on my homepage.
  • Linear is always very unstable
  • linearUpwind can produce also unphysical values

Jetfire November 7, 2014 04:45

Hi Tobi,
Thanks for your reply

Meshing was done using ANSYS ICEM CFD and the simulation was already run on CFX which gave good results.My task is to simulate the same on OpenFOAM.

Code:

Did you ever checked out if your mesh is okay?
Yes checkMesh was OK

I have even checked whether my AMI Interfaces were correct using moveDynamicMesh -checkAMI and it had run without any errors. Checked the compressor rotation on ParaView and the rotation was fine.

Coming to my AMI Interfaces , i too have noticed that weights are not 1:1
but that is due to one interface on compressor being meshed with hex and it's neighbour interface on volute being meshed with tet elements. But as long as there is some weight matching the weight on target faces it is fine. This is not a problem as i have checked with moveDynamicMesh -checkAMI and it ran perfectly , otherwise i would have got errors there itself.

Please look at the mesh domain i have posted earlier in this thread.There is only one rotating zone but there are 3 interfaces.
1. inlet and rotor
2.rotor and volute
3.connection between volute and outlet

Tobi November 7, 2014 04:50

Quote:

Originally Posted by RodriguezFatz (Post 517859)
Hi,
Since Tobias uses this solver he will probably be the better contact, but here are some general things:
  1. Your omega equation is bounded, this is not good. You need to find the source of that. I would try to use "Gauss linear uncorrected" for the laplacian scheme (at least for omega equation)

Maybe Gauss linear limited corrected 1 should be the better choice. Uncorrected should always applied if you have a very good hex mesh.

-> red Line is wrong (SEE BELOW)

Quote:

Originally Posted by RodriguezFatz (Post 517859)
  1. You have a max Co number of 1. I don't think this is needed for solver "PIMPLE". Also the average Co is 1e-4. Thus, your mean flow moves 10000 times slower than in the fast / small cells. Can you try to spot the high Co cells and try to modify them, so Co gets smaller there?

Of course it is needed but as we all can see he is not using PIMPLE algorithm. He is using PISO!

Tobi November 7, 2014 04:54

Hi,

good to know, well done.
So then its clear that you have different faces.
But you are not using PIMPLE as I told you 2 times befor. Have a look into the blog, wiki.
Code:

Create mesh for time = 0 

Selecting dynamicFvMesh solidBodyMotionFvMesh
Selecting solid-body motion function rotatingMotion
Applying solid body motion to cellZone FLUID_ROTOR  PIMPLE:

Operating solver in PISO mode


RodriguezFatz November 7, 2014 04:59

Quote:

Originally Posted by Tobi (Post 517868)
Maybe Gauss linear limited corrected 1 should be the better choice.

Do you mean "Gauss linear limited 1"?
Quote:

Originally Posted by Tobi (Post 517868)
Uncorrected should always applied if you have a very good hex mesh.

I don't agree on that. If you have stability problems like we see here, you need to find the source. And since "corrected" scheme is unbounded this is a pretty common source for these omega-bounding errors. Trying "uncorrected" will indeed be much more imprecise but at (possibly) at least not result in negative, unphysical omega values.

RodriguezFatz November 7, 2014 05:02

Quote:

Originally Posted by Tobi (Post 517868)
Of course it is needed but...

Is this a typo?

Jetfire November 7, 2014 05:04

Hi tobi,
I do not know what min or max rho for which calculation be done
So according to you do i have to remove these lines from the pEqn.H file???
Code:

rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();

And also remove these line from my FvSolution file?
Code:

rhoMin          rhoMin [ 1 -3 0 0 0 ] 0.5;
 rhoMax        rhoMax [ 1 -3 0 0 0 ] 2.0;

Ok. I will refer your blog on how to set up the right settings for PIMPLE ALGORITHM and also for right schemes.

Tobi November 7, 2014 05:15

Hi Phillip,

sorry my fault (:
I mixed the things up!

  • corrected = unbounded
  • uncorrected = bounded
  • limited = blend between the above mentioned


I wanted to say to use that one:
Code:

Gauss linear limited 1  =  Gauss linear uncorrected
To the Co - number:
  • you need it to control your timestep
  • I agree that you should check your mesh and modify it if you have some bad cells that generate high "Co" numbers --> maxCo and averaged as you mentioned
  • But first, he should use the pimple algorithm instead of PISO. Its clear that if you use PISO mode you always have small time steps. At least I think Co = 1 for PISO is too high.

Tobi November 7, 2014 05:20

Quote:

Originally Posted by Jetfire (Post 517874)
Hi tobi,
I do not know what min or max rho for which calculation be done
So according to you do i have to remove these lines from the pEqn.H file???
Code:

rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
rho.relax();

And also remove these line from my FvSolution file?
Code:

rhoMin          rhoMin [ 1 -3 0 0 0 ] 0.5;
 rhoMax        rhoMax [ 1 -3 0 0 0 ] 2.0;

Ok. I will refer your blog on how to set up the right settings for PIMPLE ALGORITHM and also for right schemes.

No you do not have to remove.
First you calculate your density:
Code:

rho = thermo.rho()
Then you bound your density with:
Code:

rho = min(rho, rhoMax)
That means that if you calculated to high and to low values for rho than you expect (you set it in fvSolutions) then the solution is cutted. Means:

rho = 0.43 0.5
rho = 2.13 2.0

If the values are correct you have to change the cutted parameter in the fvSolution!
At least - please read the blog or wiki for PIMPLE!

Jetfire November 7, 2014 05:21

Hi,

I have nowhere mentioned PISO algorithm, i dont understand why it is running it in PISO.Can you help me understand what changes i have to make to run it on PIMPLE.

RodriguezFatz November 7, 2014 05:22

It's the "nOuterCorrectors". If set to "1", this is the same as running PISO algorithm. If set >1, it actually runs in real PIMPLE mode.

Solver PIMPLE solves multiple iterations of solver PISO during each time-step. So, if you just solve a single iteration of PISO (nOuterCorrectors=1) each time-step this comes up to PISO.

Jetfire November 7, 2014 05:26

I am not able to open your blog , i get this :(

Your host needs to use PHP 5.3.10 or higher to run this version of Joomla!

Tobi November 7, 2014 05:31

Quote:

Originally Posted by RodriguezFatz (Post 517880)
It's the "nOuterCorrectors". If set to "1", this is the same as running PISO algorithm. If set >1, it actually runs in real PIMPLE mode.

At least I mentioned it 4 times now!
If you want to use PIMPLE and how it is working - go to my blog. I think you are too lazy to click on my blog on the left of that post :D so I be kind:

BLOG

WIKI

I hope you will check it out now. There is everything mentioned - also like Philipp told you! You do not use the PIMPLE loop due to your settings in your fvSolution.

Blog is on cfd-online :p

Jetfire November 7, 2014 05:33

Checking it now :)

I really thank you both for taking out your precious time and helping me out.
Thanks a lot!

RodriguezFatz November 7, 2014 06:50

Does the omega-bounding vanish, if you use the laplacian-setting I suggested?

Jetfire November 10, 2014 00:51

Hi,
Sorry for the late reply , i was not at the work station

for the rhomin/max , with reference to the air properties at atmospheric pressure in the link http://www.engineeringtoolbox.com/ai...ies-d_156.html
I think my rhomin/max should not exceed the limits 0.524/2.793. But looking at the output there are timeSteps deviating from this for example.
Code:

rhoEqn max/min : 2.15688 0.182153 . . GAMG:  Solving for p, Initial residual = 1.49854e-09, Final residual = 1.49854e-09, No Iterations 0  rho max/min : 2 0.5
Why is this happening ? any idea.


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