CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Adding forcecoeffs file to the controldict is causing pimpleDyMfoam to crash. (https://www.cfd-online.com/Forums/openfoam-solving/140181-adding-forcecoeffs-file-controldict-causing-pimpledymfoam-crash.html)

pruthvi1991 August 9, 2014 20:01

Adding forcecoeffs file to the controldict is causing pimpleDyMfoam to crash.
 
2 Attachment(s)
Hello all! I simulated an oscillating airfoil using pimpleDyMfoam and got some results. Later I added a forcecoeffs file and ran it again to measure forces and the solution is crashing.

I checked the log files and it seems like the forcecoeffs is altering the initial conditions of the spring. I gave anchor(0,0,0) , refattachment(0,0,0), velocity(0, 0.8, 0). In the log.pimpleDyMfoam file, it shows the initial spring length as (0, 9e-5,0) when it should actually be (0,0,0).

Here is my forcecoeffs file. At the end of the controldict file I added #include "forceCoeffs"

forceCoeffs1
{
type forceCoeffs;
// type forces;

functionObjectLibs ( "libforces.so" );

outputControl timeStep;
timeInterval 1;

log yes;

patches ( wing );
pName p;
UName U;
rhoName rhoInf; // Indicates incompressible
log true;
rhoInf 1; // Redundant for incompressible
liftDir (0 0 1);
dragDir (1 0 0);
CofR (0 0 0); // Axle midpoint on ground
pitchAxis (0 1 0);
magUInf 0;
lRef 0.001; // Wheelbase length
Aref 0.002; // Estimated

// binData
// {
// nBin 20; // output data into 20 bins
// direction (1 0 0); // bin direction
// cumulative yes;
// }
}

I uploaded the log.pimpleDyMfoam and dynamicMeshDict files. Please help me guys.

tomf August 11, 2014 03:38

Did you put your include statement like this?

functions
{
#include "forceCoeffs"
}

It has to be inside the functions subdict.

Regards,
Tom

pruthvi1991 August 11, 2014 14:16

2 Attachment(s)
Quote:

Originally Posted by tomf (Post 505317)
Did you put your include statement like this?

functions
{
#include "forceCoeffs"
}

It has to be inside the functions subdict.

Regards,
Tom

Hey Tom ! Thanks for the reply. I added it in the functions subdict. Yesterday I modified my controldict file by adding the lib.openFOAM.so. I still get the error. I'm uploading the new controldict file and log file. Please take a look.

ngj August 11, 2014 16:56

Good evening,

I am wondering, whether it is because magUInf is set to zero, i.e. when computing the force coefficient based on the magnitude of the incident velocity, you are likely to divide by zero.

Kind regards

Niels

pruthvi1991 August 13, 2014 05:42

Hello ! I tried changing the magUInf to non-zero values and it is still crashing. The unexpected thing is that when I add the forceCoeffs file it is changing the initial conditions of the spring. The anchor is supposed to be (0,0,0) but its showing a non-zero value instead.

tomf August 13, 2014 05:54

Just wondering what would happen if you run the simulation for a few (say 10) time steps with the functions section commented out and than uncomment this section. I wonder if there is something special about just the first time step that may cause this, but it looks a bit strange indeed.

Regards,
Tom

pruthvi1991 August 14, 2014 21:56

Hey I tried your suggestion and its still crashing. Could it be my bcs ? I gave a zero gradient on all four sides. There is no ambient velocity. The flatplate is plunging in still air. I added the following two lines to the fvSolutions file
PIMPLE
{
correctPhi yes;
nOuterCorrectors 2;
nCorrectors 1;
nNonOrthogonalCorrectors 0;
pRefCell 0; // These two were added
pRefValue 0;
//
}

Is it possible that the pRefValue shouldnt be zero ?

pruthvi1991 August 15, 2014 01:59

I just found out that the wingMotion case is also crashing when I insert the forceCoeffs file. I would really appreciate if someone can try it and check if its a bug in pimpleDyMFoam. I was able to extract data from pimpleFoam but not from pimpleDyMFoam.

tomf August 20, 2014 04:19

Hi, just did the test with the tutorial. It runs perfectly fine when magUInf is non-zero, so I cannot reproduce your error.

pruthvi1991 August 20, 2014 11:39

Hey Tom ! Thanks for your time. How long did you run the simulation? When I ran the test case, it went on for a while before crashing. Could you upload your log file please? If I confirm that your simulation ran fine, I will reinstall openfoam230.

tomf August 25, 2014 04:31

Hi

It ran for the entire time a set in the controlDict for the case. I had to rerun the case to get the log since I deleted it last time. You can download the log here:

http://we.tl/CD48eDLusI

to get the log back:
tar xzf log.tgz

Regards,
Tom

pruthvi1991 October 6, 2014 23:03

Hello Tom! I checked your log file. Thanks a lot. I was able to run the simulations successfully if I choose 3 cores. The solution is crasing for any other number on my laptop. My laptop has 4 cores and 8 threads. I read about it online. It is called a race condition. Do you know what could be causing it?

tomf October 10, 2014 04:56

I will not be able to help you with that issue I'm afraid. Sounds like a hardware/software compatibility issue, or maybe related to compiling? Really have no clue. Good luck.

Tom

pruthvi1991 April 13, 2015 01:46

Solved!
 
Hello everybody!

This is a bug in OpenFOAM code and it has been resolved by commit 5179e8ea3bcb24cdb6ad0ac96764c0d562a55945 .

Thanks for the help.


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