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

UDF Define grid motion and Remeshing dynamic mesh

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 22, 2019, 03:38
Default UDF Define grid motion and Remeshing dynamic mesh
  #1
New Member
 
nguyenhoa
Join Date: Apr 2019
Posts: 9
Rep Power: 7
nguyenhoa is on a distinguished road
Hi everybody
I am using the udf define grid motion to move the inlet boundary according to each time step (as picture shown). But during the process, the new grid is not added. I don't understand where the problem is, the wrong udf code or something else. Please help me
my udf code:
DEFINE_GRID_MOTION(girdmotion, domain, dt, time, dtime)
{
//Definitions of the Variables
face_t f;
Node *node_p;
Thread *tf = DT_THREAD (dt);
real t = CURRENT_TIME;
real a;
int n;
SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));
//Position Update of node_p
begin_f_loop (f, tf)
{
f_node_loop (f, tf, n)
{
node_p = F_NODE (f, tf, n);
if (NODE_POS_NEED_UPDATE (node_p))
{
NODE_POS_UPDATED (node_p);
NODE_Y (node_p) = NODE_Y (node_p)+0.035*dtime;
NODE_X (node_p) = NODE_X (node_p)+0.035*dtime;
if (NODE_Y (node_p)>0.2009)
{
NODE_Y (node_p) = 0.2009;
}
if (NODE_X (node_p)>0.446)
{
NODE_X (node_p) = 0.446;
}
}
}
}
}
end_f_loop (f, tf);
}
Attached Images
File Type: jpg grid error.jpg (131.5 KB, 53 views)
File Type: jpg geometry.jpg (34.1 KB, 46 views)
File Type: png udf define grid motion.PNG (24.1 KB, 55 views)
nguyenhoa is offline   Reply With Quote

Old   April 22, 2019, 20:36
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
what does your last (third) picture means?
why do you have code in console?

best regards
AlexanderZ is offline   Reply With Quote

Old   April 22, 2019, 21:07
Default
  #3
New Member
 
nguyenhoa
Join Date: Apr 2019
Posts: 9
Rep Power: 7
nguyenhoa is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
what does your last (third) picture means?
why do you have code in console?

best regards
That is the same code as the code on console. This code is used to move the inlet as shown in Figure 2.
Please help me to solve this problem?

best regards
nguyenhoa is offline   Reply With Quote

Old   April 22, 2019, 21:51
Default
  #4
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
why do you have code in console?

how do you hook UDF?
step by step

best regards
AlexanderZ is offline   Reply With Quote

Old   April 22, 2019, 21:59
Default
  #5
New Member
 
nguyenhoa
Join Date: Apr 2019
Posts: 9
Rep Power: 7
nguyenhoa is on a distinguished road
Quote:
Originally Posted by AlexanderZ View Post
why do you have code in console?

how do you hook UDF?
step by step

best regards
sorry it is my bad, i forgot that i have written this code in console so i attacted the third image to show this code.
i compiled this udf in fluent, hook this udf in dynamic mesh/dynamic mesh zones/ user-define, and preview mesh motion i have recieved result like picture 2. in this picture, new grid was not created. I think the problem is in my code.

best regards
nguyenhoa is offline   Reply With Quote

Old   July 20, 2023, 02:22
Default DEFINE_GRID_MOTION UDF code
  #6
New Member
 
Naren
Join Date: Jul 2023
Posts: 4
Rep Power: 2
Narendhiran_IIT_Madras is on a distinguished road
Hi
Im also facing issues while interpreting the UDF code.. Im getting "parse error" for the line:Thread *tf = DT_THREAD(dt); I checked multiple times, but cant clear this error.
pls share your views on it..Thanks in advance
Narendhiran_IIT_Madras is offline   Reply With Quote

Old   July 20, 2023, 02:41
Default
  #7
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
compile code
__________________
best regards


******************************
press LIKE if this message was helpful
AlexanderZ is offline   Reply With Quote

Reply

Tags
define grid motion, fluent, 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
Dynamic Mesh Problem. Tom Clark FLUENT 10 June 21, 2021 04:27
dynamic mesh using define grid motion udf fredrick Fluent UDF and Scheme Programming 15 December 21, 2020 17:06
Dynamic Mesh: Remeshing doesn´t work properly maccheese Fluent Multiphase 4 June 7, 2018 05:56
UDF Problem about Grid Motion !!! Zhengyu Gao Fluent UDF and Scheme Programming 0 December 6, 2013 19:45
Dynamic Mesh moving interface help akash.iitb FLUENT 0 August 23, 2010 23:53


All times are GMT -4. The time now is 18:14.