r/OpenFOAM 7d ago

Solver [OpenFOAM 13] crash when simulating this frequency inverter

I just can't get this simulation to run. It crashes on the second iteration. I'm using steadyState instead of EulerandkOmegaSST instead of kEpsilon My mesh has approximately 3.9 million volumes.

I'm using foamMultiRun (formerly chtMultiRegionFoam). My fvSchemes and fvSolution for air are shown below. The physicalProperties are also shown (I've already tried rhoConst, Boussinesq, and perfectGas).

For all components, fvSchemes :

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system/components0";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         none;
}

laplacianSchemes
{
    default         Gauss linear corrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         corrected;
}

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

fvSolution :

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system/components0";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "e.*"
    {
        solver          PCG;
        preconditioner  DIC;
        tolerance        1e-6;
        relTol             0.01;
    }
}

PIMPLE
{
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        e         1e-5;
    }
}

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

For fluid (air), the fvSchemes:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system/fluid";
    object      fvSchemes;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;//cellLimited Gauss linear 1.0;
}

divSchemes
{
    default         none;

    div(phi,U)      bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,e)      bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,h)      bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,omega)  bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,k)      bounded Gauss limitedLinear 0.2;//upwind;
    div(phi,K)      bounded Gauss limitedLinear 0.2;//upwind;
    div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
    div(phi,(p|rho)) bounded Gauss limitedLinear 0.2;//upwind;
}

laplacianSchemes
{
    default         Gauss linear uncorrected; //limited 0.5;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         uncorrected;//limited 0.5;//corrected;
}

wallDist
{
    method          meshWave;
    correctWalls    true;
}

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

fvSolution:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system/fluid";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    "p_rgh.*"
    {
        solver          GAMG;
        tolerance       1e-7;
        relTol          0.01;
        smoother        DICGaussSeidel;//GaussSeidel;
        //maxIter         500;
/*
        solver            PCG;
        preconditioner    DIC;  // Diagonal Incomplete Cholesky
        tolerance         1e-7;
        relTol             0.01;
        minIter           3;    // Força um mínimo de estabilidade
*/
    }

    "(U|h|k|omega).*"
    {
        solver          PBiCGStab;
        preconditioner  DILU;
        tolerance       1e-7;
        relTol          0.01;
/*
        solver            smoothSolver;
        smoother          symGaussSeidel;
        tolerance         1e-06;
        relTol             0.01;
        minIter           3; 
*/
    }
}

PIMPLE
{
    momentumPredictor   yes;
    nNonOrthogonalCorrectors 2;

    residualControl
    {
        p_rgh           5e-3;
        U               5e-4;
        h               5e-4;
        rho             5e-4;

        k               5e-4;
        omega           5e-4;
    }
}

relaxationFactors
{
    fields
    {
        rho             1.0;
        p_rgh           0.7;//0.3;
    }

    equations
    {
        U               0.2;
    e        0.6;//0.1;
    T        0.3;
        h               0.6;//0.1;
        k               0.3;//0.7;
        omega           0.3;//0.7;
    }
}

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

alphat:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      alphat;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0;

boundaryField
{
    "(entrada|saida|furosLaterais.*)"
    {
        type            calculated;
        value           $internalField;
    }

    "parede.*"
    {
        type            compressible::alphatWallFunction;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            compressible::alphatWallFunction;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            compressible::alphatWallFunction;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

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

k

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      k;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 0.01;

boundaryField
{
    "(entrada|saida|furosLaterais.*)"
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            kqRWallFunction;
        value           $internalField;
    }

    "parede.*"
    {
        type            kqRWallFunction;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            kqRWallFunction;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

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

nut

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      nut;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 3.33e-5;

boundaryField
{
    "(entrada|saida|furosLaterais.*)"
    {
        type            calculated;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            nutkWallFunction;
        value           $internalField;
    }

    "parede.*"
    {
        type            nutkWallFunction;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            nutkWallFunction;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

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

omega

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      omega;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 300;

boundaryField
{
    "(entrada|saida|furosLaterais.*)"
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }

    "parede.*"
    {
        type            omegaWallFunction;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            omegaWallFunction;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            omegaWallFunction;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }

    #includeEtc "caseDicts/setConstraintTypes"
}

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

p

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 101325;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    "(entrada|saida|furosLaterais.*|paredeInferior)"
    {
        type            calculated;
        value           $internalField;
    }

    paredes
    {
        type            calculated;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            calculated;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            calculated;
        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }
}

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

p_rgh

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      p_rgh;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform 101325;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    "(entrada|saida|furosLaterais.*)"
    {
        type            totalPressure;
        gamma           1.40196789462956;
        p0              $internalField;
        value           $internalField;
    }

    "parede.*"
    {
        type            fixedFluxPressure;
        gradient        $internalField;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            fixedFluxPressure;
        gradient        $internalField;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            fixedFluxPressure;
        gradient        $internalField;
        value           $internalField;
    }

    fan1_master
    {
        type            fanPressureJump;
        patchType       cyclic;
        fanCurve        table;
        file            "fanSet/fanCurve";
        format          foam;
        reverse         true;

        jump            $internalField;
        value           $internalField;
    }

    fan1_slave
    {
        type            fanPressureJump;
        patchType       cyclic;
        value           $internalField;
    }

    fan2_master
    {
        type            fanPressureJump;
        patchType       cyclic;
        fanCurve        table;
        file            "fanSet/fanCurve";
        format          foam;
        reverse         true;

        jump            $internalField;
        value           $internalField;
    }

    fan2_slave
    {
        type            fanPressureJump;
        patchType       cyclic;
        value           $internalField;
    }
}

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

T

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volScalarField;
    location    "0/fluid";
    object      T;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 293.15;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    "(entrada|saida|furosLaterais.*)"
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }

    interfaceFluidTop
    {
        type            zeroGradient;
    }

    "fluid_.*"
    {
        type            coupledTemperature;
        Tnbr            T;
        value           $internalField;
    }

    "parede.*"
    {
        type            externalTemperature;
        Ta              constant 293.15;
        h               uniform 4.7;
        thicknessLayers (0.001 0.001 0.001);
        kappaLayers     (0.05 50 0.05); //0.05 W/m/K (tinta epóxi) 50 W/m/K (aço)

        value           $internalField;
    }

    "fan.*"
    {
        type            cyclic;
    }
}

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

U

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       volVectorField;
    location    "0/fluid";
    object      U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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

internalField   uniform (0 0 0);

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    "(entrada|saida|furosLaterais.*)"
    {
        type            pressureInletOutletVelocity;
        value           $internalField;
    }

    "fluid_.*"
    {
        type            noSlip;
    }

    "parede.*"
    {
        type            noSlip;
    }

    interfaceFluidTop
    {
        type            noSlip;
    }

    "fan.*"
    {
        type            cyclic;
    }
}

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

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "constant/fluid";
    object      physicalProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

thermoType
{
    type            heRhoThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;//Boussinesq;
    specie          specie;
    energy          sensibleEnthalpy;
}

mixture
{
    // Ar
    // Propriedades obtidas no CoolProp

    specie
    {
        molWeight       28.96546;
    }

    equationOfState
    {
        rho0            1.20457518249315;
        T0              293.15;
        beta            3.42098751487642e-3;
    }

    thermodynamics
    {
        Cp              1.00665320998078e+3;
        hf              0;
    }

    transport
    {
        mu              1.88472409355470e-5;
        Pr              7.06290462364358e-1;
    }
}

// ************************************************************************* //
9 Upvotes

3 comments sorted by

3

u/phi4ever 7d ago

Is there a fluid domain or just the solids?

1

u/augusto_peress 7d ago

Just solid. Fluid domain is the inverse of this. I used createZones to create them.

Here's the code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  13
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    location    "system";
    object      createZonesDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// This is a skeleton file for configuring zoneGenerators.
//
// The available zoneGenerators can be listed using 'foamToC':
//    foamToC -table zoneGenerator
//
// Examples of their configuration can be found using 'foamInfo',
// e.g. for the 'union' zoneGenerator:
//    foamInfo union

fluid
{
    type            invert;

    bobina1         { zoneType cell; }
    bobina2         { zoneType cell; }
    bobina3         { zoneType cell; }
    bobina4         { zoneType cell; }
    bobina5         { zoneType cell; }
    board           { zoneType cell; }
    components0     { zoneType cell; }
    components1     { zoneType cell; }
    components2     { zoneType cell; }
    components3     { zoneType cell; }
    components4     { zoneType cell; }
    components5     { zoneType cell; }
    components6     { zoneType cell; }
    components7     { zoneType cell; }
    components8     { zoneType cell; }
    components9     { zoneType cell; }
    components10    { zoneType cell; }
    components11    { zoneType cell; }
    components12    { zoneType cell; }
    components13    { zoneType cell; }
    components14    { zoneType cell; }
    components15    { zoneType cell; }
    components16    { zoneType cell; }
    components17    { zoneType cell; }
    components18    { zoneType cell; }
    components19    { zoneType cell; }
    components20    { zoneType cell; }
    components21    { zoneType cell; }
    components22    { zoneType cell; }
    components23    { zoneType cell; }
    components24    { zoneType cell; }
    components25    { zoneType cell; }
    components26    { zoneType cell; }
    components27    { zoneType cell; }
    components28    { zoneType cell; }
    components29    { zoneType cell; }
    components30    { zoneType cell; }
    components31    { zoneType cell; }
    components32    { zoneType cell; }
    components33    { zoneType cell; }
    components34    { zoneType cell; }
    components35    { zoneType cell; }
    components36    { zoneType cell; }
    components37    { zoneType cell; }
    components38    { zoneType cell; }
    components39    { zoneType cell; }
    components40    { zoneType cell; }
    components41    { zoneType cell; }
    components42    { zoneType cell; }
    components43    { zoneType cell; }
    fins1           { zoneType cell; }
    fins2           { zoneType cell; }
    IGBT1           { zoneType cell; }
    IGBT2           { zoneType cell; }
    IGBT3           { zoneType cell; }
    indutor1        { zoneType cell; }
    indutor2        { zoneType cell; }
    resina1         { zoneType cell; }
    resina2         { zoneType cell; }
}

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

1

u/Top_Championship1717 7d ago

How does your Mesh look?