-
-
May 3, 2023 at 12:20 pm
Gloria
SubscriberHello! 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 pm
Rob
Ansys EmployeeI 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 pm
Gloria
SubscriberHi 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 pm
Rob
Ansys EmployeeNot 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 pm
Gloria
SubscriberHi 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 am
Rob
Ansys EmployeeMore 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 am
Gloria
SubscriberThank 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 am
Rob
Ansys EmployeeHave 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 am
Gloria
SubscriberAbout 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 am
Rob
Ansys EmployeeUnlikely. 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 am
Gloria
SubscriberOkay 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 am
Rob
Ansys EmployeeYou 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 am
Gloria
SubscriberHello 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 am
Rob
Ansys EmployeeThat'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 am
Gloria
SubscriberHello! 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 pm
Rob
Ansys EmployeeDEFINE_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.
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- Suppress Fluent to open with GUI while performing in journal file
- Floating point exception in Fluent
- What are the differences between CFX and Fluent?
- Heat transfer coefficient
- Getting graph and tabular data from result in workbench mechanical
- Difference between K-epsilon and K-omega Turbulence Model
- The solver failed with a non-zero exit code of : 2
- Time Step Size and Courant Number
- Mesh Interfaces in ANSYS FLUENT
- error: Received signal SIGSEGV
-
5290
-
3311
-
2469
-
1308
-
1016
© 2023 Copyright ANSYS, Inc. All rights reserved.