CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Define a mass flow boundary condition at an interface in CFX Pre-Post

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By ghorrocks
  • 1 Post By ghorrocks
  • 1 Post By ghorrocks
  • 1 Post By ghorrocks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 24, 2024, 04:40
Default Define a mass flow boundary condition at an interface in CFX Pre-Post
  #1
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
Hello,

I would like to simulate the recirculation of combustion products from the surroundings into my car. The combustion products flow through a duct in the surroundings. Due to an air exchange rate in my car (e.g., 30% of my car’s volume), there is a suction effect from the surroundings into my car. My question is, how can I define the exchange rate (in fact, a mass flow boundary condition) at the interface between the surroundings and my car? Could you please tell me if there is a problem with defining such an exchange rate (i.e., through the mass flow boundary condition) in my model?

regards,
MNMK is offline   Reply With Quote

Old   October 24, 2024, 04:59
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
There are many ways to do this, we need more information to know which way is most suitable.

* Why are you doing this simulation? What are you trying to learn from it? The purpose of the simulation sets what things you need to model.
* Please draw a simple diagram of where the air and combustion products flow, and any information you know about it. You have already mentioned 30% volumetric turnover (presumably in some time scale) which could define a flow rate - so where is this flow rate? Assuming this is steady state: for the flow which goes in, where does the flow go out?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2024, 05:30
Default
  #3
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
Hi,

The aim is to evaluate the distribution of combustion products in the car. Firstly, I would like to simulate it in a steady state, but I will have to simulate it transient later.

wishes,
Attached Images
File Type: png a.PNG (20.8 KB, 8 views)
MNMK is offline   Reply With Quote

Old   October 24, 2024, 05:43
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Can the outside air be assumed to have constant and known combustion product concentration?

If the answer is yes then you do not need to model it and you just have to model the inside of the car. If the answer is no you have to model inside and outside the car and it is a little more complex.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2024, 05:54
Default
  #5
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
If I understand your question, I want to see the distribution both outside and inside. May you please help me how I can model it?

bests,
MNMK is offline   Reply With Quote

Old   October 24, 2024, 06:03
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
OK, if you want to model both inside and outside:

I assume that the air exchange is done actively by the HVAC system in the car (filters, fans, ducts etc) and passively by leaks and open windows.

I would model the inside air domain and outside air domain. The outside air domain would have whatever external conditions are present (combustion products, air velocity etc).

* Things like open windows are modelled by simply having a connection from the inside to outside.

* Air leaks (which I assume air direct connections which are too small to resolve with the mesh) are modelled by putting an artificial pipe connecting inside and outside which has an equivalent resistance to the resistance of the leak. You might want to out a porous volume to do this, or maybe a source term.

* The HVAC system is a little more complex. You need to replace the HVAC system with an artificial pipe connecting inside and outside with a source term in it to drive the flow. The source term is set up to match the system characteristic of the actual HVAC system, from the external air intake through the filters, fan and into the passenger compartment. You have mentioned that you know the flow rate - this is a very simple system characteristic which can be implemented with a source term or an interface with a defined mass flow.
MNMK likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2024, 06:13
Default
  #7
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
a Wonderful description.

If I understand you correctly, in this case, I should define a mass flow in my interfaces for the exchange rate, which is known. As you mentioned, the air exchange is done actively by the HVAC system in the car (filters, fans, ducts, etc.) and passively by leaks and open windows. In this model, for some reasons, I simplified my model and I have just two interfaces, which I drew in the sketch. Isn’t it?

bests,
MNMK is offline   Reply With Quote

Old   October 24, 2024, 06:19
Default
  #8
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
At the simplest level you could use two connections.

But this does not model the effect of several factors:
* Your HVAC system probably has several air vents, not just one. So air is entering the passenger compartment at many locations.
* The leaks are all over as well. They will be through the firewall, into the boot/trunk, out the door seals (if they are a bit dodgy), and all over the place.

Replacing all those inlets and outlets with a single inlet and outlet is a big approximation. I suspect for what you are trying to do it would introduce unacceptable error, so you need to model enough inlets and outlets that you capture not only the flow rate, but the distribution as well.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2024, 06:46
Default
  #9
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
Surely, it is highly inaccurate. I will improve my model and consider more details later.

I have another question. I would like to build the product distribution like the reality in my simulation and also reduce my simulation time. When I simulate the model transient and I know the change of combustion product concentrations over time, what should I do (besides adjusting the boundary conditions and geometry accurately) to get the correct result? My question is about CFD topics. I need to know how I should evaluate the mesh quality and the Time Step Size required to reach a correct result.
MNMK is offline   Reply With Quote

Old   October 24, 2024, 06:49
Default
  #10
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Starting simple and increasing the complexity and accuracy as you progress is a sensible path forwards.

What is the distribution of combustion products?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2024, 06:54
Default
  #11
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
You do not normally do mesh quality checks for a simulation, you generate the best mesh you can. What you check is the mesh size.

To do this is you run a baseline simulation and extract the key variable from it. In your case it could be the concentration at some location. Then do a new mesh with the element edge length halved (so a hex would become 8 hexes, a tet becomes 5 tets - so you would expect to have between 5x to 8x the number of elements) and simulate that, extract the key variable.

Compare the key variable from the baseline mesh to the finer mesh. If they are the same within a tolerance you are happy with then the baseline mesh is acceptable for results. If not then take your fine mesh and halve the element edge length again and repeat the process until your results converge to within an accuracy you are happy with. You will often find this results in very, very big meshes. That is why people build supercomputers to run CFD.
MNMK likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 24, 2024, 07:30
Default
  #12
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
Hello Again,

I defined a user function through Interpolation (Data Input) User Functions for my combustion products’ mass fraction change over time (e.g., CO) (see photos). However, when I import it into my boundary condition, I get the following error:

Bad expression value 'CO( )' detected in parameter 'Mass Fraction' in object '/FLOW:Flow Analysis 1/DOMAIN:Surrounding/BOUNDARY:Abgasin/BOUNDARY CONDITIONS/COMPONENT:CO'.
CEL error:
In the expression assigned to 'Mass Fraction', the function 'CO' is called with the wrong number of arguments (0 - expected 1).

where is the mistake?
Attached Images
File Type: png CO Component massfraction.PNG (4.5 KB, 8 views)
File Type: png Interpolation Data Input.PNG (13.5 KB, 6 views)
File Type: png Text Data.PNG (6.2 KB, 7 views)
MNMK is offline   Reply With Quote

Old   October 24, 2024, 19:35
Default
  #13
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Where you call the function CO(), that should be CO(t).

Note that your interpolation function appears to have values up to 4846 in it. Mass fractions just go from 0 to 1, so 4846 is not a valid mass fraction. Check your interpolation function is using the correct values.
MNMK likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 26, 2024, 03:07
Default
  #14
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
Hi,

I defined a mass flow (exchange rate) of 0.009 kg/s for additional interface models. As can be seen in the photo2, I have two interfaces, one at the top and one at the bottom. The problem is that even with a very small value (0.00001) set for the domain interface target value in the convergence criteria in CFX-Pre/Post, I get a lower mass flow (0.001 kg/s) at my interfaces. There are two possibilities: 1) My calculation has not converged (see photo 3), although the change in mass flow is slow, or 2) my boundary condition is not correct. I would be happy if you could give me feedback.

bests,
Attached Images
File Type: png Capture01.PNG (10.1 KB, 3 views)
File Type: png Capture02.PNG (69.9 KB, 3 views)
File Type: png Capture03.PNG (24.7 KB, 7 views)
MNMK is offline   Reply With Quote

Old   October 26, 2024, 03:16
Default
  #15
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
That sure does not look converged. You will have to run it longer. Note the residuals and imbalances are the normal things to look at to judge convergence.

I would expect this simulation to converge slowly as you have two very different time scales present. The short time scale is the time scale of the flow, and the long time scale is the combustion products. If you use the default time step size it will give you a very small time step size because of the short flow time scale - which will result in very slow convergence of the combustion products.

You will probably want to increase the time step size to speed this up. And note this only works for steady state flows. For transient flows you are forced to use a time small scale so the fast flow features are resolved and the combustion products will converge very slowly.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks is offline   Reply With Quote

Old   October 26, 2024, 03:30
Default
  #16
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
I appreciate your fast feedback.

I simulate a steady state first, followed by a transient state. I increase the time scale size. For your information, I define the combustion product as a material (variable composition mixture). I do not simulate combustion.

wishes,
MNMK is offline   Reply With Quote

Old   October 28, 2024, 09:30
Default
  #17
Senior Member
 
Mey
Join Date: Dec 2019
Posts: 116
Rep Power: 6
MNMK is on a distinguished road
Quote:
Originally Posted by ghorrocks View Post
That sure does not look converged. You will have to run it longer. Note the residuals and imbalances are the normal things to look at to judge convergence.

I would expect this simulation to converge slowly as you have two very different time scales present. The short time scale is the time scale of the flow, and the long time scale is the combustion products. If you use the default time step size it will give you a very small time step size because of the short flow time scale - which will result in very slow convergence of the combustion products.

You will probably want to increase the time step size to speed this up. And note this only works for steady state flows. For transient flows you are forced to use a time small scale so the fast flow features are resolved and the combustion products will converge very slowly.
Do you have any suggestions on how I can improve convergence, especially if I want to reduce the simulation time for transient analysis?
And also, should I define the mass flow rate for both interfaces or just one of them? Does the sign (positive or negative) of the mass flow rate play a role in this case?
MNMK is offline   Reply With Quote

Old   October 28, 2024, 17:33
Default
  #18
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,871
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
Do you have any suggestions on how I can improve convergence
Read the CFX documentation on obtaining convergence. Some things to consider:
* Mesh quality makes a massive difference
* Converge as tight as you need, and no tighter. Use a sensitivity study to determine how tight you need to go.
* Use a time scale factor and/or larger time step size in steady state runs to speed things up
* In transient runs determine the time step size by another sensitivity analysis, or use adaptive time stepping homing in on 3-5 coeff loops per iteration.
* Mesh quality makes a massive difference. It is important enough to say it twice.

Quote:
should I define the mass flow rate for both interfaces or just one of them?
You should define your conditions to match the conditions you are modelling.

Quote:
Does the sign (positive or negative) of the mass flow rate play a role in this case?
Yes, that is the flow direction.
MNMK likes this.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
ghorrocks 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
Centrifugal fan j0hnny CFX 13 October 1, 2019 14:55
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field xiexing CFX 3 March 29, 2017 11:00
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 07:20
An error has occurred in cfx5solve: volo87 CFX 5 June 14, 2013 18:44
CFX13 Post Periodic interface EtaEta CFX 7 December 8, 2011 18:15


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