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

Wall forces in interFoam

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 30, 2011, 18:34
Default Wall forces in interFoam
  #1
New Member
 
Dave West
Join Date: Mar 2011
Location: US
Posts: 12
Rep Power: 15
Terp is on a distinguished road
Hey all.
I'm a newcomer to openFoam, and trying to get a handle on VOF. I have been modifying the damBreak tutorial in version 1.7.0 and I would like to output the force on an obstacle. In my controlDict, I added:

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (block); // change to your patch name
rhoName rhoInf;
rhoInf 1000; //Reference density for fluid
CofR (0 0 0);
outputControl outputTime;
//outputInterval 1;
}
);

Running proceeds until it tries to calculate the forces, then it errors out telling me:

--> FOAM FATAL IO ERROR:
keyword nu is undefined in dictionary ".../OpenFOAM/USRNAME-1.7.0/tutorials/multiphase/interFoam/laminar/damBreak/cons
tant/transportProperties"

But in the transportProperties file, nu is defined for both phase 1 and phase 2.

Does the "force" function not work in multiphase? If not, is there an easy way to integrate the pressure over a patch? Seems it would have to be p, not p_rgh.

A search showed that someone else had the same error, but they never mentioned if they got it working. Any help is greatly appreciated!
Terp is offline   Reply With Quote

Old   March 31, 2011, 02:58
Default
  #2
New Member
 
Jordi Muela
Join Date: Mar 2011
Posts: 27
Rep Power: 16
jordi.muela is on a distinguished road
Hi,

Yes, it works in multiphase. Try with:

libs ("libforces.so"); //if you don't have this line yet, you should add in controldict

functions
{ // note that i'm using { instead (
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (block); // change to your patch name
rhoName rhoInf;
rhoInf 1000; //Reference density for fluid
CofR (0 0 0);
outputControl outputTime;
outputInterval 1;
}
} //same here

hope it works for you!

Bye!
jordi.muela is offline   Reply With Quote

Old   March 31, 2011, 11:58
Default
  #3
New Member
 
Dave West
Join Date: Mar 2011
Location: US
Posts: 12
Rep Power: 15
Terp is on a distinguished road
Thanks for the reply. I tried changing the ( to { , but it still crashes with the same error. And nu is definitely defined for both phases in the transportproperties file, dispite what the error is telling me. Any other ideas?
Terp is offline   Reply With Quote

Old   April 13, 2011, 08:24
Default
  #4
New Member
 
Jordi Muela
Join Date: Mar 2011
Posts: 27
Rep Power: 16
jordi.muela is on a distinguished road
hi,

if i'm not wrong, you're running your case in laminar, ¿that's true? Previously, i've worked with RAS turbulent model, but today i ran a model in laminar and obtained the same message error that you.
I made some test and i found that if you write a nu definition out of the phases definition, it works.
Now the trouble is know how it affects to the simulation. My simulation is running now, so when it finish maybe i could obtain some results and extract some conclusion.

i hope that can be helpful to you!

Jordi
jordi.muela is offline   Reply With Quote

Old   April 13, 2011, 15:38
Default
  #5
New Member
 
Dave West
Join Date: Mar 2011
Location: US
Posts: 12
Rep Power: 15
Terp is on a distinguished road
Interesting. I'll try it with turbulence and see if the error goes away.

Thanks!
Terp is offline   Reply With Quote

Old   February 29, 2012, 10:57
Default
  #6
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Hi all,
What does it mean rhoInf for multiphase cases? rho is not constant in space (and also the viscosity).
Are you sure it works for multiphase simulations?

Regards

andrea
Andrea_85 is offline   Reply With Quote

Old   May 15, 2012, 08:37
Default
  #7
New Member
 
Teemo
Join Date: May 2012
Posts: 28
Rep Power: 14
Teemo is on a distinguished road
Hi all,

Have you solved this problem? I got the same question as yours but I still have no idea about how to deal with it

Regards
Teemo is offline   Reply With Quote

Old   May 15, 2012, 08:47
Default
  #8
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
Hi,
the force calculation tool is not designed for multiphase. If you want to have it for multiphase calculation you have to change a bit how the transport properties are read or how the forces are calculated, depending on what you want. Here there's an interesting thread about that:

http://www.cfd-online.com/Forums/ope...mulations.html

For my application i made my own library that calculates the forces in both phases separately. But if you are interested only in the forces for one phase it should be easier.


best

andrea
Andrea_85 is offline   Reply With Quote

Old   May 15, 2012, 08:59
Default
  #9
New Member
 
Jordi Muela
Join Date: Mar 2011
Posts: 27
Rep Power: 16
jordi.muela is on a distinguished road
Hi,

if you are interested in laminar cases, as Andrea says, you should modify the source files related to force calculation.

But if you work with turbulent cases, simply set rhoName to rho, this should work.

Example for incompressible RAS model:

Code:
00057     else if (obr_.foundObject<incompressible::RASModel>("RASProperties"))
00058     {
00059         const incompressible::RASModel& ras
00060             = obr_.lookupObject<incompressible::RASModel>("RASProperties");
00061 
00062         return rho()*ras.devReff();
00063     }
and rho() is:

Code:
00122 Foam::tmp<Foam::volScalarField> Foam::forces::rho() const
00123 {
00124     if (rhoName_ == "rhoInf")
00125     {
00126         const fvMesh& mesh = refCast<const fvMesh>(obr_);
00127 
00128         return tmp<volScalarField>
00129         (
00130             new volScalarField
00131             (
00132                 IOobject
00133                 (
00134                     "rho",
00135                     mesh.time().timeName(),
00136                     mesh
00137                 ),
00138                 mesh,
00139                 dimensionedScalar("rho", dimDensity, rhoRef_)
00140             )
00141         );
00142     }
00143     else
00144     {
00145         return(obr_.lookupObject<volScalarField>(rhoName_));
00146     }
00147 }
So, if rhoName is different to rhoInf, the function looks for the scalar field with the name that you set, in this case, "rho".
jordi.muela is offline   Reply With Quote

Old   May 15, 2012, 09:10
Default
  #10
New Member
 
Teemo
Join Date: May 2012
Posts: 28
Rep Power: 14
Teemo is on a distinguished road
Hi andrea,

Could you teach me how did you do that "calculates the forces in both phases separately"?

Regards
Teemo is offline   Reply With Quote

Old   May 15, 2012, 09:13
Default
  #11
Senior Member
 
Andrea Ferrari
Join Date: Dec 2010
Posts: 319
Rep Power: 16
Andrea_85 is on a distinguished road
if you write me your e-mail i can send you the files.

andrea
Andrea_85 is offline   Reply With Quote

Old   May 31, 2012, 04:40
Default
  #12
Member
 
liping_he
Join Date: Feb 2011
Posts: 36
Rep Power: 15
liping_he is on a distinguished road
Hi Andrea,

I created a case by combining the interDyMFoam (tutorials/multiphase/interDyMFoam/ras/damBreakWithObstacle) and pimpleDyMFoam (tutorials/incompressible/pimpleDyMFoam/propeller) to achieve the simulation of impulse turbine (multiphases flow and AMI). The screenshot of velocity field is shown in attachment containing three nozzles and a runner.
And now, I want to calculate the efficiency. A great issue comes out HOW can i obtain the torque (pressure and viscocity torque ) of runner. I have no idea about this issue. Any advice will be appreciated.


regards,
liping
Attached Images
File Type: jpg turbine.jpg (78.2 KB, 108 views)
liping_he is offline   Reply With Quote

Old   August 11, 2014, 19:46
Default calculating force
  #13
New Member
 
Ontario
Join Date: Aug 2014
Posts: 2
Rep Power: 0
samieh is on a distinguished road
hello every one
I am a new user of openfoam and I want to calculate the the force at some points in dambreak(at first i want to record the force without the structure). I have generated the mesh of my flume and i have set the setfields but i do not have any idea that how i can calculate the force on some points? i was wondering if you could please help me eith my problem?
samieh is offline   Reply With Quote

Old   January 12, 2015, 16:17
Default
  #14
Member
 
Pengchuan Wang
Join Date: Nov 2012
Location: Michigan USA
Posts: 58
Rep Power: 13
pechwang is on a distinguished road
Hi Andrea,

How are you? I'm new to OpenFOAM, can you teach me how to calculate the torque for the multiphase flow? Thank you so much.

Pengchuan
pechwang is offline   Reply With Quote

Old   April 11, 2017, 11:11
Default
  #15
New Member
 
Join Date: Mar 2017
Posts: 11
Rep Power: 9
Prat991 is on a distinguished road
Quote:
Originally Posted by Andrea_85 View Post
Hi,
the force calculation tool is not designed for multiphase. If you want to have it for multiphase calculation you have to change a bit how the transport properties are read or how the forces are calculated, depending on what you want. Here there's an interesting thread about that:

http://www.cfd-online.com/Forums/ope...mulations.html

For my application i made my own library that calculates the forces in both phases separately. But if you are interested only in the forces for one phase it should be easier.


best

andrea
Hi Andrea,
It is a quite old thread but I am new to OpenFoam. I have read your few post about this point. I also want to implement similar Force calculation for multiphase laminar case. I am more interested to calculate forces due to water on wall(any patch). Can you please teach me how to modify forces.C to get correct results.

Thank you.
Prat991 is offline   Reply With Quote

Reply

Tags
forces, interfoam, multiphase modelling


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
Thin Wall Heat Transfer BC for rhoSimpleFoam swahono OpenFOAM Running, Solving & CFD 12 October 4, 2013 12:49
Patches for OpenFOAM 1.7 on MacOS X gschaider OpenFOAM Installation 101 September 21, 2011 06:37
Forces on corrugated wall kjetil OpenFOAM Post-Processing 0 November 1, 2010 18:16
Quick Question - Wall Function D.Tandra Main CFD Forum 2 March 16, 2004 05:29
Extapolation of forces with wall laws. Shu-Ren Hysing Main CFD Forum 3 October 14, 2002 05:46


All times are GMT -4. The time now is 12:21.