UDF: trying to implement a Kinetic Equation source term
Hello All,
kindly help in writing a UDF for the the equation in the picture. Regards, Mukesh |
It is time consuming.
|
Dear er.mkumar
You start writing your code. If you stuck in between raise your thread, you will get help from forum. Best wishes Mvee |
Help required in post processing
I tried to write the code, here it is. Problem is I am not getting the exact results I expect (may be some numerical values need change).
Also I want to track both Temperature (K) and Concentration ratio H/M (x) with flow time. While tracking temperature is simple from solve/monitors/volume integral... I'm yet to figure out how to track concentration(x) (a) with time and (B) spatially as contour (I mean how to plot variation of x in different section of domain( i.e. 0-5 mm, 5-10 mm, 10-15 mm....) with distance both radially and axially. FINALLY: Is there any MACRO using which FLUENT stops executing the UDF once 'x' reaches its upper limit. Awaiting guidance on the subject. Code:
#include"udf.h" |
Hi
I have not thoroughly checked your UDF but looking to the equations you should follow following steps: 1. define UDS with only unsteady term. 2. unsteady term = source term 3. solving step 2, you will get updated value of x which you overwrite and store in user memory for post processing and termination process (limiting value of x). 4. solve energy source term and p_eq Quick scanning of your UDF revealed: have you properly implemented all the equations of your interest? Please check this. Once all values stored in memory you can have monitor points to observe their variations. Best wishes |
Quote:
Thank You very much for your reply. I have done exactly what you have mentioned in steps 1,2 & 4. Regarding step 3, I believe you mean to say to use UDMI like C_UDMI(c,t,i) = C_UDMI(c,t,i) + rate * CURRENT_TIMESTEP; in the UDS source . But there is an option in plotting UDS-0 (in post processing panel) which I feel is same as 'x' what exactly I need. Awaiting your guidance. Regards, mukesh |
|
if you are talking from location point of view (for monitoring) then you will have to use mark option adapt tab.
|
Quote:
Thanks for that clue. I did went through the Aapt/mark ....option; But even after reading the manual I could not use that option for my need. It basically talked about registers(regions marked for coarsening/refining). Manipulation part was not clear. Had there been an example things would have been easier. I wish if you could explain little bit on that. Regards, Mukesh |
Hi Mukesh
No need to adapt as it coarsen/refine your mesh, only perform mark option. this will mark the number of cells in the region of your choice. Good luck Mvee |
Thanks Mvee, got it. But the marked registers are not available as separate regions for plotting contours or property plot [transient].
I'm sure something is missing on my part but couldnot figure it out. Regards, Mukesh |
I believe adapt option is only for monitoring / initialization / specific properties. You may post process based on the marked field. In that case you can have iso contours and other surface contours.
Best wishes Mvee |
MHD program
hello my dear!
I have a magnetic field in my flow and I read a lot of MHD tutorials but I am not able that in which format I should write this in c/c++ ....please if you have a similar c program me help. regards |
All the UDF codes are in C language with the known functions defined specifically for certain types of operations.
Please go through the UDF basics! |
Mhd
I have write it.but i don't know what i am doing?
#include "udf.h" #define Q 1.0; #define e0 1.0; #define er 3.0; #define pi 3.14159; #define s 0.0187; DEFINE_SOURCE(mhd_phi_source,c,t,eqn) { eqn = -(Q/(2*pi*e0))*((1/x)+(1/(s-x))); printf(eqn) return } |
This represent volume source which goes in energy eq. This source is a function of spatial coordinate (x axis) while other variables seem to be constants.
|
Electric Field
Quote:
|
You have to search in UDF manual and header file udf.h. udf.h will give you the function name and required definition of parameters.
|
Mahesh,
Could you use a UDM calculated in DEFINE_ADJUST and use it as the "explicit" value in DEFINE_UDS_UNSTEADY? Thanks, Shashank |
All times are GMT -4. The time now is 20:45. |