|
[Sponsors] |
December 20, 2018, 17:59 |
Body_Force_UDF Trouble
|
#1 |
New Member
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
Hi everyone,
I am working on a body force UDF right now and am having some trouble. I am pretty new to programming so it may be something very simple but I keep getting an error that says "Contact_force_body_force.c(13): error C2109: subscript requires array or pointer type Contact_force_body_force.c(18): error C2109: subscript requires array or pointer type" I am a little confused by this because I thought the tp was the pointer and that the i should be Cartesian coordinates already build in. Can someone help out? My code is: #include "udf.h" #define TSTART 5.0 /* field applied at t = tstart */ DEFINE_DPM_BODY_FORCE(particle_body_force,tp,i) { real bforce=0; real deltaV=0; if(TP_TIME(tp)>=TSTART) { if(i==0) { deltaV= TP_VEL(tp)[0]-TP_VELO(tp)[0]; bforce=TP_Mass(tp)*deltaV; } else if(i==1) { deltaV= TP_VEL(tp)[1]-TP_VELO(tp)[1]; bforce=TP_Mass(tp)*deltaV; } else { deltaV=0; bforce=0; } } } |
|
December 21, 2018, 01:07 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
change
Code:
real deltaV=0; Code:
real deltaV[3]; best regards |
|
December 28, 2018, 11:28 |
|
#3 |
New Member
Join Date: Jun 2018
Posts: 8
Rep Power: 8 |
The ultimate answer to this for anyone with a similar problem was to take out deltaV and just use that equation directly in my bforce.
After that the only issue was I was using a O instead of a zero. |
|
Tags |
19.1, body_force, fluent - udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[waves2Foam] Having a lot of trouble for a short wavelengths | arieljeds | OpenFOAM Community Contributions | 1 | January 2, 2024 14:10 |
Trouble with rotating wall boundary condition | king1989 | OpenFOAM Running, Solving & CFD | 7 | July 29, 2016 14:44 |
Trouble with sampleDict syntax for OpenFOAM 2.3.1 | rawdoggity | OpenFOAM Post-Processing | 1 | February 1, 2015 06:24 |
[ICEM] trouble with mesh quality from ICEM in CFX Solver | escher25 | ANSYS Meshing & Geometry | 0 | February 28, 2011 08:38 |
[GAMBIT] Trouble meshing complex VOF geometry | RPJones | ANSYS Meshing & Geometry | 2 | February 14, 2011 19:54 |