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

Error in Zone motion

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 19, 2016, 01:46
Exclamation Error in Zone motion
  #1
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
Hi all,
I have been working on motion of fluid in side the aircraft drop tank. For my initial case fluid is moving to and fro. For this case I used the following code but is yeilding error. what is the problem? Any help would be greatly appreciated.
Code:
#include "udf.h"

DEFINE_ZONE_MOTION(fmotion, omega, axis, origin, velocity, time, dtime)
{
if(time<10)
{
omega = 10;
}
else
omega=0;

N3V_D(velocity,=,0.05*sin(omega*time), 0.0, 0.0);
}
Error reads

..\src\motion.c(14): warning: not enough actual motion parameters for macro 'NV_D'
..\src\motion.c(14): error C2109 subscripts requires pointer or error type
..\src\motion.c(14): error C2109 subscripts requires pointer or error type
..\src\motion.c(14): error C2109 subscripts requires pointer or error type

Thank you
shivakumar is offline   Reply With Quote

Old   February 19, 2016, 12:08
Default
  #2
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
In DEFINE_ZONE_MOTION, omega is a pointer. To assign a rotation, your code should be

Code:
*omega = 10;
Note the extra star.

I think this also causes your later problem: you try to take the sine of the pointer, where you should take the sine of the value.

Code:
N3V_D(velocity,=,0.05*sin(*omega*time), 0.0, 0.0);
Again, note the extra star.
pakk is offline   Reply With Quote

Old   February 19, 2016, 13:51
Unhappy
  #3
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
Dear pakk,

Thank you for the reply. I just tried with the same code but this time no. of errors have been increased.

Code:
#include "udf.h"
DEFIINE_ZONE_MOTION(fmotion, omega, axis, origin, velocity, time, dtime)
{
	if(time<10)
	{
		*omega=10;
	}
	else
	{
		*omega=0;
	}
	
	N3V_D(velocity,=,0.05*sin(*omega*time), 0.0, 0.0);
}
Errors are

udf_names.c and user_nt.udf files in 3ddp_node are upto date.
(system "copy "C:\PROGRA~1\ANSYSI~2\v150\fluent"\fluent15.0.0\sr c\makefile_nt.udf "libudf\win64\3ddp_node\makefile" ")
1 file(s) copied.
(chdir "libudf")(chdir "win64\3ddp_node")# Generating ud_io1.h
zone_motion.c
..\..\src\zone_motion.c(7) : error C2100: illegal indirection
..\..\src\zone_motion.c(11) : error C2100: illegal indirection
..\..\src\zone_motion.c(14) : error C2109: subscript requires array or pointer type
..\..\src\zone_motion.c(14) : error C2100: illegal indirection
..\..\src\zone_motion.c(14) : error C2109: subscript requires array or pointer type
..\..\src\zone_motion.c(14) : error C2109: subscript requires array or pointer type

Done.



Also i tried it in another way, For Example

Int x;
int *omega;
omega=&x
;

and this too didnt work.


Thank you
shivakumar is offline   Reply With Quote

Old   March 20, 2016, 05:00
Smile
  #4
Senior Member
 
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13
shivakumar is on a distinguished road
I solved this problem with DEFINE_SOURCE. I'm moving to the next case i.e, accelerating the Drop tank using the same macro.
shivakumar is offline   Reply With Quote

Reply


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
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 07:20
Possible Bug in pimpleFoam (or createPatch) (or fluent3DMeshToFoam) cfdonline2mohsen OpenFOAM 3 October 21, 2013 10:28
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem Attesz OpenFOAM Meshing & Mesh Conversion 12 May 2, 2013 11:52
Problem in running ICEM grid in Openfoam Tarak OpenFOAM 6 September 9, 2011 18:51
Problem in IMPORT of ICEM input file in FLUENT csvirume FLUENT 2 September 9, 2009 02:08


All times are GMT -4. The time now is 17:52.