CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

Injection molding solver for OpenFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree2Likes
  • 2 Post By krikre

Reply
 
LinkBack Thread Tools Display Modes
Old   May 29, 2017, 06:44
Default Injection molding solver for OpenFOAM
  #1
New Member
 
Kristjan
Join Date: Apr 2017
Location: Slovenia
Posts: 2
Rep Power: 0
krikre is on a distinguished road
Hello everybody!

I'd like to invite anyone who's interested to try out our solver for injection molding https://github.com/krebeljk/openInjMoldSim. I'd be very grateful for any kind of feedback.

We implemented the Tait-equation of state and the Cross-WLF model in compressibleInterFoam from OpenFOAM version 3.0.1 and named it openInjMoldSim. Along the solver there are four cases: a demo case for filling and packing and three tests.

The demonstration of filling and packing compares the simulated pressures with experimental values. The cavity is modeled as a 2D case. The experimental pressure evolution from the first measuring position is imposed at one end of the cavity and the other two positions are compared.

The validations test
  • the Cross-WLF viscosity in a perfect shearing flow at a particular temperature,
  • the heat transfer coefficient in a quasi 1D dimensional heat conduction case and
  • the Tait equation for a confined material being heated and pressurized.

The cases include gnuplot and python scripts to plot the results.
elvis and Klemen like this.
krikre is offline   Reply With Quote

Old   June 8, 2017, 10:17
Default Trouble finding a converged solution
  #2
New Member
 
Kristjan
Join Date: Apr 2017
Location: Slovenia
Posts: 2
Rep Power: 0
krikre is on a distinguished road
Edit:
It looks like a common convergence issue. I'm looking into:
Convergence
How to use PIMPLE properly?
Also, I think there was a mistake in the fvSolution file, where under-relaxation for p was set instead of p_rgh.


Trouble finding a converged solution
I'd like to ask for some help with setting up the demo case. The simulation finishes but the solution looks invalid. So far I tried setting stricter convergence tolerances but with limited success.
I described the case and what I tried in a readme file in the repository on a new branch. Please see the link, because there are more images and details (plus all the files).

I first copied the demo case (fill_pack_00) and simplified it: made the flow practically single phase and more or less isothermal (cases pack_01 ... pack_04). The tolerances were made stricter in the cases pack_05 ... pack_09. This was then also attempted in the demo case: fill_pack_01.

In the following I try to state the relevant facts so the text is a bit dull, but please let me know if there's something else I can provide.

The case (fill_pack_00)
The solver used is basically compressibleInterFoam (OpenFOAM 3.0.1) but with some modifications. Cavity (2D) of 1.2 mm thickness and length of approx. 65 mm is being filled by polymer (melt temperature 230 degC) through the inlet - a pressure boundary condition is prescribed and the experimental pressure evolution P1 is imposed. When the cavity is full (t=0.15s), the outlet is closed and the pressure is still applied at the inlet forcing the material to compress. At the same time the polymer is cooling (mold temperature 50 degC) - heat transfer coefficient on the walls 1.25 kW/(m2K). At about 100 degC the material solidifies - the viscosity is increased to 100 MPas.
Note also, that the viscosity is pressure dependent. Removing the dependence appears to make the issue less severe but not vanish.
The packing phase is divided into pack1 phase with the result write frequency of 0.01s and pack2 phase starting at t=1s and the result write frequency of 0.1s finishing at t=6s.



The issue
The cavity pressure should not be greater than the injection pressure. A smoother solution is expected.


Simplification (cases: pack_01, ...)
The demo case is copied and the simulation of the filling stage is removed (skipped) by modifying the AllRun script. The call to setFields is also removed to simply start with a full cavity.
The mold temperature is set to 230 degC which is equal to the melt temperature making heat transfer insignificant, again eliminating complexity. The outlet patch still transfers heat (mold temperature 50 degC by mistake) but this has little effect.


Attempt to resolve

A fixed timestep of 1e-5s is prescribed - at least 10 times shorter than the automatically chosen in pack_04. One second of simulated time required almost 3h of calculation on a laptop. The result appears resonable.


Alternative attempt
The PIMPLE p_rgh tolerance set to 1e-5 Pa. Solution improved with respect to the case pack_04. Calculation takes 30 min on a regular laptop.
The value 1e-5 Pa made the solver do more iterations but has no physical significance.

Applying the alternative atempt to the demo case
The anomaly at the start of packing is resolved but the issue remains. Non-smoothness is evident at t=1s which is when the pack2 phase starts.


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

solvers
{
    alpha.poly
    {
        nAlphaCorr      1;
        nAlphaSubCycles 1;
        cAlpha          1;
    }

    ".*(rho|rhoFinal)"
    {
        solver          diagonal;
    }

    pcorr
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance       1e-05;
            relTol          0;
            smoother        DICGaussSeidel;
            nPreSweeps      0;
            nPostSweeps     2;
            nFinestSweeps   2;
            cacheAgglomeration true;
            nCellsInCoarsestLevel 10;
            agglomerator    faceAreaPair;
            mergeLevels     1;
        }
        tolerance       1e-05;
        relTol          0;
        maxIter         100;
    }

    p_rgh
    {
        solver          GAMG;
        tolerance       1e-07;
        relTol          0.01;
        smoother        DIC;
        nPreSweeps      0;
        nPostSweeps     2;
        nFinestSweeps   2;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

    p_rghFinal
    {
        solver          PCG;
        preconditioner
        {
            preconditioner  GAMG;
            tolerance       1e-07;
            relTol          0;
            nVcycles        2;
            smoother        DICGaussSeidel;
            nPreSweeps      2;
            nPostSweeps     2;
            nFinestSweeps   2;
            cacheAgglomeration true;
            nCellsInCoarsestLevel 10;
            agglomerator    faceAreaPair;
            mergeLevels     1;
        }
        tolerance       1e-07;
        relTol          0;
        maxIter         20;
    }

    U
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        tolerance       1e-06;
        relTol          0;
        nSweeps         1;
    }

    "(T|k|B|nuTilda).*"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-08;
        relTol          0;
    }
}

PIMPLE
{
    momentumPredictor no;
    transonic       no;
    nOuterCorrectors 1000;
    nCorrectors     2;
    nNonOrthogonalCorrectors 0;

    residualControl
    {
        p_rgh
        {
                tolerance   1.0;
                relTol      0;
        }
        T
        {
                tolerance   0.01;
                relTol      0;
        }
        /*p
        {
                tolerance   1e6;
                relTol      1e-2;
        }*/
     }
}

relaxationFactors
{
    fields
    {
        p      0.3;
        pFinal   1;
        T      0.3;
    }
    equations
    {
        "U|k|epsilon|T"     0.3;
        "(U|k|epsilon|T)Final"   1;
    }
}


// ************************************************************************* //
fvSchemes
I haven't tried anything new in this file.
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  3.0.1                                 |
|   \\  /    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
{
    div(phi,alpha)  Gauss vanLeer;
    div(phirb,alpha) Gauss linear;

    div(rhoPhi,U)  Gauss upwind;
    div(phi,thermo:rho.poly) Gauss upwind;
    div(phi,thermo:rho.air) Gauss upwind;
    div(rhoPhi,T)  Gauss upwind;
    div(rhoPhi,K)  Gauss upwind;
    div(phi,p)      Gauss upwind;
    div(phi,k)      Gauss upwind;

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

laplacianSchemes
{
    default         Gauss linear uncorrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         uncorrected;
}

// ************************************************************************* //
Attached Images
File Type: jpg fill_pack_geom.jpg (25.5 KB, 37 views)
File Type: png fill_pack_00.png (83.7 KB, 32 views)
File Type: png pack_04.png (68.2 KB, 32 views)
File Type: png pack_05.png (58.5 KB, 33 views)
File Type: png fill_pack_01.png (87.7 KB, 32 views)

Last edited by krikre; June 9, 2017 at 10:10.
krikre is offline   Reply With Quote

Reply

Tags
injection molding, solver

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
fluent divergence for no reason sufjanst FLUENT 2 March 23, 2016 17:08
injection problem Mark New FLUENT 0 August 4, 2013 01:30
3d vof Smaras FLUENT 2 February 19, 2013 07:58
Quarter Burner mesh with periosic condition SamCanuck FLUENT 2 August 31, 2011 11:34
why the solver reject it? Anyone with experience? bearcat CFX 6 April 28, 2008 14:08


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