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

Forces in OF15

Register Blogs Community New Posts Updated Threads Search

Like Tree6Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 8, 2008, 08:01
Default thanks Ivan, I figured out
  #41
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
thanks Ivan,

I figured out the problem. there was a syntax error.

can u tell me how to plot the graphs from .dat

thanx again.
mgz1985 is offline   Reply With Quote

Old   August 11, 2008, 08:57
Default hi Ivan i am able to get t
  #42
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
hi Ivan

i am able to get the coefficients but they are very weird values

when I use Aref=1, I get Cd=7e-05 and Cl=1.38e-04

so i tried it by reducing Aref to 0.00001 (i know it is wrong) i get the order correct for Cd but Cl is still one order low.

can anyone tell me where could be the possible error?

thanx
mgz1985 is offline   Reply With Quote

Old   August 25, 2008, 02:41
Default hi srinath, sorry to be pos
  #43
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17
mgz1985 is on a distinguished road
hi srinath,

sorry to be posting my query here. I wanted to know if some-one has verified the liftDrag codes with the wind-tunnel datas for an airfoil. I have tried every thing I knew with OpenFOAM-1.5 forces function but I get wrong results for Cl although Cd is perfect. (icoFoam because it is incompressible flow)

the error is in reference length I guess because even if i change the reference length, it does not affect my results.

can u suggest me something new to try?
mgz1985 is offline   Reply With Quote

Old   September 2, 2008, 17:05
Default Hi all, I am quite new to O
  #44
New Member
 
Join Date: Mar 2009
Posts: 7
Rep Power: 17
dnomdec is on a distinguished road
Hi all,

I am quite new to OpenFOAM. Trying to work on the source code for a little bit. Could someone help me by pointing me to the actual piece of code OpenFOAM uses to read in dictionaries? In particular, how does it get the variable "name_" in the forces class? I tried looking into various files, but quickly got buried by the typedefs, macro functions and so on...

Sorry for hijacking this thread...if people think it's irrelevant, i'll start a new thread.

Thx,
Ned
dnomdec is offline   Reply With Quote

Old   October 23, 2008, 14:34
Default Dear all, When I compile fo
  #45
Senior Member
 
ZHOU Bin
Join Date: Mar 2009
Location: Nanjing/Torino, Nanjing/Piemente, China/Italy
Posts: 164
Rep Power: 17
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Dear all,

When I compile forces directory in OF 1.5 using wmake, I get:
forces.C.text._ZN4Foam14GeometricFieldINS_10SymmTensorIdEE NS_12fvPatchFieldENS_7volMeshE EC1ERKNS_4wordERKS5_[Foam::GeometricField<foam::symmtensor<double>, Foam::fvPatchField, Foam::volMesh>::GeometricField(Foam::word const&, Foam::GeometricField<foam::symmtensor<double>, Foam::fvPatchField, Foam::volMesh> const&)]+0x7d): undefined reference to `Foam::GeometricField<foam::symmtensor<double>, Foam::fvPatchField, Foam::volMesh>::debug'
collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

I am trying to calculate the drag coefficient around one classic cylinder.

Just for your information.

Bin
zhoubinwx is offline   Reply With Quote

Old   October 24, 2008, 06:07
Default Hi Bin, I don't think you'l
  #46
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
Hi Bin,

I don't think you'll need to compile the forces directory, it should be already be compiled when you installed OpenFOAM-1.5

What you need to do is the following:

1. Make sure that the whole cylinder wall is a single patch, from what I know, the forces function only works on one surface.

2. Copy the following lines to the end of your controlDict file

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (fixedWall); // change to your patch name
rhoInf 1.225; //Reference density for fluid
CofR (0.15 0 0); //Origin for moment calculations
}
forceCoeffs
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
patches (fiexdWall); //change to your patch name
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 55.5;
lRef 0.6;
Aref 1;
}
);

3. Check to make sure that the patch name for "patches (****)" matches with the name for your cylinder surface. Check the magUInf, lRef, Aref, etc to match your case.

4. Run the application normally. Two new folders will appear in your case directory, one for forces and one for the coefficients. You should be able to find the drag coefficient from there.

Hope this helps,

John
cwang5 is offline   Reply With Quote

Old   October 24, 2008, 09:41
Default Hi John, I am so glad to he
  #47
Senior Member
 
ZHOU Bin
Join Date: Mar 2009
Location: Nanjing/Torino, Nanjing/Piemente, China/Italy
Posts: 164
Rep Power: 17
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Hi John,

I am so glad to hear from you, actually I have successfully implemented it this morning. Thank you anyway.

Now I have the "forces" and "forceCoeffs" directories.

I have tried to plot them, but failed, here if you do not mind, would you please tell me a way to plot them using gnuplot?

Really appreciate your help.

Bin
zhoubinwx is offline   Reply With Quote

Old   October 24, 2008, 11:04
Default Hi John, By the way, I am u
  #48
Senior Member
 
ZHOU Bin
Join Date: Mar 2009
Location: Nanjing/Torino, Nanjing/Piemente, China/Italy
Posts: 164
Rep Power: 17
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Hi John,

By the way, I am using the typical "Flow around a cylinder" case in ProgrammersGuide.pdf, chaper 3.1. Would you please let me know how to define these parameters.

I find when I use icoFoam, the courant number goes up to maximum, so I try simpleFoam, but with turbulence closed. only laminar.

According to me, I know that:

The drag and lift coefficients are:

Cd=Fd/(rho*U*U/2*Ad); Cl=Fl/(rho*U*U/2*Al);

Fd and Fl are calculated by integrating the pressure and shear force over the cylinder surface. I do not know how OpenFOAM 1.5 calculates them, especially the forces. It uses Richardson extrapolation? Second order?

Then with this question, I go to
~/OpenFOAM/zhou-1.5/zhou/IsolatedFiberCharacteristic0_04_simpleFoam/forceCoeffs/

We could see that:
forcesMoments fm = forces::calcForcesMoment();
scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_;

vector totForce = fm.first().first() + fm.first().second();
vector totMoment = fm.second().first() + fm.second().second();

scalar liftForce = totForce & liftDir_;
scalar dragForce = totForce & dragDir_;
scalar pitchMoment = totMoment & pitchAxis_;

scalar Cl = liftForce/(Aref_*pDyn);
//Aref: wettedArea
scalar Cd = dragForce/(Aref_*pDyn);
scalar Cm = pitchMoment/(Aref_*lRef_*pDyn);
--------------------
Here calcForcesMoment() Calculates the forces and moments by integrating the pressure and skin-friction forces over a given list of patches. However I do not ubderstand "first", "second" very well? Even though I opened the file "objectRegistryTemplates.C"

I could not fully understand CofR, liftDir,dragDir ,pitchAxis, magUInf,lRef,Aref in this cylinder case?

Definition of terms:
rhoInf - reference density ---it is ok

The following I do not know how I specify:

CofR - Centre of rotation/ Origin for moment calculations, is it means the center of the cylinder? here (0 0 0)? If we have many cylinders, we use their center respectively?
dragDir - Direction of drag coefficient
liftDir - Direction of lift coefficient
pitchAxis - Pitching moment axis
magUinf - free stream velocity magnitude, if we have many cylinders, we use the same value: the most upstream uniform velocity?
lRef - reference length
Aref - reference area

Thank you for your attention.

Best regards,

Bin
calim_cfd likes this.
zhoubinwx is offline   Reply With Quote

Old   October 24, 2008, 15:50
Default Hi Bin, The "forces" functi
  #49
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
Hi Bin,

The "forces" function calculated the pressure and viscous forces acting on the defined patch, and the "forceCoeff" is calculated from that. In the "forceCoeffs" function, the CofR is defined at (0 0 0) since I was not interested in finding out the moment around the body, but if you are you should define the center of rotation about the axis of interest, which I do not know for your case, but it should be the origin for a cylinder (I do not have the programming guide.pdf). The liftDir and dragDir define the vector that point in the direction of the lift and drag, which, for most cases, are (1 0 0) and (0 1 0) respectively, but it is completely up to how you setup your case. The pitchAxis is the axis for calculating pitching moment (I believe this thread was merged with an earlier one on the same topic, and there was an explanation for all the entries) if you are not interested in the value, just leave it as (0 0 0). Now, for magUinf, you should just use the upstream uniform velocity, since that should be the same as U_infinity, which is the freestream undisturbed velocity. "lower case L"Ref is the reference length, which is the chord length for an airfoil and the diameter for a cylinder, and Aref is the chord*span for an airfoil, and diameter*length for your cylinder I think.Hope that helps.

John
burak34 likes this.
cwang5 is offline   Reply With Quote

Old   October 25, 2008, 15:32
Default Hi, great to read your inputs
  #50
erik023
Guest
 
Posts: n/a
Hi,
great to read your inputs. I would like to use the forces in interdymfoam to get my boat i'm working on to move. i find that i have to def. a reference value for rho, does this mean that it does not work for the interdym/interfoam solvers?

thank you
erik
  Reply With Quote

Old   October 25, 2008, 16:17
Default again, using my brain a bit mo
  #51
erik023
Guest
 
Posts: n/a
again, using my brain a bit more. came to think if i would incorporate the forces already in the solver maybe it would not be terrible hard to first find out if the part of the patch is in water of air (possible?) and then set the gamma for this? then i could use the very nice forces based mesh-moving that i found here: http://www.cfd-online.com/cgi-bin/Op...how.cgi?1/3814

any suggestions?

erik
  Reply With Quote

Old   October 25, 2008, 17:06
Default Hey Eric, I have zero exper
  #52
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
Hey Eric,

I have zero experience with two-phase simulations, but you might find some useful information by looking in the programmer's guide and see how the rhoRef value is used in the calculation. I do have some input for your choice of solver, though. From what I can tell, the link you have for rigid body motion can only run on OF-1.4.1 dev version, while the forces function was not implemented until OF-1.5
. I think in OF-1.4.1 there's an utility called liftDrag. Again, I have only started using OF this August, and only have limited experience with OF-1.5.

By the way, how do you specify if a boundary (like a wall) is free moving?

John
cwang5 is offline   Reply With Quote

Old   October 25, 2008, 19:01
Default Hi John, I'm digging in to
  #53
erik023
Guest
 
Posts: n/a
Hi John,

I'm digging in to it and hope to get out a bit wiser, will get back as soon as i find something! I started using openFOAM for the first time now in September, have no experience of the older versions but there seem to be some major differences. Most of them brilliant, like snappyhexmesh!

i'm using the patch movingWallVelocity, should work if i understand it right.

thank you for your comments!

Erik
  Reply With Quote

Old   October 27, 2008, 07:28
Default Hey Eric, I was going thr
  #54
Member
 
John Wang
Join Date: Mar 2009
Location: Singapore
Posts: 73
Rep Power: 17
cwang5 is on a distinguished road
Hey Eric,

I was going through the tutorials and came across the 2D slushing tank in interDyMFoam, I saw a "wall pressure" function in there and thought it might be useful for you. Hope it helps.

John
cwang5 is offline   Reply With Quote

Old   October 28, 2008, 09:58
Default Hi Wang, I am glad to get y
  #55
Senior Member
 
ZHOU Bin
Join Date: Mar 2009
Location: Nanjing/Torino, Nanjing/Piemente, China/Italy
Posts: 164
Rep Power: 17
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Hi Wang,

I am glad to get your comment, I saw this post today, thank you very much.

Let me post any progress when I have for this cylinder ourflow.

Best regards,

Bin
zhoubinwx is offline   Reply With Quote

Old   November 1, 2008, 15:37
Default Hi,thanks for the discussion.
  #56
lin
Senior Member
 
Hua Zen
Join Date: Mar 2009
Posts: 138
Rep Power: 17
lin is on a distinguished road
Hi,thanks for the discussion.

Now I have one question about the drag and dragcoefficient.

As there is only one U reference could be defined for calculating the drag coefficient. I think that ,if I have a 3 D flow structures,when the velocity has a vertical structure,then this drag coefficient calculation is not correct,because the reference velocity at different layers is different.But the force should be right,then I could later use the force to calculate the drag coefficient, is it right?
lin is offline   Reply With Quote

Old   November 3, 2008, 09:03
Default good day all, i have been try
  #57
erik023
Guest
 
Posts: n/a
good day all,
i have been trying to combine some pieces of code in order to get my ship to heave and pitch given a flow. John Wang pointed to some interesting things and i have put something together, mainly from parts of the /postprocessing/forces and forceCoeffs and the turboForceFoam given here:
http://www.cfd-online.com/cgi-bin/Op...cus/discus.cgi

i could send the files to anyone who would like to have a look at them. it is not beautiful and i'm not even sure how well it is working, but my boat is moving so something is happening. i would be glad to get some help here!

also. for now there is only heaving, i would like to figure out some pithing as well. would i need the quaterion for that?!

thanks
Erik

erik dot ekedahl at gmail dot com
  Reply With Quote

Old   November 19, 2008, 07:25
Default Hallo everyone, one questio
  #58
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
Hallo everyone,

one question to the forces calculation:

Can it be performed as a real "post"processing action?

Means, I want to calculate my stuff and afterwards want to get to forces (lift and drag) of a certain patch.
When I type in "forces" or "forceCoeffs" then the "command is unknown". Do I have to compile somehow? I "Allwmake" the forces folder but no executable files were created. Can someone explain?

Thx
wolle1982 is offline   Reply With Quote

Old   November 19, 2008, 08:44
Default Hello Wolfgang, Try to read t
  #59
Senior Member
 
dmoroian's Avatar
 
Dragos
Join Date: Mar 2009
Posts: 648
Rep Power: 20
dmoroian is on a distinguished road
Hello Wolfgang,
Try to read this thread a bit more thoroughly, one example is: force object

I hope this is helpful,
Dragos
dmoroian is offline   Reply With Quote

Old   November 21, 2008, 11:53
Default ??? Hallo Dragos, no it did
  #60
Senior Member
 
Wolfgang Heydlauff
Join Date: Mar 2009
Location: Germany
Posts: 136
Rep Power: 21
wolle1982 will become famous soon enough
??? Hallo Dragos,

no it did not. I have a simulation calculated finish. without the forces function being in the controldict in the first place i cannot get the forces afterwards right??

what an unlike postprocessing too is this!
wolle1982 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
CoupledFvScalarMatrix in OF15 fisher OpenFOAM Running, Solving & CFD 9 May 27, 2020 10:40
Fan type BC in OF15 hsieh OpenFOAM Running, Solving & CFD 31 July 30, 2015 13:22
Bug in patchIntegrateC OF15 anger OpenFOAM Bugs 8 May 29, 2009 05:36
OpenFOAMdev migration to OF15 fisher OpenFOAM Installation 1 November 25, 2008 15:39
Bug or a feature of OF15 rafal OpenFOAM Bugs 5 July 25, 2008 06:25


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