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

Define_source

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 14, 2025, 11:17
Question Define_source
  #1
New Member
 
Join Date: Oct 2024
Posts: 8
Rep Power: 2
Linas is on a distinguished road
I am working with a two-phase case, wherein each phase has only one species. Using DEFINE_SOURCE, I can remove mass from one phase. How do I add mass to the other phase?

Here is a simplified UDF to remove mass from one phase:

#include "udf.h"
#include "math.h"

/* Define the source term function */
DEFINE_SOURCE(species_add_lit3, c, t, dS, eqn)
{
real source;

source = 1;
dS[eqn] = 0;

return source;
}


In my actual UDF, the source is not constant but a function.
Linas is offline   Reply With Quote

Old   February 13, 2025, 17:16
Default
  #2
New Member
 
Chris
Join Date: Mar 2021
Posts: 27
Rep Power: 6
cbooks77 is on a distinguished road
Mass must be conserved. Whatever you take from one phase (negative source) becomes positive source to other phase...
cbooks77 is offline   Reply With Quote

Reply

Tags
udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



All times are GMT -4. The time now is 07:41.