CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Force dependent on particle position (https://www.cfd-online.com/Forums/openfoam-programming-development/87710-force-dependent-particle-position.html)

jranita April 27, 2011 07:17

Force dependent on particle position
 
Hi,

I am having some trouble calculating a force that is dependent on particle position.

In my case I must access the particle position from within particleForces.

My C++ is not brilliant, I am more of a Fortran, C, Ruby, ... guy.

Anyway I included Particle.H and vector.H in particleForces.C
In the calculation function added:
const vector& position_,
const ParticleType& p,

But I dont know how to get the current particle position...

while compiling I get:
particleForces/particleForces.C:220: error: ‘ParticleType’ was not declared in this scope
particleForces/particleForces.C:220: error: ‘p’ was not declared in this scope

Any suggestions?
How to obtain the current particle position in particleForces?

Thanks

davebritz August 23, 2011 19:44

Hi, I'm trying to do a similar thing at the moment and seem to be stuck at the same point. I'm wondering if you ever got an answer to this question or found a way to do it?

Thanks


All times are GMT -4. The time now is 05:47.