CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Changing piston motion profile in engineFoam (http://www.cfd-online.com/Forums/openfoam-solving/60318-changing-piston-motion-profile-enginefoam.html)

kukikano February 22, 2006 18:56

Is it possible to set a differ
 
Is it possible to set a different piston motion profile in the engineFoam solver in a simple way? (To investigate innovative engine design.) Say, I want the piston height simply to be equal to a*cos(crankAngle)+b, instead of the current function which includes the ratio of connecting rod length to crankshaft radius.

I am not fluent in C++ (nor OpenFOAM), so your help on this would be appreciated. By looking through the source files I have found that the file $HOME/OpenFOAM/OpenFOAM-1.2/src/engine/engineTime/engineTime.C appears to set the piston position based on the crank angle. (The "scalar engineTime::pistonPosition(const scalar theta) const" expression.) I tried to modify the expression and run wmake in OpenFOAM-1.2/src/engine/, but with no effect on the simulations.

I may be off-beam in my attempts but this should be a fairly simple thing to do, right?

Thanks,

Rikard

guido_adriaensen February 23, 2006 03:11

Hello Rikard, You found the
 
Hello Rikard,

You found the correct file for the piston motion. You should indeed change the file at the part you specified. I think that what is going wrong is the compilation. Did you run run wmake of wmake libso? You should use the latter since these files are the libraries for the engineFoam solver. (If I'm saying something wrong, please correct me). If you look at the file files in the make directory you can see that it should create a lib.

Guido

kukikano February 23, 2006 09:10

Hi Guido, You are right, th
 
Hi Guido,

You are right, the compilation was the problem. 'wclean' and 'wmake libso' did the trick, now it all works like I want it to. Thanks a lot!

Rikard


All times are GMT -4. The time now is 06:37.