
[Sponsors] 
May 23, 2013, 01:57 

#21 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 9 
Yes possible, but why do you require to use adjust macro. You can directly store some variable into memory in unsteady macro itself.


May 23, 2013, 02:19 

#22 
Member
Shashank
Join Date: Apr 2011
Posts: 74
Rep Power: 8 
Thanks Mahesh. I am calculating all UDMs in the adjust macro. Just wanted to know if one of them can be directly plugged in as the explicit term of the unsteady uds term.
Also one more question: I am trying to use the implicit part of the same uds to calculate one of the other UDMs. That specific UDM is hooked as a mass source term in the "vapor" phase of a VOF model. Can this be possible? All I am aware of is that the VOF equation is calculated first (which will require the vapor phase source term) and the uds equation is calculated at the last, so the coupling cannot be done if a segregated solver is used. What's your stance? 

May 23, 2013, 07:55 

#23 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 9 
It is possible to store all UDM through adjust macro. Do this for few iteration and check contours it it meets your expectation.
This coupling is possible. You have to be cautious about under relaxation and type of discretization scheme. Best wishes Mvee 

May 23, 2013, 12:55 

#24 
Member
Shashank
Join Date: Apr 2011
Posts: 74
Rep Power: 8 
Speaking of coupling and under relaxation factors, I have been having xmomentum divergence while running this same code. I know that in a segregated solver, first adjust macro is run, and then Fluent calculates the xmomentum equation. Divergence at this point would indicate I am doing something wrong in the adjust macro?


June 15, 2015, 15:22 

#25 
New Member
Subham Mishra
Join Date: Jun 2015
Posts: 2
Rep Power: 0 
hello people!!
I am working on mhd module of fluent for the simulation of m.r. fluid in magnetic field. I am facing problem in writing the udf for the magnetic body force that can be applied to the whole fluid. Also, if i am specifying any value of flux density in mhd module, how that value will be stored in the variable used for flux density in the udf. Please help. Thanking in advance, Subham 

June 22, 2015, 07:31 

#26 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 9 
Dear Shashank
Yes, It can be possible to use UDM values. Please keep remind that you will have only cell centered values of UDM, no face values. Best wishes Mvee 

June 26, 2015, 14:49 
udf to incorporate body force in mhd module

#27 
New Member
Subham Mishra
Join Date: Jun 2015
Posts: 2
Rep Power: 0 
I actually want to apply a magnetic field on a moving magnetic fluid. We have to couple the fluid flow and the mhd model. For this , we need to incorporate a body force which we have to give through udf. The formula is as follows:
F(x) = (m*s*B(x)*(dB(x)/dx))/U Where F(x) is the force, m is the mass of fluid, B(x) is the magnetic field strength, U is the permeability of the free space. As the magnetic field strength will vary at every x position, how to incorporate that in the udf and how to access the value of magnetic field in the udf? The code which we have written is as follows: #include "udf.h" DEFINE_DPM_BODY_FORCE(mhd_dpm_force,p,i) /* This file needs to be "interpreted" in FLUENT before it can be used */ { face_t f; Thread *t; real b_force=0; if(i==1) { b_force=0.00833*1800/(4*3.14*(10^7)*4)*F_UDSI(f,t,1)*F_UDSI_G(f,t,1); } return b_force; } please help.. 

June 29, 2015, 00:06 

#28 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 9 
F_UDSI_G(f,t,1) wont work. Gradient would be used on cell centered values not face values. In order to use it use adjacent cell values.
You can incorporate following in your code. For more help on it use help manual. c0 = F_CO(), t0 =THREAD_T0() C_UDSI_G(c0,t0,<index of UDS>)[0] 

June 29, 2015, 00:08 

#29 
Senior Member
Vaze
Join Date: Jun 2009
Posts: 153
Rep Power: 9 
Do you want to use dBx/dx on boundaries? if yes then only use above macro otherwise you can directly use C_UDSI_G()[0]


March 6, 2017, 19:22 

#30 
New Member
Zakaria AOUCHETTE
Join Date: Feb 2017
Posts: 2
Rep Power: 0 
hi, i'm working with the same case, i have trouble with creating UDF, please how to create it?


March 7, 2017, 11:53 

#31 
New Member
rarnaunot Rosi
Join Date: Feb 2017
Location: Spain
Posts: 23
Rep Power: 2 

March 7, 2017, 11:58 

#32  
New Member
rarnaunot Rosi
Join Date: Feb 2017
Location: Spain
Posts: 23
Rep Power: 2 
Quote:
I want to now why do you mix here UDS and UDM. Is it to save in memory the value of the UDS?? Still not familiar with the difference between UDS and UDM.... DEFINE_SOURCE(uds_source,c,t,ds,eqn) { blablablah C_UDMI(c,t,2)=rate; 

April 20, 2017, 10:55 
Solved

#33 
New Member
rarnaunot Rosi
Join Date: Feb 2017
Location: Spain
Posts: 23
Rep Power: 2 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
what is swap4foam ??  AB08  OpenFOAM  28  February 2, 2016 02:22 
Adding solvers from DensityBasedTurbo to foamextend 3.0  Seroga  OpenFOAM Installation  9  June 12, 2015 17:18 
centOS 5.6 : paraFoam not working  yossi  OpenFOAM Installation  2  October 9, 2013 01:41 
UDF source term  Rajani Kanth.B  Fluent UDF and Scheme Programming  4  May 1, 2013 09:31 
UDF Scalar Code: HT 1  Greg Perkins  FLUENT  8  October 20, 2000 12:40 