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

Custom particle injection profile

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 3, 2020, 03:37
Default Custom particle injection profile
  #1
Member
 
MMatt
Join Date: May 2013
Posts: 59
Rep Power: 13
MMatt is on a distinguished road
Hi all,

I would like to know how can I do either of the following:

1) maintain a particles concentration in a cell zone through "automatic" particles injection but that could be done through UDF I would imagine

2) inject particles into a cell zone using a file containing the number of particles to be injected over time (2 column file). It seems only a fixed amount of particles can be injected from the dialog box, I don't see the option of having a varying amount.

I have read lot over the internet and my case is quite common I would imagine, however I cannot find valuable answers to my case. Using the volume injection function helped me a lot already, but I have a feeling what I'm trying to do was not really thought through by Ansys, or at least they don't make it easily accessible!
MMatt is offline   Reply With Quote

Old   February 3, 2020, 04:11
Default Objective unclear
  #2
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Your goal or aim is not very clear to me. Could you describe in more detail, may be using a pseudo-code what you would like the tool to do?
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 3, 2020, 04:24
Default
  #3
Member
 
MMatt
Join Date: May 2013
Posts: 59
Rep Power: 13
MMatt is on a distinguished road
What I am trying to do is to maintain a constant number of particles concentration (therefore the same number of particles, as the volume is constant) in one of the cell zones (I have 2 cell zones within the same fluid domain). The air flow basically carries particles outside this 1st cell zone, and into the next one, which means I have to compensate into the 1st cell zone the amount of particles that flows out of it.

My initial thought was to create a UDF (although my expertise in that is practically 0) that would calculate the particles concentration in that cell zone, then compute the number of particles that left the cell zone, and use this number as an input for the injection.

A more rough way of doing was to first do 1 simulation without injection, and compute the number of particles to be injected back over time, although this would probably require few iterations to get it more or less right, but would remain a rough way of doing.

Hope it helps!
MMatt is offline   Reply With Quote

Old   February 3, 2020, 05:10
Default Multiple ways to do that
  #4
Senior Member
 
vinerm's Avatar
 
Vinerm
Join Date: Jun 2009
Location: Nederland
Posts: 2,946
Blog Entries: 1
Rep Power: 36
vinerm will become famous soon enough
Since air carries particles from one zone to the next one, I am assuming there is a connecting interior between these two. If the particles are inert, then a fixed number of particles in the first cell zone do not do anything except providing a supply of particles. This supply can be provided by the interior and you do not need to solve a lot of equations in the first zone.

Now, assuming my assumption above is wrong and the particles have some important impact on the first zone as well. Then you need to sample the particles at the interior boundary to count the number of particles that cross-over or count the number of particles in the second cell zone. Once you know that, you can use multiple ways to inject that same number (not sure if you would like to maintain same mass or other fields) of particles in the first cell.

One way is to use a Volume Injection. Set it up but modify it on-the-fly. You can modify injection parameters using TUI or Scheme commands. TUI commands will work only in a sequential manner.

Another way is to use a VOLUME injection but create the injection on-the-fly instead of modifying. For this, you can create a volume injection and then write it to a scheme file. Option is available at the Injection Creation Dialogue Box. This file contains every detail of the injection. Keep a copy of it in the drive, modify it using the code, and then read it into Fluent using TUI. This is cumbersome since you have to use system commands from within Fluent. You can do this using (system "<system commands> ").

Another option is from within a UDF. This might be the simplest in my view but there could be other simpler methods. You can modify the injection using DEFINE_DPM_INJECTION_INIT. The sole purpose of this macro is to provide capability to modify the injection that already exists, such as a Volume Injection setup for zone 1. Within this function, you can loop over all the particles within the zone 2, NOT in zone 1, and for every particle that exists in zone 2, you can inject new particles in zone 1. There are various macros available for new particle creation. You can go through files named as dpm_*.h in your source code provided at Fluent installation to check what options are available. Important ones are new_particle, prepend_particle_to_list, MARK_PARTICLE, Spawn_Particle, etc.
__________________
Regards,
Vinerm

PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority.
vinerm is offline   Reply With Quote

Old   February 3, 2020, 09:19
Default
  #5
Member
 
MMatt
Join Date: May 2013
Posts: 59
Rep Power: 13
MMatt is on a distinguished road
You are correct, there is an interior connection between the 2 cell zones. The particles are also inert. The thing is the air-flow in the whole domain is not fully stable, therefore the air-flow through that interior is not constant. This means the particles flow-rate through that interior is not constant, and having a single value for the particle injection will not keep the particles concentration stable/constant in the first cell zone.

I will take a look at the UDF macros, I feel like this is the most viable solution.
MMatt 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
Particle Injection induced from a UDF Peter023 Fluent UDF and Scheme Programming 3 November 26, 2018 04:55
particles leave domain Steffen595 CFX 9 March 7, 2016 17:19
Multiphase How to controling the time of particle injection xyq916 CFX 2 January 18, 2015 07:09
particle injection aslaan.farjam@gmail.com FLUENT 0 December 9, 2014 13:14
particle velocity and velocity profile HGG FLUENT 2 June 10, 2001 17:32


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