|
[Sponsors] |
February 19, 2016, 01:46 |
Error in Zone motion
|
#1 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
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); } ..\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 |
|
February 19, 2016, 12:08 |
|
#2 |
Senior Member
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27 |
In DEFINE_ZONE_MOTION, omega is a pointer. To assign a rotation, your code should be
Code:
*omega = 10; 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); |
|
February 19, 2016, 13:51 |
|
#3 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
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); } 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 |
|
March 20, 2016, 05:00 |
|
#4 |
Senior Member
Join Date: Mar 2013
Location: B'lr
Posts: 130
Rep Power: 13 |
I solved this problem with DEFINE_SOURCE. I'm moving to the next case i.e, accelerating the Drop tank using the same macro.
|
|
|
|
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 |