CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Species Disappearing (https://www.cfd-online.com/Forums/fluent/175255-species-disappearing.html)

Baden July 26, 2016 15:37

Species Disappearing
 
Hello all.

I am a college student attempting to simulate the flow of acid through a 3D porous rock sample. However, for the sake of simplicity, I will only be modeling species transport through a pipe in this thread.

Below I've included the geometry/mesh used in Fluent.

http://i.imgur.com/Tlx3M7n.png

My Fluent setup is as follows:
  • General
    • Type: Pressure-Based
    • Time: Transient
    • Velocity Formulation: Absolute
  • Models
    • Viscous: Laminar
    • Species: Species Transport (no reactions)
  • Materials
    • Mixture: hydrogen chloride and water-liquid
      • Density method: volume-weighted-mixing-law
    • Solid: calcium-carbonate
  • Boundary Conditions
    • Inlet Velocity: 1.65e-05 m/s
    • Inlet HCl Mass Fraction: 0.02
  • Solution Initialization
    • Standard Initialization computed from Inlet
I want the pipe to initially be filled with only water, so I patch the value of HCl in the interior zone to be 0 after initializing. When I try to run the simulation after patching, the solver converges at each time step (although there is reversed flow) but the contours of HCl mass fraction look like this regardless of time step size or number of time steps:

http://i.imgur.com/0KLQSzw.png

It appears as though the HCl is simply disappearing immediately after entering the pipe. I have scoured the internet for threads with similar problems and have come up empty-handed. Does anyone know why I might be encountering this problem and how to fix it?

nvarma July 26, 2016 16:48

What is your outlet boundary condition?

Also, did you try running it

1. with "pressure inlet" to see if the same problem persists?
2. Patching 0.5 for species mass fraction to see if the solution reaches the same steady state?


My first guess is that the velocity is too small to affect any change.

If you are looking for the effects of bouyancy, make sure that
1. gravity is on
2. compressible/bossinesq model is used appropriately.

Baden July 26, 2016 17:37

Quote:

Originally Posted by nvarma (Post 611515)
What is your outlet boundary condition?

Also, did you try running it

1. with "pressure inlet" to see if the same problem persists?
2. Patching 0.5 for species mass fraction to see if the solution reaches the same steady state?


My first guess is that the velocity is too small to affect any change.

If you are looking for the effects of bouyancy, make sure that
1. gravity is on
2. compressible/bossinesq model is used appropriately.

Thank you very much for your response.

It appears that you are correct guessing that the velocity is too small, which now seems obvious. By increasing the velocity by a magnitude of 1000, I was able to get these contours after only 3 seconds:

http://i.imgur.com/eV215jV.png

However, the purpose of my project is to match experimental data so I have to use a velocity of 1.65e-5 m/s. Is there any changes I could make to the simulation/model so that this velocity would be viable? Would using a finer mesh or adaptive time step (for longer simulated flow time) work?

nvarma July 26, 2016 17:40

Is gravity enabled? Is the species 2 (HCl) modeled as ideal gas or is bossinesq model turned on?

If the velocity in experiments are that low, then gravity will have a significant impact and has to be modeled assuming I am not misunderstanding your problem.

Baden July 26, 2016 17:51

Quote:

Originally Posted by nvarma (Post 611522)
Is gravity enabled? Is the species 2 (HCl) modeled as ideal gas or is bossinesq model turned on?

If the velocity in experiments are that low, then gravity will have a significant impact and has to be modeled assuming I am not misunderstanding your problem.

Gravity is not enabled as it is considered negligible in the experiments. As for the bossinesq model, I am not sure how it relates to what I am doing. Both components of the mixture used in species transport, HCl and H2O, are liquids and have properties that are independent of temperature.

nvarma July 26, 2016 17:59

Since you said Hydrogen Chloride I assumed it is gas and was suggesting to consider natural convection. My bad.

Again I am speaking form intuition so correct me if I am wrong.

HCl liquid has a density of 1.49 kg/m3
Water has a density of 1 kg/m3

At such low velocities of HCL entering at bottom, (laminar) diffusion would take a long time.

What is your water-HCl diffusion coefficient? Is that obtained from experiments?


Also for the porous zone, are the flow resistance values obtained experimentally?

Baden July 27, 2016 10:40

Quote:

Originally Posted by nvarma (Post 611524)
Since you said Hydrogen Chloride I assumed it is gas and was suggesting to consider natural convection. My bad.

Again I am speaking form intuition so correct me if I am wrong.

HCl liquid has a density of 1.49 kg/m3
Water has a density of 1 kg/m3

At such low velocities of HCL entering at bottom, (laminar) diffusion would take a long time.

What is your water-HCl diffusion coefficient? Is that obtained from experiments?


Also for the porous zone, are the flow resistance values obtained experimentally?

The molecular diffusivity of HCl was determined experimentally to be 3.6e-9 m^2/s. I am applying this number using the "constant dilute approximation" method.

As for the initial values viscous resistances, they too were determined experimentally to be in the range of 0.8 - 2.0 mD. For my model, I am using a value of 1 mD (9.87e-16 m^2) for the initial values of viscous resistance. Note that these values do change over time (implemented via UDF) as the porous rock is dissolved by the acid flowing through it. I did not include this in my problem statement in this thread for the sake of simplicity.

nvarma July 27, 2016 15:55

Okay, that makes sense. The only remaining input I would be worried about is porosity. Model seems to be okay to me.

So I think your species is not necessarily disappearing, may be the diffusion is so slow that it takes a lot more iterations to get there. To test this may be you can run with a larger times step with implicit scheme and check if that's the case.

Good luck

Baden July 28, 2016 11:10

Quote:

Originally Posted by nvarma (Post 611666)
Okay, that makes sense. The only remaining input I would be worried about is porosity. Model seems to be okay to me.

So I think your species is not necessarily disappearing, may be the diffusion is so slow that it takes a lot more iterations to get there. To test this may be you can run with a larger times step with implicit scheme and check if that's the case.

Good luck

Alright, thank you for your help.

When I run the simulation with the unsimplified model (porous zone, acid sink, UDFs, etc), I get the following residuals for 1 time step of 0.1 seconds:

http://i.imgur.com/lV7shHd.png

Any time step larger than 0.01 seconds also gives me similar residuals and the simulation doesn't converge. I think that this behavior indicates that I need to use a smaller time step. The following residuals are from a 10 time steps of 0.01 seconds:

http://i.imgur.com/zmdxXE1.png

These residuals appear to be good until the 150 iteration mark, where they flatten out. Also, the solver converges after just one iteration after that point.

My questions are as follows:
  1. Is there a way I can use a time step larger than 0.01 seconds and still get accurate results?
  2. Why are the residuals flattening out after a few time steps? Does this behavior indicate that there is an error in my model?

nvarma July 28, 2016 11:45

>similar residuals and the simulation doesn't converge.

For transient/unsteady problems residuals will oscillate (going down during "iterations per time step", and jumping back up, at the next time step). This doesn't necessarily mean your solutions are inaccurate.

Add some other monitor (outlet velocity for example) and see if they flatten out. If that flattens out it just means that you have reached steady state and your solution is not likely to change if you continue the run.


To answer your question:

>Is there a way I can use a time step larger than 0.01 seconds and still get accurate results?

Keep your time-step below the time scale you want to capture OR below the value necessary to avoid divergence.

Also using double precision and second order methods is better.

>Why are the residuals flattening out after a few time steps? Does this behavior indicate that there is an error in my model?

It likely means that your solution has reached steady state. Add another monitor and ensure this. If that is the case, running it for longer is unlikely to change your solution/.

Baden July 28, 2016 12:21

Quote:

Originally Posted by nvarma (Post 611813)
>similar residuals and the simulation doesn't converge.

For transient/unsteady problems residuals will oscillate (going down during "iterations per time step", and jumping back up, at the next time step). This doesn't necessarily mean your solutions are inaccurate.

I understand that the residuals should oscillate like they do with a time step of 0.01 seconds, but first image of residuals I posted was from a single time step. I don't think that the residuals should oscillate like that within a single time step. If they do, I think that means the time step is too large (plus, the solver didn't converge). Please correct me if I'm wrong on this.

Quote:

Originally Posted by nvarma (Post 611813)
Add some other monitor (outlet velocity for example) and see if they flatten out. If that flattens out it just means that you have reached steady state and your solution is not likely to change if you continue the run.

I added a monitor for the Y-Velocity and it appeared to flatten out like the residuals like so:

http://i.imgur.com/ftAcq3x.png

Does this necessarily mean I have reached steady-state? The HCl that is being injected into the porous zone should be advancing each time step and displacing an equal amount of water present in the porous zone, so I would think that a flattened outlet velocity monitor is to be expected.

Quote:

Originally Posted by nvarma (Post 611813)
To answer your question:

>Is there a way I can use a time step larger than 0.01 seconds and still get accurate results?

Keep your time-step below the time scale you want to capture OR below the value necessary to avoid divergence.

Also using double precision and second order methods is better.

>Why are the residuals flattening out after a few time steps? Does this behavior indicate that there is an error in my model?

It likely means that your solution has reached steady state. Add another monitor and ensure this. If that is the case, running it for longer is unlikely to change your solution/.

You mention that time step has to be kept below the time scale or low enough to prevent divergence. As I mentioned previously, a time step greater than 0.01 seconds causes oscillation within a single time step. Does this mean that any time step larger than 0.01 seconds causes divergence? Or is the oscillation within the time step acceptable?

As an example, here are the residuals from 10 time steps with a step size of 0.1 seconds:

http://i.imgur.com/Qfu4PvL.png

As you can see, there is no jump back up after each time step and the HCl residual constantly oscillates. This fact makes me think I have to use a time step of 0.01 seconds, even though this is extremely small for how long of a simulation I want to run (3 hours). Is there any solution to this or am I misinterpreting what is happening?

nvarma July 29, 2016 09:01

It doesn't meet it WILL diverge. But it shows that your solution is not numerically converging (within a time step). ie, it will be inaccurate.

What I would do in such a situation is
1. Change the relaxation factor, time step, and the scheme.
2. Refine the mesh.

I would also try running the exact case in steady state first to see if this is caused by any other issue.

Also a good monitor for your problem would be % mass of HCl at the outlet.

yusufgondall1992 October 21, 2019 10:54

Hi How to write Velocity or pressure Udf in Silencer Help me ?
 
nozzle pressure 40Mpa gas flow , need to decrease in real time .
How to write Udf pressure İnlet Profile ? :eek:


All times are GMT -4. The time now is 08:54.