CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Forces on multiple patches in InterDyMFoam (https://www.cfd-online.com/Forums/openfoam-post-processing/104540-forces-multiple-patches-interdymfoam.html)

Claudio July 11, 2012 17:51

Forces on multiple patches in InterDyMFoam
 
Hi,

I want to compute the total forces across multiple patches. I am running a rectangular sloshing tank where each of the 4 walls is its own patch (LeftWall, RightWall, TopWall, BottomWall).
I tried to use the same script in controlDict that I use when the 4 walls form one single patch, but I am not sure that I get the right results.

Here's my controlDict:
Code:

    forces
    {
        type forces;
        functionObjectLibs ("libforces.so"); //Lib to load
        patches (TopWall, BottomWall, LeftWall, RightWall); // change to your patch name
        rhoInf 1000.; //Reference density for fluid
//        rhoName rhoInf;
        rhoName rho;
        pName p;
        UName U;
        CofR (0 0 0); //Origin for moment calculations
        outputControl  outputTime;
        outputInterval 0.108;
    }

Any suggestion on what might be wrong?

Thanks.

Claudio July 13, 2012 11:13

THe answer
 
Found the answer in a pre-processing thread:

Code:

    forces   
{        type forces;
        functionObjectLibs ("libforces.so"); //Lib to load
        patches (TopWall BottomWall LeftWall RightWall); // change to your patch name
        rhoInf 1000.; //Reference density for fluid
        rhoName rho;
        pName p;
        UName U;
        CofR (0 0 0); //Origin for moment calculations
        outputControl  outputTime;
        outputInterval 0.108;    }

No commas in the list of the patches names.

pechwang February 6, 2013 18:08

Hi Claudio,

I'm new to OpenFOAM. And my research is about flow between two plates, one is stationary and one is rotating. I want to know the torques both on the topwall and the bottomwall. However, when I added two patch names, OpenFOAM only gives me the difference between these two torques. Can you help me with this? Thank you.

Quote:

Originally Posted by Claudio (Post 371335)
Found the answer in a pre-processing thread:

Code:

    forces   
{        type forces;
        functionObjectLibs ("libforces.so"); //Lib to load
        patches (TopWall BottomWall LeftWall RightWall); // change to your patch name
        rhoInf 1000.; //Reference density for fluid
        rhoName rho;
        pName p;
        UName U;
        CofR (0 0 0); //Origin for moment calculations
        outputControl  outputTime;
        outputInterval 0.108;    }

No commas in the list of the patches names.


Bashar October 19, 2016 17:46

Quote:

Originally Posted by pechwang (Post 406425)
Hi Claudio,

I'm new to OpenFOAM. And my research is about flow between two plates, one is stationary and one is rotating. I want to know the torques both on the topwall and the bottomwall. However, when I added two patch names, OpenFOAM only gives me the difference between these two torques. Can you help me with this? Thank you.

Hi , did you manage to solve this isuues?

pechwang October 19, 2016 20:13

Hi Hassan,

Yes, the right way is that you need to calculate the torque on each plate separately. So the right format should be:

functions
(
force1
{
type forces;
functionObJectLibs ("libfroces.so")
outputControl timeStep;
outputInterval 10;
patches (patch_name)
pname p;
uname U;
rhoName rhoInf;
log true;
rhoInf XXX;
CofR (0 0 0);
}
forces2
{
same information as above, the only difference should be the patch name
}
)

Bashar October 20, 2016 12:46

Thanks a lot for your help


All times are GMT -4. The time now is 19:38.