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

Dpm_law udf

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 12, 2024, 13:51
Default Dpm_law udf
  #1
New Member
 
Anurag Bhattacharjee
Join Date: Jun 2024
Posts: 3
Rep Power: 2
Anurag_B is on a distinguished road
Hello everyone, I am trying to write a code that modifies the DPM_HEAT_MASS and also DPM_LAW. I am modifying some user reals inside DPM_HEAT_MASS which is used to overwrite particle mass, density etc inside DPM_LAW. I am not sure how to include my DPM_HEAT_MASS in DPM_LAW. When i try to print, i find the messages inside DPM_HEAT_MASS is not getting printed. Please let me know if you have any pointers.

Some snippets from my code like this-

#include "udf.h"
#include "dpm_mem.h"

#define DPM_DT (1.e-7)
#define NUM_DP 5 // NUMBER OF LAYERS INSIDE DROPLET
#define PI 3.1415926
#define solid_mfrac 0.45
#define drop_moist_cont 1.22
#define rho_s 1100.0
#define rho_l 1000.0
#define Dsl_solid 2.94e-10

/* heat and mass transfer */
DEFINE_DPM_HEAT_MASS(multivap,tp,Cp,hgas,hvap,cvap _surf,Z,dydt,dzdt)
{

//USER DEFINED VARIABES
real r_droplet[NUM_DP];
real conc_droplet[NUM_DP];

int ns;
Material *sp;
real count;
...
Message("Diameter: %e\n", TP_DIAM(tp)); //to check it enters the multivap
...

/* update the user scalar variables */
DEFINE_DPM_SCALAR_UPDATE(concentration_particle,ce ll,thread,initialize,tp)
{
if (TP_TIME(tp) == tp->time_of_birth)
{
real Rp_0 = 0.5*TP_INIT_DIAM(tp);
real rho_d_0 = TP_INIT_RHO(tp);
real mp_0 = TP_INIT_MASS(tp);
...
TP_USER_REAL(tp,NUM_DP) = mp_0; /* initial particle mass*/
...
}


DEFINE_DPM_LAW(Slurry_model,tp,ci)
{

//VaporizatonLaw(tp); I am using my own vaporization code from heat_mass?

/* Computing initial properties considering solid content*/
TP_INIT_RHO(tp) = ((1+drop_moist_cont)*rho_s*rho_l)/(rho_l+(drop_moist_cont*rho_s));
TP_INIT_MASS(tp) = 4*PI*pow((0.5*TP_INIT_DIAM(tp)),3.)*TP_INIT_RHO(tp )/3;

/* compute new particle diameter, density and mass */
TP_MASS(tp) -= TP_USER_REAL(tp,NUM_DP+6)*DPM_DT;
TP_DIAM(tp) += 2*TP_USER_REAL(tp,NUM_DP+5)*DPM_DT;
TP_RHO(tp) = ((1+TP_USER_REAL(tp,NUM_DP+7))*rho_s*rho_l)/(rho_l+(TP_USER_REAL(tp,NUM_DP+7)*rho_s));

Message("Mass: %e\n Rho: %e\n", TP_MASS(tp), TP_RHO(tp));
}
Anurag_B is offline   Reply With Quote

Old   August 27, 2024, 04:18
Default
  #2
Member
 
Refik
Join Date: Dec 2014
Location: Turkey
Posts: 58
Rep Power: 12
rewol is on a distinguished road
Hello,

I am not sure that DEFINE_DPM_HEAT_MASS and DEFINE_DPM_LAW are meant to be used together. As far as i know, DEFINE_DPM_HEAT_MASS is for multicomponent liquid phase. In the corresponding UDF example code, you can see that vaporization and boiling are coded together.

If you already know the equations that will govern your vaporization and boiling and know when to switch between them, you do not need DEFINE_DPM_LAW macro. DEFINE_DPM_HEAT_MASS macro contains pointers that you have to adress to HANDLE source terms.

Hope this helps.

Refik
rewol 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
udf for one dimensional linear motion based on force maccheese Fluent UDF and Scheme Programming 2 September 1, 2019 03:18
Save output of udf in another udf! JuanJoMex FLUENT 0 February 8, 2018 13:43
UDF Compilation Error - Loading Library - COMMON Problem! Help! robtheslob Fluent UDF and Scheme Programming 8 July 24, 2015 01:53
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01


All times are GMT -4. The time now is 08:42.