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

Add PIMPLE instade of SIMPLE

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 8, 2017, 16:05
Default Add PIMPLE instade of SIMPLE
  #1
Senior Member
 
sheaker's Avatar
 
Oskar
Join Date: Nov 2015
Location: Poland
Posts: 184
Rep Power: 11
sheaker is on a distinguished road
Hello dear Foamers. I'm using openFoam ext 1.6 to do some internal combustion engine simulations with sonicTurbDyMEngineFoam . To keep Courant number below 1, timestep must be set to 1.5e^-7s. For a simple geometry, it takes 90000sec to simulate 720 CA degree. Geometry example:
https://www.youtube.com/watch?v=THJvHIk0n0Y
https://www.youtube.com/watch?v=jVls41R8j_c

I decided to add PIMPLE loop instead of SIMPLE for sonicTurbDyMEngineFoam to increase maximum Courant Number and to gain some experience in modifying solvers. It shouldn’t be very complicated for the beginners.
First of all I have changed sonicTurbDyMEngineFoam.C from

Code:
  [...]
#       include "rhoEqn.H"

        // --- SIMPLE loop
        for (int corr=1; corr<=nCorr; corr++)
        {
#           include "UEqn.H"

#           include "hEqn.H"

#           include "pEqn.H"
        }

        turbulence->correct();
  [...]
To
Code:
  [...]
//        PIMPLE LOOP
        for (int oCorr=0; oCorr<nOuterCorr; oCorr++)
            {
#           include "rhoEqn.H"
#           include "UEqn.H"
#           include "hEqn.H"
            // --- PISO loop
            for (int corr=1; corr<=nCorr; corr++)
                {
#               include "pEqn.H"
                }

            turbulence->correct();
            }        
    [...]
There is nothing new here – only additional loops.

Then I have changed from
Code:
  #include <readPISOcontrols.H>
to
Code:
  #include <readPIMPLEcontrols.H>
in two files: sonicTurbDyMEngineFoam.C and readControls.H to read PIMPLE instead of PISO sets.


Is that solver properly prepared? I have compiled it (with different name) but with warnings about no used variables like nNonOrthoCorr, etc. . I think those warnings comes from nowhere because those warnings appears also when I compile original solver.

In case from sonicTurbDyMEngineFoam I have only modify fvSolutions from:
Code:
  PISO                                                     
  {
      // SIMPLE correctors
      nOuterCorrectors   2;
   
      // PISO correctors
      nCorrectors        3;
   
      momentumPredictor yes;
      transonic         no;
      nNonOrthogonalCorrectors 0;
  }
   
  relaxationFactors
  {
      U          0.7;
      p          0.25;
      h          0.5;
      k          0.7;
      epsilon    0.7;
  }
To
Code:
  PIMPLE
  {
      nNonOrthogonalCorrectors 0;
      nCorrectors          3;
      nOuterCorrectors    10;
   
      residualControl
      {
          U
          {
                  tolerance  1e-8;
                  relTol      0.01;
          }
          p
          {
                  tolerance  1e-7;
                  relTol      0;
          }
                  k
                  {
                  tolerance  1e-8;
                  relTol      0.01;
                  }
                  epsilon
                  {
                  tolerance  1e-8;
                  relTol      0.01;
                  }
                  h
                  {
                  tolerance  1e-8;
                  relTol      0.01;
                  }
       }
  }
   
  relaxationFactors
  {
      fields
      {
          p      0.25;
          pFinal   1;
      }
      equations
      {
          U    0.7;
                  h             0.5;
                  k             0.7;
                  epsilon 0.7;
          "(U|h|k|epsilon)Final"   1;
      }
  }
Is that case properly prepared? I can run it but after 10CA, when maximum velocity occure, the following error appears:

Code:
[...]
    From function specieThermo<thermo>::T(scalar f, scalar T0, scalar (specieThermo<thermo>::*F)(const scalar) const, scalar (specieThermo<thermo>::*dFdT)(const scalar) const) const
    in file /home/sheaker/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 73
    Maximum number of iterations exceeded.  Rescue by HJ

    From function specieThermo<thermo>::T(scalar f, scalar T0, scalar (specieThermo<thermo>::*F)(const scalar) const, scalar (specieThermo<thermo>::*dFdT)(const scalar) const) const
    in file /home/sheaker/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 73
    Maximum number of iterations exceeded.  Rescue by HJ

    From function specieThermo<thermo>::T(scalar f, scalar T0, scalar (specieThermo<thermo>::*F)(const scalar) const, scalar (specieThermo<thermo>::*dFdT)(const scalar) const) const
    in file /home/sheaker/OpenFOAM/OpenFOAM-1.6-ext/src/thermophysicalModels/specie/lnInclude/specieThermoI.H at line 73
    Maximum number of iterations exceeded.  Rescue by HJ
BiCGStab:  Solving for epsilon, Initial residual = 3.61942e-05, Final residual = 6.94297e-13, No Iterations 1
bounding epsilon, min: 1.68981e-20 max: 2.56723e+07 average: 70394.6
BiCGStab:  Solving for k, Initial residual = 0.0717658, Final residual = 1.22763e-12, No Iterations 1
bounding k, min: -3.38742 max: 544.101 average: 5.35043
diagonal:  Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
Floating point exception (core dumped)
sheaker@sheakerLAPTOP:~/sonicTDMEFoamPIMPLEtest$
I had similar errors when I set Courant number to 2 and ran simulation with SIMPLE loop. So it looks like adding PIMPLE loop decrease stability... Or rather I have done something wrong. I believe some of You are experienced in coding and could give me a hint, maybe.

I wish You all good time. Thank You for reading.
sheaker

Last edited by sheaker; April 18, 2017 at 05:42.
sheaker is offline   Reply With Quote

Old   April 8, 2017, 16:28
Default
  #2
Senior Member
 
piu58's Avatar
 
Uwe Pilz
Join Date: Feb 2017
Location: Leipzig, Germany
Posts: 744
Rep Power: 15
piu58 is on a distinguished road
Without analysing all the material:

The need of a very small time step is often caused by a unbalanced mesh: The Co number is very different in different parts of the mesh. The solution log gives max and min Co number so you may look at this. A relation of 10 may be acceptable, much higher quotients needs to work at the mesh.
__________________
Uwe Pilz
--
Die der Hauptbewegung überlagerte Schwankungsbewegung ist in ihren Einzelheiten so hoffnungslos kompliziert, daß ihre theoretische Berechnung aussichtslos erscheint. (Hermann Schlichting, 1950)
piu58 is offline   Reply With Quote

Old   April 8, 2017, 16:46
Default
  #3
Senior Member
 
sheaker's Avatar
 
Oskar
Join Date: Nov 2015
Location: Poland
Posts: 184
Rep Power: 11
sheaker is on a distinguished road
Thank You Uwe for Your replay. The mesh is pretty simple, the simulation is not steady-state and in different timesteps different velocities occur in some regions so it is rather impossible to keep maxCo / minCo = 10 without auto remeshing.
After all I would really like to understand how to successfully add the PIMPLE algorithm because I think there is a problem with my implementation or case setup.

Have a nice day.
sheaker
sheaker 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
[DesignModeler] add two area around Cylinder in ansys sajjadcheraghian ANSYS Meshing & Geometry 0 May 23, 2016 13:42
error while running modified pimple solver R_21 OpenFOAM Programming & Development 0 May 28, 2015 07:59
A question on the PIMPLE algorithm GerhardHolzinger OpenFOAM Running, Solving & CFD 4 February 13, 2015 07:49
Help for the small implementation in turbulence model shipman OpenFOAM Programming & Development 25 March 19, 2014 11:08
why PIMPLE doesn't converge at each time step but no diverging? immortality OpenFOAM Running, Solving & CFD 7 May 19, 2013 15:16


All times are GMT -4. The time now is 07:40.