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

CompressibleInterFoam negative T

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 3, 2017, 21:24
Default CompressibleInterFoam negative T
  #1
New Member
 
Join Date: Sep 2017
Posts: 7
Rep Power: 8
Genji is on a distinguished road
Hello everyone
I'm running a case with compressibleInterFoam where a hot, less dense gas enters an 1 block mesh from an inlet on the ground, and very soon the simulation breaks down because i get negative T. I have tried to change a few things to no avail. This case was adapted from an earlier iteration with interFoam, which worked fine. Below are my files :

U
Code:
dimensions      [0 1 -1 0 0 0 0];//kg m s K mol A cd

internalField   uniform (0 0 0);//Initially the velocity is (0 0 0) m/s

boundaryField
{
    inlet
    {
    type             turbulentInlet;
	referenceField		uniform (0 0 10.5);
	fluctuationScale  		(0.1 0.1 0.5);
	value		uniform (0 0 10.5); 
    }

    outlet
    {

        type            pressureInletOutletVelocity;
        value           uniform (0 0 0);
    }

    floor
    {
        type            noSlip;
    }

    fixedWalls
    {
        type            noSlip;
    }
	ceiling
    {
        type            noSlip;
    }
	
}
T

Code:
dimensions      [0 0 0 1 0 0 0];

internalField   uniform 300;

boundaryField
{
    inlet
    {
        type            fixedValue;
        value           uniform 700;
    }

    outlet
    {
		type            zeroGradient;
                phi             rhoPhi;

    }

    floor
    {
        type            zeroGradient;

    }

    fixedWalls
    {
        type            zeroGradient;
    }
	ceiling
    {
        type            zeroGradient;
    }
	
}
p

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

internalField   uniform 1e5;

boundaryField
{

    inlet
    {
        type               calculated;
        value              $internalField;
    }

    outlet
    {

        type               calculated;
        value              $internalField;
    }

    floor
    {
        type               calculated;
        value              $internalField;
    }

    fixedWalls
    {
        type               calculated;
        value              $internalField;
    }
	ceiling
    {
        type               calculated;
        value              $internalField;;
    }

}
p_rgh

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

internalField   uniform 1e5;

boundaryField
{

    inlet
    {
        type            fixedFluxPressure;
		phi             rhoPhi;
        rho             rho;
        value           uniform 1e5;
    }

    outlet
    {
        type            totalPressure;
		phi             rhoPhi;
        rho             rho;
        p0              uniform 1e5;
    }

    floor
    {
        type            fixedFluxPressure;
		phi             rhoPhi;
        rho             rho;
        value           uniform 1e5;
    }

    fixedWalls
    {
        type            fixedFluxPressure;
		phi             rhoPhi;
        rho             rho;
        value           uniform 1e5;
    }
	ceiling
    {
        type            fixedFluxPressure;
		phi             rhoPhi;
        rho             rho;
        value           uniform 1e5;
    }

}
alpha.gas

Code:
dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    inlet
    {
        type            fixedValue;
	value	 	uniform 1;
    }

    outlet
    {

        type            inletOutlet;
        inletValue      uniform 0;
        value           uniform 0;
    }

    floor
    {
        type            zeroGradient;
    }

    fixedWalls
    {
        type            zeroGradient;
    }
	ceiling
    {
        type            zeroGradient;
    }

}
blockMeshDict
(inlet and outlet are mad with TopoSet and CreatePatch)

Code:
convertToMeters 1;

vertices
(
	(0 0 0)
	(10 0 0)
	(10 10 0)
	(0 10 0)
	(0 0 15)
	(10 0 15)
	(10 10 15)
	(0 10 15)
	
);

blocks
(
    hex (0 1 2 3 4 5 6 7) (40 40 60) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
	
	
    floor
    {
        type wall;
        faces
        (
            
			(0 3 2 1)
        );
    }
    ceiling
    {
        type wall;
        faces
        (
            
			(4 5 6 7)
        );
    }
    fixedWalls
    {
        type wall;
        faces
        (
            (0 4 7 3)
            (2 6 5 1)
            (1 5 4 0)
            (3 7 6 2)
        );
    }
);

mergePatchPairs
(
);
fvSchemes

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

ddtSchemes
{
    default         Euler;
}

gradSchemes
{
    default             Gauss linear;
    grad(U)             cellLimited Gauss linear 1;
}

divSchemes
{
    default         none;
    div(rhoPhi,U)       Gauss linearUpwind grad(U);
    div(phi,alpha)      Gauss vanLeer;
    div(phirb,alpha)    Gauss linear;
    div(rhoPhi,K)       Gauss linear;
    div(rhoPhi,T)       Gauss linear;
    div(phi,thermo:rho.gas) Gauss linear;
    div(phi,thermo:rho.air) Gauss linear;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
    div((phi+meshPhi),p)    Gauss linear;

    div((muEff*dev2(T(grad(U))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}
fvSolution

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



solvers
{
	
	"alpha.gas.*"
	{
		nAlphaCorr      2;
		nAlphaSubCycles 1;
		cAlpha          1.5;
	
		MULESCorr       yes;
		nLimiterIter    3;
	
		solver          smoothSolver;
		smoother        symGaussSeidel;
		tolerance       1e-8;
		relTol          0;
	}

     cellDisplacement
    {
        solver          GAMG;
        tolerance       1e-5;
        relTol          0;
        smoother        GaussSeidel;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

    "rho.*|pcorr.*"
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance       1e-8;
        relTol          0;
    }

    p_rgh
    {
        solver           GAMG;
        tolerance        1e-8;
        relTol           0.05;
        smoother         DICGaussSeidel;
        nPreSweeps       0;
        nPostSweeps      2;
        cacheAgglomeration on;
        agglomerator     faceAreaPair;
        nCellsInCoarsestLevel 10;
        mergeLevels      1;
    }

    p_rghFinal
    {
        $p_rgh;
        tolerance       1e-08;
        relTol          0;
    }

    "(U|k|epsilon|T)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-08;
        relTol          0.1;
    }

    "(U|k|epsilon|T)Final"
    {
        $U;
        tolerance       1e-08;
        relTol          0;
    }

}

PIMPLE
{
    momentumPredictor no;
    nOuterCorrectors 2;
    nCorrectors      4;

    nNonOrthogonalCorrectors 1;

    correctPhi              yes;

    checkMeshCourantNo      no;
    moveMeshOuterCorrectors no;

    transonic   false;
}

relaxationFactors
{
    fields
    {
    }
    equations
    {
        ".*"    1;
    }
}

// ************************************************************************* //
thermophysicalProperties

Code:
phases (gas air);

pMin            pMin [1 -1 -2 0 0 0 0] 1000;

sigma           sigma [1 0 -2 0 0 0 0] 0;
thermophysicalProperties.air

Code:
thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        molWeight   28.9;
    }
    thermodynamics
    {
        Cp          1.005;
        Hf          0;
    }
    transport
    {
        mu          1.48e-05;
        Pr          0.7;
    }
}
thermophysicalProperties.gas

Code:
thermoType
{
  
	
	type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}

mixture
{
    specie
    {
        molWeight   44.0;
    }
    equationOfState
    {
        rho         1;
    }
    thermodynamics
    {
        Cp          1.116;
        Hf          0;
    }
    transport
    {
        mu          1e-6;
        Pr          0.713;
    }
}
transportProperties

Code:
phases (gas air);

gas 
{
    transportModel  Newtonian;//Newtonian fluid assumed
    nu              [0 2 -1 0 0 0 0] 1e-06;
    rho             [1 -3 0 0 0 0 0] 0.6;
	
}

air
{
    transportModel  Newtonian;
    nu              [0 2 -1 0 0 0 0] 1.48e-05;
    rho             [1 -3 0 0 0 0 0] 1;
	
}

sigma           [1 0 -2 0 0 0 0] 0;//surface tension of gas/air
and i don't calculate turbulence so I have a laminar model.

If anyone could tell me anything I'm missing here, it would be much appreciated.

Best regards.

Last edited by Genji; November 5, 2017 at 11:32.
Genji is offline   Reply With Quote

Old   January 9, 2018, 06:42
Default
  #2
New Member
 
Join Date: May 2017
Posts: 7
Rep Power: 8
tian_lei is on a distinguished road
hello

Is this tutorial working ?
tian_lei 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] mesh airfoil NACA0012 anand_30 OpenFOAM Meshing & Mesh Conversion 13 March 7, 2022 17:22
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 05:42
[blockMesh] error message with modeling a cube with a hold at the center hsingtzu OpenFOAM Meshing & Mesh Conversion 2 March 14, 2012 09:56
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00


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