CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Drag Coefficient monitoring (

stefan.gracik January 22, 2012 19:13

Drag Coefficient monitoring
Are there any tools out there that enable you to monitor things like the drag coefficient while the solver is running? My goal is to be able to stop the simulation if it looks like the drag coefficient (or particular variable of interest) has converged but the solver hasn't reached convergence criteria yet.

MadsR January 23, 2012 04:45

I think you need to find the search button on this forum :-) Or, you could do a

grep "forceCoeffs" `find $WM_PROJECT_DIR -name 'controlDict'`

on your machine. Anyways, add the below (taken from the motorbike tutorial) to your controlDict file and watch how force coefficients pop up in the <case>/forceCoeffs directory. It's like magic! :-) . Remember to alter the settings to match your setup (patch, direction-vectors and reference areas and lengths).

type forceCoeffs;
functionObjectLibs ( "" );
outputControl timeStep;
outputInterval 1;

patches ( "motorBike.*" );
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.72 0 0); // Axle midpoint on ground
pitchAxis (0 1 0);
magUInf 20;
lRef 1.42; // Wheelbase length
Aref 0.75; // Estimated


stefan.gracik January 23, 2012 10:52

Thanks for the response, but I guess I should have been more clear. I know how to get the values for force coeffs. I'm just wondering if there is some type of add-on that could graph this while the solver is running.

For example, I use pyFoam to plot the residuals in gnuplot as the solution converges, I was wondering if there was something out there that could do the same thing for forceCoeffs. This way I could actively watch the values and stop the simulation when it looks like forceCoeffs has reached a constant value.

I suppose I could just look at the text file while solving.....


MadsR January 23, 2012 11:07

Ah sorry, I misunderstood you. You want the fancy option :-)
A quick and dirty approach would of course be to just fire up Gnuplot and do a repl now and then, but I guess you are doing that already and it's not really what you want.


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