CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM

Lift and Drag are 0

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 28, 2018, 15:35
Default Lift and Drag are 0
  #1
New Member
 
Join Date: Aug 2018
Posts: 2
Rep Power: 0
gmpatzer is on a distinguished road
Hi, I converted a STL sphere into the Openfoam format using this guide (http://sourceflux.de/blog/preparing-geometry/).

I am using the simpleFoam solver and I'm trying to print out the coefficients of drag and lift. However, they are all returning 0. Here is my controlDict file:

Code:
functions
{
  #includeFunc streamlines
  forcesCoeffs
  {
    type forceCoeffs;
    functionObjectLibs ( "libforces.so" ); // lib to load
    writeControl timeStep;
    writeInterval 50;
    rho rhoInf;
    patches
    (
    body // change to your patch name
    );
    rhoInf 1000;
    log true; // dump to file
    CofR ( 0 0 0 );
    liftDir ( 0 1 0 );
    dragDir ( 1 0 0 );
    pitchAxis ( 0 0 0 );
    magUInf 9;
    lRef 1;
    Aref 0.1;
  }
}
(I got the code from this forum post: lift and drag coefficient) I modified that forum post a couple of times (e.g by removing pName and UName) to no avail.

This is the code in my fvSolution

Code:
solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-06;
        relTol          0.1;
        smoother        GaussSeidel;
    }

    "(U|k|epsilon|omega|f|v2)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-05;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    consistent      yes;
    pRefCell  0;
    pRefPoint 0;
    pRefValue 0;

    residualControl
    {
        p               1e-2;
        U               1e-3;
        "(k|epsilon|omega|f|v2)" 1e-3;
    }
}

relaxationFactors
{
    equations
    {
        U               0.9; // 0.9 is more stable but 0.95 more convergent
        ".*"            0.9; // 0.9 is more stable but 0.95 more convergent
    }
}
I am fairly new to this software. Does anyone have any recommendations for what I can do? Thanks!
gmpatzer is offline   Reply With Quote

Old   August 30, 2018, 05:31
Default
  #2
Senior Member
 
Join Date: Mar 2014
Posts: 112
Rep Power: 12
mzzmrt is on a distinguished road
as you see in controlDict;


"patches (body); ..."


you have to use the defined wall(s) name(s) here instead of "body"
mzzmrt is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculation of lift and drag coefficients on airfoil CoolHersheys OpenFOAM Post-Processing 5 September 27, 2021 07:04
How to calculate lift, drag and lift distribution in Star CCM+? israelcasillas94 STAR-CCM+ 4 November 6, 2020 09:35
wrong SU2 calculation for lift and drag coefficient for NAC4421 mechy SU2 7 January 9, 2017 06:18
[OpenFOAM] Display lift and Drag in paraview SamerAli ParaView 1 May 16, 2013 13:51
Correct lift but wrong pressure drag - possible? zx Main CFD Forum 4 July 28, 2007 00:38


All times are GMT -4. The time now is 10:09.