-
-
April 9, 2026 at 12:12 pm
SR786
SubscriberHi,
I am currently interested in modelling semi-batch precipitation in a stirred tank using the method of moments approach. I am treating the flow as pseudo-homogeneous (Stk << 1), so I will not be using an inhomogeneous two-fluid solver. Also, I am tracking vortex shape. The current models I have:
- VOF (track gas-liquid interface)
- RANS (SST k-w CC)
- Species Transport (track depletion of reacting species)
- User Defined Scalar (track crystal properties via population balance where scalars represent moments)
A UDF is used to calculate kinetics (nucleation and growth) and link species and uds equations via source terms.Â
I have managed to run a simulation with a batch operation (no feed) with all flow equations switched off and the simulation works fine with physically realistic results. However, when I attempt to model semi-batch operation with flow equations switched on I am noticing some major issues, in particular the moments calculated (i.e., zeroth moment) becomes unrealistically large which has a cascade effect on crystal properties as mass and size become unphysical. As far as I am aware, the simulation set-up from the GUI has been optimised in terms of settings and numerical schemes.Â
I am unsure of where to proceed from here, one thing that I can think of is that currently my source terms are non-linearised. I am aware this means the source terms are treated explicitly and can have a big impact on numerical stability. Given the complexity of what I am trying to simulate (especially for semi-batch process), is it recommended to linearise source terms and how would I do that. Currently the source term for zeroth moment is:
S(m0) = alpha*rho*B
[dS(m0)] = 0
Where alpha = volume fraction of liquid; rho = liquid density; B = Nucleation rate, B = kb*(sigma)^b. where kb and b are constants and sigma is the supersaturation driving force.
I do not know how to linearise this term
-
April 9, 2026 at 1:17 pm
Rob
Forum ModeratorLinearisation or some other limiter may be a good idea. What is stopping the UDF from trying to turn the whole tank into the smallest crystal/precipitate instantly on the first time step?Â
-
April 9, 2026 at 1:40 pm
SR786
SubscriberHi, thank you for the reply. I have plotted some contours of supersaturation (top) and zeroth moment (bottom) which represents the number density of particles. Essentially with a semi-batch process with slow feed and fast reaction we should see a segregated feed with localised region of high supersaturation near feed where nucleation is dominant and low supersaturation which slowly builds up in the bulk which is growth dominant. Nucleation and growth aren't activated until supersaturation driving force exists is (S > 1)
What I am finding is that the m0 value is giving an unphysical value and you can see from the contours that after 2.5 s it just increases out of control and I'm really stuck as to how to control this. Another noticeable is there are negative m0 values, despite supersaturation and nucleation having a minimum value of 0. You mentioned applying a limiter, how would I do this?
Â
Â
-
April 9, 2026 at 2:36 pm
SR786
SubscriberI remember once you mentioned: "You may also need a limiter to stop your UDF source term from exceeding the solid packing limit: that doesn't lead to a stable solution." in a previous thread (https://innovationspace.ansys.com/forum/forums/topic/udf-for-crystallisationprecipitation/) when I was trying to set up my UDF structure. I didn't do this (and for my uncoupled batch pbe simulation there weren't any notable issues as compared to my current coupled semi-batch pbe simulation). Could this be the source of the instability and why m0 is increasing uncontrollably?
-
April 9, 2026 at 3:36 pm
Rob
Forum ModeratorThe packing limit refers to Eulerian-Granular models. There the granular phase has a packing limit as you can't have 100% solid, but a UDF source doesn't know what the volume fraction is unless you tell it. Even then, with a runaway case, you can create more solid than can fit which causes problems with stability.Â
In your code what interactions could lead to a runaway? Ie what feedback possibilities are there?Â
-
April 9, 2026 at 3:42 pm
Rob
Forum ModeratorAnd for a limiter you "just" apply a max source term. So in general terms:
rate = stuff * other stuff
source = rate
IF source > a number, source = a smaller number
return source
-
- You must be logged in to reply to this topic.
-
5989
-
1906
-
1420
-
1307
-
1021
© 2026 Copyright ANSYS, Inc. All rights reserved.
