|
[Sponsors] |
February 25, 2014, 08:05 |
N3V_D,N3V_S(what's the meaning)
|
#1 |
New Member
He Zhao
Join Date: Feb 2013
Location: Shanghai(now)
Posts: 11
Rep Power: 13 |
Hi,
Could anyone explain me that what‘s the meaning of “N3V_D,N3V_S”? I saw the two macro in (2.3.9. DEFINE_ZONE_MOTION)in UDF help #include "udf.h" DEFINE_ZONE_MOTION(fmotion,omega,axis,origin,veloc ity,time,dtime) { if (time < 0.1) { *omega = 2500.0 * time; } else { *omega = 250.0; } N3V_D (velocity,=,1.0,0.0,0.0); N3V_S(origin,=,0.0); /* default values, line could be omitted */ N3V_D(axis,=,0.0,0.0,1.0); /* default values, line could be omitted */ return; } but I can’t find “N3V_D,N3V_S” in help. another question: N3V_S(origin,=,0.0); I think origin is 3 dimension,(for example N3V_S(origin,=,0.0,0.0,0.0)),I don't know why it just has 1 dimension in UDF help. thankyou Regards, Zhereal |
|
February 25, 2014, 09:41 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
If you are working in 3D, then N3V_D means the same as NV_D. If you are working in 2D, then N3V_D is not defined. So you can ignore the 3.
In general, these definitions are hidden in "C:\Program Files\ANSYS Inc\v???\fluent\fluent??.?.?\src" In mem.h and global.h, I found: NV_D(a,EQ,x0,x1,x2)=ND_D((a)[0],(a)[1],(a)[2],EQ,x0,x1,x2) ND_D(a0,a1,a2,EQ,x0,x1,x2)=ND_VEC((a0)EQ(x0),(a1)E Q(x1),(a2)EQ(x2)) NV_S(a,EQ,s)=ND_VEC((a)[0]EQ(s),(a)[1]EQ(s),(a)[2]EQ(s)) ND_VEC(x,y,z)=x,y,z So, expanding your first expression, assuming 3D: N3V_D (velocity,=,1.0,0.0,0.0); becomes NV_D (velocity,=,1.0,0.0,0.0); becomes ND_D(velocity[0],velocity[1],velocity[2],=,1.0,0.0,0.0) becomes ND_VEC(velocity[0]=1.0,velocity[1]=0.0,velocity[2]=0.0) becomes velocity[0]=1.0,velocity[1]=0.0,velocity[2]=0.0 Similarly, with your second expression: N3V_S(origin,=,0.0); becomes NV_S(origin,=,0.0); becomes ND_VEC(origin[0]=0.0,origin[1]=0.0,origin[2]=0.0); becomes origin[0]=0.0,origin[1]=0.0,origin[2]=0.0; So with N3V_S you give every component the same value. |
|
February 25, 2014, 22:41 |
|
#3 |
New Member
He Zhao
Join Date: Feb 2013
Location: Shanghai(now)
Posts: 11
Rep Power: 13 |
Thank you very much, pakk!
Today I will have a try. |
|
April 13, 2014, 10:42 |
|
#4 | |
New Member
sam daysley
Join Date: Feb 2013
Posts: 28
Rep Power: 13 |
Quote:
Hi PAKK and Zhereal, i don't suppose you know how i would use NV_D or NV_S to change the origin to another position do you? i cant seem to get the rotational origin to change? thank you in advance |
||
April 13, 2014, 15:11 |
|
#5 |
New Member
He Zhao
Join Date: Feb 2013
Location: Shanghai(now)
Posts: 11
Rep Power: 13 |
Hi daysley,
My English is not good.I thick you will want to change origin,right? you can use "ND_VEC(origin[0]=a,origin[1]=b,origin[2]=c);" or "origin[0]=0.0,origin[1]=0.0,origin[2]=0.0;" have a good day |
|
April 13, 2014, 15:13 |
|
#6 |
New Member
sam daysley
Join Date: Feb 2013
Posts: 28
Rep Power: 13 |
Thank you very much zhereal I appreciate it :-)
|
|
December 3, 2020, 01:55 |
|
#7 | |
New Member
Tanuj Srivastava
Join Date: Mar 2019
Posts: 15
Rep Power: 7 |
Quote:
What if I have to deal with 2-D? I want to fix origin velocity to be 0. I want my system to SHM wrt to origin. |
||
December 3, 2020, 02:55 |
|
#8 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26 |
In 2D the concept is exactly the same. Just ignore the third coordinate.
|
|
December 8, 2020, 01:04 |
frame motion doubt
|
#9 |
New Member
Tanuj Srivastava
Join Date: Mar 2019
Posts: 15
Rep Power: 7 |
I have a simple 2D box having fluid inside with no other contact from outside (or no interface). When I try to give it SHM, using the code below, by checking frame motion option in cell zone condition, the zone does not look rotate.
#include "udf.h" #define Freq 0.125 #define angular_freq 2.0*M_PI*Freq #define tetmax 5.0*M_PI/180 DEFINE_ZONE_MOTION(UCTP8AMP05, omega, axis, origin, velocity, time, dtime) { real t = CURRENT_TIME; N3V_D(velocity, = , 0.0, 0.0, 0.0); *omega = tetmax*angular_freq*cos(angular_freq*t); } I followed video on youtube related to frame motion "https://www.youtube.com/watch?v=tHd2ODQCcxM&t=1039s&ab_channel=Ansys-Tutor" but I want unsteady case. So my confusion is that, when I apply frame motion rotating about Z axis with the UDF mentioned above, does it really look to rotate or it looks stationary but in actual it rotates. (In mesh motion you can see it rotating, but it needs some interface I guess) |
|
Tags |
n3v_d, n3v_s |
Thread Tools | Search this Thread |
Display Modes | |
|
|