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

Problem in converting 2D udf to 3D code

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 4, 2015, 17:36
Default Problem in converting 2D udf to 3D code
  #1
New Member
 
Arman
Join Date: Jul 2015
Posts: 4
Rep Power: 11
armanp is on a distinguished road
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
armanp is offline   Reply With Quote

Old   November 5, 2015, 16:18
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
This code should work similarly in both 2-D and 3-D simulations. Have you double checked the dimensions, units and achieved mesh independence?
`e` is offline   Reply With Quote

Old   November 6, 2015, 12:33
Default
  #3
New Member
 
Arman
Join Date: Jul 2015
Posts: 4
Rep Power: 11
armanp is on a distinguished road
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.
armanp is offline   Reply With Quote

Old   November 6, 2015, 21:17
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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?
`e` is offline   Reply With Quote

Old   November 7, 2015, 08:20
Default
  #5
New Member
 
Arman
Join Date: Jul 2015
Posts: 4
Rep Power: 11
armanp is on a distinguished road
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?
armanp is offline   Reply With Quote

Old   November 7, 2015, 18:10
Default
  #6
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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.
`e` is offline   Reply With Quote

Old   November 8, 2015, 04:23
Default
  #7
New Member
 
Arman
Join Date: Jul 2015
Posts: 4
Rep Power: 11
armanp is on a distinguished road
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.
armanp is offline   Reply With Quote

Reply

Tags
cfd, three dimensional, two dimensional, udf


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
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


All times are GMT -4. The time now is 12:43.