|
[Sponsors] |
November 4, 2015, 17:36 |
Problem in converting 2D udf to 3D code
|
#1 |
New Member
Arman
Join Date: Jul 2015
Posts: 4
Rep Power: 11 |
Hi,
I am simulating a problem which had been solved in 2D and now trying to convert the code into 3D format to solve the 3D geometry. In this part of my udf (which I present below) I think I might have a problem because answers dont match the experiments like 2D. face = Lookup_Thread(d, Cell_id); begin_f_loop(f,face) { F_AREA(A,f,face); Area = NV_MAG(A); Cell_volt += F_UDSI(f,face,1)*Area; Tot_Area += Area; } end_f_loop(f,face) Cell_volt /= Tot_Area; I'm new to udfs Do you guys know how I must change this part for getting results like 2D? Thanks in advance for your help |
|
November 5, 2015, 16:18 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
This code should work similarly in both 2-D and 3-D simulations. Have you double checked the dimensions, units and achieved mesh independence?
|
|
November 6, 2015, 12:33 |
|
#3 |
New Member
Arman
Join Date: Jul 2015
Posts: 4
Rep Power: 11 |
Thanks for your response. The model is mesh independent, I've checked that. But, about units in governing equations, I will check them again and get back to you.
Does this problem has anything with solver settings? I'm using PISO scheme. Also, with smaller Time-steps I have better convergence. |
|
November 6, 2015, 21:17 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
The problem may be with your solver settings, it doesn't appear to be the UDF at fault. Ensure you have also achieved time-step independence. Are there any 3-D simulations you can compare results with in the literature, perhaps the computational model is inadequate for describing the 3-D effects in this particular case?
|
|
November 7, 2015, 08:20 |
|
#5 |
New Member
Arman
Join Date: Jul 2015
Posts: 4
Rep Power: 11 |
I think the problem may relate to time-step size. Because, I can't achieve to an independent time-step model! When I raise the time step(up to 1 sec), my results diverge or get into a loop that it couldn't converge. Also, unfortunately there isn't a 3D model of my simulation that I could verify my results with that. There is just that 2D model!
I want to note that almost all of udfs in my 2d model was dimensionless, except a gradient function in which I added the z-direction component. Is it a good approach to just solve the model for a mesh that has been extruded in z for just one cell and then if the answers were good continue adding cells? |
|
November 7, 2015, 18:10 |
|
#6 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Yes, you could start with comparing your 3-D simulation with one cell depth versus your 2-D simulation. The results should match, bearing in mind the cell depth length.
What geometry are you simulating? You'll need to achieve time-step independence. Perhaps start with a simpler case (such as a geometry which has steady flow) to validate your model/workflow. |
|
November 8, 2015, 04:23 |
|
#7 |
New Member
Arman
Join Date: Jul 2015
Posts: 4
Rep Power: 11 |
Thank you. I will try to simulate that and I'll get back to you.
My geometry is actually pretty simple. It is a box, divided into 4 parts. The Mesh around my walls and boundary conditions is intense. |
|
Tags |
cfd, three dimensional, two dimensional, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
fluent udf problem: write specific data for every iteration in a file. | nnvoro | Fluent UDF and Scheme Programming | 1 | May 27, 2013 16:26 |
correct UDF code for unsteady pressure boundary | James W | FLUENT | 0 | November 2, 2005 12:38 |
UDF (write a data file) problem | lichun Dong | FLUENT | 2 | July 29, 2005 12:39 |
Design Integration with CFD? | John C. Chien | Main CFD Forum | 19 | May 17, 2001 16:56 |
What is the Better Way to Do CFD? | John C. Chien | Main CFD Forum | 54 | April 23, 2001 09:10 |