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

N3V_D,N3V_S(what's the meaning)

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree5Likes
  • 1 Post By zhereal
  • 4 Post By pakk

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 25, 2014, 08:05
Question 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
zhereal is on a distinguished road
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
vavnoon likes this.
zhereal is offline   Reply With Quote

Old   February 25, 2014, 09:41
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
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.

pakk is offline   Reply With Quote

Old   February 25, 2014, 22:41
Default
  #3
New Member
 
He Zhao
Join Date: Feb 2013
Location: Shanghai(now)
Posts: 11
Rep Power: 13
zhereal is on a distinguished road
Thank you very much, pakk!
Today I will have a try.
zhereal is offline   Reply With Quote

Old   April 13, 2014, 10:42
Default
  #4
New Member
 
sam daysley
Join Date: Feb 2013
Posts: 28
Rep Power: 13
daysley is on a distinguished road
Quote:
Originally Posted by pakk View Post
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.


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
daysley is offline   Reply With Quote

Old   April 13, 2014, 15:11
Default
  #5
New Member
 
He Zhao
Join Date: Feb 2013
Location: Shanghai(now)
Posts: 11
Rep Power: 13
zhereal is on a distinguished road
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
zhereal is offline   Reply With Quote

Old   April 13, 2014, 15:13
Default
  #6
New Member
 
sam daysley
Join Date: Feb 2013
Posts: 28
Rep Power: 13
daysley is on a distinguished road
Thank you very much zhereal I appreciate it :-)
daysley is offline   Reply With Quote

Old   December 3, 2020, 01:55
Default
  #7
New Member
 
Tanuj Srivastava
Join Date: Mar 2019
Posts: 15
Rep Power: 7
S_Tanuj is on a distinguished road
Quote:
Originally Posted by pakk View Post
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.


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.
S_Tanuj is offline   Reply With Quote

Old   December 3, 2020, 02:55
Default
  #8
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 26
pakk will become famous soon enough
In 2D the concept is exactly the same. Just ignore the third coordinate.
pakk is offline   Reply With Quote

Old   December 8, 2020, 01:04
Default frame motion doubt
  #9
New Member
 
Tanuj Srivastava
Join Date: Mar 2019
Posts: 15
Rep Power: 7
S_Tanuj is on a distinguished road
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)
S_Tanuj is offline   Reply With Quote

Reply

Tags
n3v_d, n3v_s

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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



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