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

Refining structured mesh gives error: "Maximum number of iterations exceeded: 100"

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 3, 2022, 16:50
Default Refining structured mesh gives error: "Maximum number of iterations exceeded: 100"
  #1
New Member
 
Anton
Join Date: Feb 2022
Location: Sweden
Posts: 6
Rep Power: 4
pierrevalis is on a distinguished road
Hello everyone,

I am currently working with a custom solver called "multiphase particle in cell coupled with a population balance equation or "MPPICPBE". It is an extension of the MPPICFoam solver. I am running it on OF build 5.x-68e8507efb72.

The paper associated with the solver can be read here: https://doi.org/10.1016/j.compchemeng.2019.106686 and the github link for the solver: https://github.com/KAIST-LENSE/MP-PIC-PBE_CryFoam.git.

It is used to simulate the growth of lovastatin (cholesterol medicine) crystals when mixing a solution of methanol and lovastatin with an antisolvent (water). It is done by injecting Lagrangian particles in the flow and solving a population balance equation in the particles.

I have constructed a very simple 2D-geometry with a T-shape geometry.png and a structured mesh mesh_inlets.jpg, mesh_solvent_inlet.jpg. The height of the entire domain is 100 mm and width 10 mm, the height of the inlets at the bottom are both 3 mm and the width of the outlet is 6 mm. I am using pretty much the same BC as in the tutorial case attached in github.

The solution is injected in the left inlet at the bottom with a velocity of 0.1 m/s and temperature 305 K, water is injected from the right inlet with a velocity 0.0806059 m/s and temperature 293.15 K such that the mass flow between the two liquids is approximately the same. 2000 parcels are injected per second from the left inlet (the inlet patch is divided into 3 regions, particles are only injected from the middle region to avoid particles being injected into the wall layer).

My problem:

With my mesh the solver works fine to my novice eyes, I've ran the solver up to time 4. Here is a link to drive folder with the case and the results/logs https://drive.google.com/drive/folde...mY?usp=sharing.
Additionally, if I run the case with this mesh for even longer Tmin starts to drop. There is a small region right after the corner on the right side where the temperature starts to drop, TempDrop.jpg.

My problem arises when I create a finer mesh and attempt to run it again. I simply increased the number of cells in the blocks by 60% by multiplying by 1.6 in x and y direction. I then used mapFields from time 3 onto the new mesh and re-ran it with the same settings except with a smaller time step 0.25e-3 down from 1e-3 for the initial case.

When I start the simulation at time 3 with the new mesh Tmin starts at 292.925 K which shouldn't happen as all reactions in the simulation are exotherm, as well as the Tmin from which is it mapped is 293.15 K. So the minimum temperature should never go below the temperature of the antisolvent inlet temperature 293.15 K. Although after a few iterations the Tmin temperature reaches 293.15 K. But my main issue is that after a while I get the following error.

Quote:
--> FOAM FATAL ERROR:
Maximum number of iterations exceeded: 100

From function Foam::scalar Foam::species::thermo<Thermo, Type>::T(Foam::scalar, Foam::scalar, Foam::scalar, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar, Foam::scalar) const, Foam::scalar (Foam::species::thermo<Thermo, Type>::*)(Foam::scalar) const) const [with Thermo = Foam::hPolynomialThermo<Foam::icoPolynomial<Foam:: specie, 8>, 8>; Type = Foam::sensibleEnthalpy; Foam::scalar = double; Foam::species::thermo<Thermo, Type> = Foam::species::thermo<Foam::hPolynomialThermo<Foam ::icoPolynomial<Foam::specie, 8>, 8>, Foam::sensibleEnthalpy>]
in file /home/ubuntu/OpenFOAM/OpenFOAM-5.x/src/thermophysicalModels/specie/lnInclude/thermoI.H at line 73.

FOAM aborting

#0 Foam::error::printStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::species::thermo<Foam::hPolynomialThermo<Foam ::icoPolynomial<Foam::specie, 8>, 8>, Foam::sensibleEnthalpy>::THs(double, double, double) const at ??:?
#3 Foam::heRhoThermo<Foam::rhoReactionThermo, Foam::SpecieMixture<Foam::multiComponentMixture<Fo am::polynomialTransport<Foam::species::thermo<Foam ::hPolynomialThermo<Foam::icoPolynomial<Foam::spec ie, 8>, 8>, Foam::sensibleEnthalpy>, 8> > > >::calculate() at ??:?
#4 Foam::heRhoThermo<Foam::rhoReactionThermo, Foam::SpecieMixture<Foam::multiComponentMixture<Fo am::polynomialTransport<Foam::species::thermo<Foam ::hPolynomialThermo<Foam::icoPolynomial<Foam::spec ie, 8>, 8>, Foam::sensibleEnthalpy>, 8> > > >::correct() at ??:?
#5 ? in "/home/anton/OpenFOAM/anton-5.0/platforms/linux64GccDPInt32Opt/bin/mppicPbeCryFoam"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 ? in "/home/anton/OpenFOAM/anton-5.0/platforms/linux64GccDPInt32Opt/bin/mppicPbeCryFoam"
Aborted (core dumped)
anton@antonubuntu:~/OpenFOAM/anton-5.0/run/CF_LHC_case1_ManualRefineMesh60percent$
I have attached a log file log.run2_crash_short.txt , with the first time steps and last few time steps. I removed a substantial amount in the middle to keep below the file size limit. The complete log file is attached in the google drive linked earlier.

It is clear that my issue lies with the thermophysicalModels, and I have found other people having the same issue but none of the solutions has worked for me. I've tried using smaller time steps but the issue remains. The problem also occurs if I make a new case and start from 0 with the finer mesh.

I tried with a slightly less fine mesh, only increased by 20% and 40%. Then the crash doesn't occur for either when running to time 4, but the initial Tmin wobble does occur but it reaches 293.15 K eventually.

I am a beginner to CFD and OpenFOAM so I appreciate any tips or tricks on how to approach this issue, or any sources where I can find information! :)

Thanks!

Best regards,
Anton
pierrevalis is offline   Reply With Quote

Old   September 7, 2022, 05:20
Default
  #2
New Member
 
Anton
Join Date: Feb 2022
Location: Sweden
Posts: 6
Rep Power: 4
pierrevalis is on a distinguished road
Hey,


I thought I'd give an update on my issue in case anyone decides to also work with the MP-PIC-PBE solver in the future.


I managed to solve my issue. Essentially the domain was just too long. This led to parcels spending too much time in the supersaturated region giving the crystals/particles a lot of time to grow, resulting in them growing too large for the cells.

So the parcels becoming too large for the cells was the issue, that's why it only occurred when I refined the mesh.



I resolved my issue by reducing the length of the domain and not giving the crystals as much time to grow.



I also changed turbulence model to kOmegaSST and refined my settings, but that wasn't the root of my problem.



/Anton
pierrevalis is offline   Reply With Quote

Reply

Tags
kinematic cloud, langrangian parcels, mppic, specie, thermophysicalmodels


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
Foam::error::PrintStack almir OpenFOAM Running, Solving & CFD 92 May 21, 2024 08:56
Help sought on axial compressor simulation jyotir OpenFOAM Running, Solving & CFD 0 November 17, 2021 11:49
chtMultiRegionSimpleFoam turbulent case Aditya Patil OpenFOAM Running, Solving & CFD 6 April 24, 2017 23:13
Cannot run the code properly: very large time step continuity error crst15 OpenFOAM Running, Solving & CFD 9 December 14, 2014 19:17
pisoFoam with k-epsilon turb blows up - Some questions Heroic OpenFOAM Running, Solving & CFD 26 December 17, 2012 04:34


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