-
-
May 3, 2023 at 12:20 pmGloriaSubscriber
Hello! I am trying to load a DEFINE_DPM_SOURCE UDF, but it is not recognised. I am hooking it as explained in the manual (Setup->Models->Discrete Phase->UDF->Source), but no changes are generated. I am including in my UDF a message line [Message("SOURCE");], but it does not appear in the console after running my simulation.
Has anybody faced this issue before? Is the there any additional requirement I am not considering?
Thank you in advance for your reply!
-
May 3, 2023 at 12:49 pmRobForum Moderator
I assume you have interaction with continuous phase switched on? Were there any warnings when you compiled the .c file?
-
May 3, 2023 at 1:58 pmGloriaSubscriber
Hi Rob, thank you for your quick reply. Yes, I have Interaction with continuous phase switched on (in the Discrete Phase model dialogue) and no warnings are shown in the console after compiling my UDF.
-
May 3, 2023 at 3:19 pmRobForum Moderator
Not sure then. If you dump the source to a UDM does anything happen? Feel free to post the code, if it's obvious I'll say, but otherwise it's for the wider community as staff aren't able to debug code.
-
May 3, 2023 at 4:37 pmGloriaSubscriber
Hi Rob, going through the Ansys material I have found a case file devised to include a DEFINE_DPM_SOURCE. I have made some minor rearrangements over this file, and at least, I am getting the message in the console. Now, I have to figure out what the difference is between both cases...
I have a conceptual question regarding the DEFINE_DPM_SOURCE UDF. I have read in the manual that S is the "pointer to the source structure dpms_t, which contains the source terms for the cell", so I am expecting S->species[0] to cause changes only on the fluid of those cells that the particle goes through (surroundings affected by diffusion etc). Am I right?
-
May 4, 2023 at 8:22 amRobForum Moderator
More or less. There's an option in DPM to spread the source around in the cell and it's neighbours: it's for stability but read up on what it does.
The DPM source will then be where the particle is/was and the neighbours if you use the option. DPM species will pass to the carrier and move with the flow.
-
May 5, 2023 at 7:37 amGloriaSubscriber
Thank you, Rob. I have another question. Using this UDF, is it possible to account for source terms over the particles themselves? I know that using S->species[0] I can influence the fluid, but I need to induce changes in the particles composition themselves (with units kg/s).
If possible, is there a specific macro to do so? I have gone through the manual, but I have not seen any example.
-
May 5, 2023 at 8:27 amRobForum Moderator
Have a look at DEFINE_DPM_HEAT_MASS too. DPM's interaction with the fluid flow is complicated, in part because of the Lagragian-Eulerian converversion and in part because of the sheer number of models that interact with DPM and the fluid phase. You may find you need to be creative with how you define things.
-
May 5, 2023 at 8:45 amGloriaSubscriber
About DEFINE_DPM_HEAT_MASS, its arguments include source terms for the gas phase species mass. I tried to influence my fluid phase using this structure, but no change was observed (for the particles yes). May this have something to do with my fluid phase being liquid and not gaseous?
-
May 5, 2023 at 9:25 amRobForum Moderator
Unlikely. DPM just sees a carrier fluid, it doesn't typically care whether it's liquid or gas. Similarly, we often refer to droplets and bubbles as particles as DPM doesn't make much distinction until things start splashing/evaporating.
-
May 5, 2023 at 10:47 amGloriaSubscriber
Okay Rob, let’s see if you can give some information about this one. In the manual, the gas phase species mass source term is defined as dzdt->species[0..], where I am guessing 0 is the species index (in this case, the first species in mixture materials). Then, I am expecting dzdt->species[0] +=quantity to cause a change over species 0 concentration (which is not happening). In the manual there is an example of the usage of this structure: “dzdt->species[gas_index] += vap_rate;”, where gas_index is “gas_index = TP_COMPONENT_INDEX_I(tp,ns);”. I have read that TP_COMPONENT_INDEX_I(tp,ns) is supposed to return the gas index (if the component is not meant to evaporate, this gives -1). Could you clarify me what is the correct way to use this macro? Thank you!
-
May 5, 2023 at 11:19 amRobForum Moderator
You should have a mixture for gas phase & particle material: general comment.
Otherwise, there's the example in the manual, and I can't comment on that: I don't do much with UDFs and it's heading into the can't/don't bit of the support remit.
-
May 8, 2023 at 9:05 amGloriaSubscriber
Hello Rob, you point out that I should have a mixture for gas phase & particle material. In my setup, I have a mixture template with two components and particle mixture template with two components. Is this what you intended to point out or I am defining wrongly my setup? I couldn’t find a way to bring all of them together.
-
May 9, 2023 at 8:23 amRobForum Moderator
That's correct. You'll have the gas/liquid species in the fluid mixture and separately a particle mixture for whatever is in the bubble/droplet. The phase exchange is then from species(fluid) to species(particle). The formation enthalpy should take care of the energy released/absorbed during phase change.
-
May 22, 2023 at 8:43 amGloriaSubscriber
Hello! What is the DEFINE_DPM_SOURCE and DEFINE_HEAT_MASS UDF calling sequence during a simulation? Are they called in the same DPM iteration multiple times until some DPM convergence criteria are reached? Thank you in advance!
-
May 23, 2023 at 3:55 pmRobForum Moderator
DEFINE_DPM_SOURCE is called when a law changes (evaporating/boiling etc) and/or when the particle leaves a cell. Checks are there to make sure if law changes that stuff isn't accounted for twice.
-
- The topic ‘How to use DEFINE_DPM_SOURCE?’ is closed to new replies.
- Non-Intersected faces found for matching interface periodic-walls
- Script error Code: 800a000d
- Unburnt Hydrocarbons contour in ANSYS FORTE for sector mesh
- Help: About the expression of turbulent viscosity in Realizable k-e model
- Fluent fails with Intel MPI protocol on 2 nodes
- Cyclone (Stairmand) simulation using RSM
- error udf
- Diesel with Ammonia/Hydrogen blend combustion
- Mass Conservation Issue in Methane Pyrolysis Shock Tube Simulation
- Script Error
-
1301
-
591
-
544
-
524
-
366
© 2025 Copyright ANSYS, Inc. All rights reserved.