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

Drag computation in 141

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 11, 2008, 11:25
Default Hello, I just comleted inst
  #1
Member
 
Martin Aunskjaer
Join Date: Mar 2009
Location: Denmark
Posts: 53
Rep Power: 17
aunola is on a distinguished road
Hello,

I just comleted installation of 1.4.1, my first encounter with OpenFOAM. Playing with the tutorials I noticed that none of the solvers include force calculations. That being my primary interest I searched the forum for hints on what to do about that. There seems to be no shortage of threads concerning lift and drag, hopefully another one will be tolerated.

I found these nice threads:

http://www.cfd-online.com/OpenFOAM_D...es/1/5181.html
http://www.cfd-online.com/OpenFOAM_D...es/1/2299.html
http://www.cfd-online.com/OpenFOAM_D...es/1/1604.html

which deal with importing a lift/drag feature from version 1.2 into 1.3 as well as some bug fixes to the imported code.

The first problem I run into is with the porting instructions in the "2299" thread (post by pUI|). It tells me to grab a Gcc file from the version 1.2 distribution. Since I'm running on 32-bit machines I believe this file should be

OpenFOAM-1.2.linuxGcc4Opt.gtgz

rather than the one mentioned in the instructions. I cannot find this file anywhere. Not on OpenFOAM's download site, not via google. What then ?

My next problem is that the threads mentioned above mention a file called computeForces.H/.C. I suspect this is a file that lives in obscurity somewhere. I cannot find it in version 1.4.1 nor 1.2. Hints ?

Ideally, I would like a setup where I can just make calls from the various (single phase) solvers to a genereal functions that does the force calculations and dumps results to a file.
aunola is offline   Reply With Quote

Old   July 11, 2008, 14:36
Default The first problem I run into i
  #2
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
The first problem I run into is with the porting instructions in the "2299" thread (post by pUI|). It tells me to grab a Gcc file from the version 1.2 distribution. Since I'm running on 32-bit machines I believe this file should be

OpenFOAM-1.2.linuxGcc4Opt.gtgz

I thought I did mention in the original post that those instructions were specific to AMD64. However, if it's just source files you need to extract, then I doubt it will matter which architecture tarball you take it from. In fact, now that I think about it that tarball is unnecessary. All it provides is a liftDrag binary which you will build anyway.



My next problem is that the threads mentioned above mention a file called computeForces.H/.C. I suspect this is a file that lives in obscurity somewhere. I cannot find it in version 1.4.1 nor 1.2. Hints ?

computeForces.H was a quickly-put-together source that was written by Frank Bos. It can be found in the turbFoam_1 tarball attached in this[1] post.



Ideally, I would like a setup where I can just make calls from the various (single phase) solvers to a genereal functions that does the force calculations and dumps results to a file.

turbFoam_1 does something very similar. If you follow the same procedure/setup as turbFoam_1 I'm sure you'll get lift and drag forces working. If you still face problems, let me know. I am willing to get you started by making all the modifications you need. Just let me know which solver you intend to use (e.g. icoFoam, turbFoam etc.)


References:

[1] http://www.cfd-online.com/OpenFOAM_D...es/1/5181.html


PS: Indeed, it is very refreshing to find someone who actually bothers to search the forum properly before posting a new thread :-)
msrinath80 is offline   Reply With Quote

Old   July 11, 2008, 16:14
Default Good afternoon, liftDrag ut
  #3
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17
podallaire is on a distinguished road
Good afternoon,

liftDrag utility and lib can be downloaded from the 1.4.1-dev version, take a look at :

http://openfoam-extend.svn.sourceforge.net/viewvc/openfoam-extend/trunk/Core/Ope nFOAM-1.4.1-dev/applications/utilities/postProcessing/wall/liftDrag/

http://openfoam-extend.svn.sourceforge.net/viewvc/openfoam-extend/trunk/Core/Ope nFOAM-1.4.1-dev/src/postProcessing/incompressible/

The forceAndTorque function can be called from the controlDict (thanks to Hrv and Patrick for helping me this week) and will dump the results in the run logfile. foamLog can be used to generate standard x-y files.


It compiles on 1.4.1 without any problem.

Hope this helps,

PO
podallaire is offline   Reply With Quote

Old   July 12, 2008, 10:44
Default Thanks a lot to both of you. T
  #4
Member
 
Martin Aunskjaer
Join Date: Mar 2009
Location: Denmark
Posts: 53
Rep Power: 17
aunola is on a distinguished road
Thanks a lot to both of you. These answers are very helpful indeed.

I ran into a problem in step 7 of the migration of liftDrag to 1.4.1 in that the library libfoamUtil.so was missing. Several other users reported the same problem in the "2299"-thread. Fixed it by rebuilding the entire 1.2 from sources and copying the foamUtil directory to 1.4.1.

I now have turbFoam_1 running and it dumps Cd and Cl to the screen. I need to familiarize myself with OpenFOAM to figure out how to get it dumped into a file. Also I want to have drag calculations in some of the other solvers suitable for my needs (icoFoam, simpleFoam, rhoTurbFoam, coodles and oodles). Presumably I can figure that out by looking into turbFoam_1.

Again, thanks a lot guys. Hopefully, I can get more help here as I go along.
aunola is offline   Reply With Quote

Old   August 17, 2008, 01:23
Default Hi Pierre-Olivier how can i
  #5
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi Pierre-Olivier
how can i called forceAndTorque function from the controlDict??can i give me a example?

thanks

yours wayne
waynezw0618 is offline   Reply With Quote

Old   September 2, 2008, 17:18
Default Sorry for the late answer -> I
  #6
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17
podallaire is on a distinguished road
Sorry for the late answer -> I was on vacation

Here is what I have :

functions
(
forces
{
type turbulentForceAndTorque;
functionObjectLibs ("libincompressiblePostProcessing.so");
patches (Bridge); //Name of patche to integrate forces
origin (1 0 0); //Origin for moment calculations
}
);


Pierre-Olivier
podallaire is offline   Reply With Quote

Old   September 3, 2008, 10:48
Default Hi thanks a lot ! i will tr
  #7
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi

thanks a lot ! i will try it later.would you mind to tell you how to moniter the total pressure different between inlet and outle with moniter of torque during the iteration like moniter torque?

thanks

yours wayne
waynezw0618 is offline   Reply With Quote

Old   September 5, 2008, 10:53
Default hi I am try to install OF 1.
  #8
New Member
 
Vijayaratnam Piradeepan
Join Date: Mar 2009
Posts: 6
Rep Power: 17
piradeepan is on a distinguished road
hi
I am try to install OF 1.4.1
Please let me know about the error

/bin/sh: flex++: command not found
mv: cannot stat `lex.yy.cc': No such file or directory
g++: Make/linuxGccDPOpt/readSTLASCII.C: No such file or directory
g++: no input files
make: *** [Make/linuxGccDPOpt/readSTLASCII.o] Error 1
piradeepan is offline   Reply With Quote

Old   September 5, 2008, 15:13
Default You need to install flex++. Pl
  #9
Senior Member
 
Srinath Madhavan (a.k.a pUl|)
Join Date: Mar 2009
Location: Edmonton, AB, Canada
Posts: 703
Rep Power: 21
msrinath80 is on a distinguished road
You need to install flex++. Please use the search facility before posting any new questions. This problem has been discussed so many times in the past.
msrinath80 is offline   Reply With Quote

Old   September 24, 2008, 06:36
Default Hi Pierre-Olivier i am sorr
  #10
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi Pierre-Olivier

i am sorry for the cluster i use have something wrong this dats so i did not try.
i try it today and with the error that :
key word file is undefined

what is wrong with it ?
thanks

yours wayne
waynezw0618 is offline   Reply With Quote

Old   September 28, 2008, 10:40
Default What version of OF are you usi
  #11
Member
 
Martin Aunskjaer
Join Date: Mar 2009
Location: Denmark
Posts: 53
Rep Power: 17
aunola is on a distinguished road
What version of OF are you using? The library and keywords you use are unkown in 1.5.

In version 1-5 add the following to your controlDict to get forces

functions
(
forces
{
type forces;
functionObjectLibs("libforces.so");
patches (list of your wall patche id's);
rhoInf <rho_freestream>; - only for incompressible calcs.
CofR (x y z); - centre of rotation for moment calc.
}
);

Alternatively you may use the forceCoeffs function object which calculates Cd, Cl and Cm directly.

You may also want to read the thread:

http://www.cfd-online.com/OpenFOAM_D...es/1/8402.html
aunola is offline   Reply With Quote

Old   October 4, 2008, 11:23
Default Hi Martin and Pierre-Olivier
  #12
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi Martin and Pierre-Olivier
I am using OF-1.4.1. and i have download both two application and complie correctly. my controlDict is as :
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application MRFsimpleFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 2000;

deltaT 1;

writeControl timeStep;

writeInterval 2000;

purgeWrite 0;

writeFormat ascii;

writePrecision 6;

writeCompression uncompressed;

timeFormat general;

timePrecision 6;

graphFormat raw;

runTimeModifiable yes;

functions
(
forces
{
type turbulentForceAndTorque;
functionObjectLibs ("libincompressiblePostProcessing.so");
patches (BLADE); //Name of patche to integrate forces
origin (0 0 0); //Origin for moment calculations
}
);


// ************************************************** *********************** //
and error message as follow:


Starting time loop



--> FOAM FATAL IO ERROR : keyword file is undefined in dictionary "ASME//GS4SSTRC025Q/system/controlDict::functions"

file: ASME//GS4SSTRC025Q/system/controlDict::functions from line 63 to line 66.

From function dictionary::lookupEntry(const word& keyword) const
in file db/dictionary/dictionary.C at line 146.


would you mind tell me what`s wrong with it?

thanks

your wayne
waynezw0618 is offline   Reply With Quote

Old   October 4, 2008, 11:37
Default Wayne, can you post your co
  #13
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17
podallaire is on a distinguished road
Wayne,

can you post your controlDict file here ? I believe a "(" or "{" is missing somewhere ...

Regards,

Pierre-Olivier
podallaire is offline   Reply With Quote

Old   October 4, 2008, 11:46
Default sorry, I did not see that in f
  #14
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17
podallaire is on a distinguished road
sorry, I did not see that in fact you already copied everything from your controlDict in your post ...

Are you sure that the libincompressiblePostProcessing can be inked ? You can try to copy it directly in $FOAM_LIBBIN.

As Martin said, it would be a good idea to try OF 1.5.x where the lift/drag/moment are availabe in the official distribution.

Regards,

PO
podallaire is offline   Reply With Quote

Old   October 4, 2008, 13:49
Default Hi here is my controlDict.
  #15
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi
here is my controlDict.
controlDict

and libincompressiblePostProcessing.so is in $FOAM_LIBBIN.

would you mind to help me to resolve the problem in OF-1.4.1

yours wayne
waynezw0618 is offline   Reply With Quote

Old   October 4, 2008, 14:47
Default by the way. i do not use 1.5
  #16
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
by the way.
i do not use 1.5 for the cluster in ourschool is installed Redhat AS4 .i have never suceed in installing 1.5 there.

thanks

yours wayne
waynezw0618 is offline   Reply With Quote

Old   November 5, 2008, 04:08
Default Hi Pierre-Olivier thanks fo
  #17
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi Pierre-Olivier

thanks for your help. and the problem has been resolved.the keyword file must be added
functions
(
forces
{
type turbulentForceAndTorque;
functionObjectLibs ("libincompressiblePostProcessing.so");
patches (BLADE); //Name of patche to integrate forces
origin (0 0 0); //Origin for moment calculations
file ;//(i dont know what is the option) could you tell me more?
}
);
waynezw0618 is offline   Reply With Quote

Old   November 5, 2008, 11:27
Default Hi Pierre-Olivier : anyway,
  #18
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
Hi Pierre-Olivier :

anyway,according to your another topic(http://www.cfd-online.com/cgi-bin/Op...how.cgi?1/8402).you have a "force.dat" file ?dose this file generated when the option file is given? and how to give the file opition?

thanks

yours wayne?
waynezw0618 is offline   Reply With Quote

Old   November 5, 2008, 12:34
Default Hi Wayne, I did not use the
  #19
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17
podallaire is on a distinguished road
Hi Wayne,

I did not use the "file" option in my controlDict, my functions section was like this :

functions
(
forces
{
type turbulentForceAndTorque;
functionObjectLibs ("libincompressiblePostProcessing.so");
patches (Bridge); //Name of patche to integrate forces
origin (1 0 0); //Origin for moment calculations
}
);

Force.dat is automatically generated when the function "forces" is added in the controlDict. Not sure what is wrong with your setup ?

Regarding Redhat AS4 and OF1-5, you might need to upgrage the gcc compiler to 4.x if you want to compile it

PO
podallaire is offline   Reply With Quote

Old   November 6, 2008, 09:20
Default HI PO I am still using 1.4.1
  #20
Senior Member
 
wayne.zhang
Join Date: Mar 2009
Location: Shanghai, Shanghai, P.R.China
Posts: 309
Rep Power: 18
waynezw0618 is on a distinguished road
Send a message via MSN to waynezw0618 Send a message via Skype™ to waynezw0618
HI PO
I am still using 1.4.1 on Redhat AS4 now. for i can`t install the 1.5 correctly on the school`s cluster.so i still use the liftdrag and forceandtorque tool of 1.4.1-dev.and i download if from link you give above.and make no modificaiton.also could build and compile correctly.

if i do not add keyword file in the controlDict
there will be error message :

<font color="ff0000">--> FOAM FATAL IO ERROR : keyword file is undefined in dictionary "ASME//GS4SSTRC025Q/system/controlDict::functions"

also i turn to the turbulentForceAndTorqueFunctionObject.C and find the constructors

red{
Foam::turbulentForceAndTorqueFunctionObject::
turbulentForceAndTorqueFunctionObject
(
const Time& t,
const dictionary& dict
)
:
functionObject(),
time_(t),
regionName_(polyMesh::defaultRegion),
patchNames_(dict.lookup("patches")),
origin_(dict.lookup("origin")),
of_(time_.path()/word(dict.lookup("file")))
</font>

and it need "file".

so i don`t know what is wrong with it?

thanks

yours wayne
waynezw0618 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
Pressure drag, friction drag and total drag? Cheng CFX 9 January 26, 2024 14:46
drag coefficient computation on a porous jump??? Fabrice FLUENT 4 June 5, 2017 06:30
drag computation on LS-DYNA Francis Main CFD Forum 0 February 2, 2009 05:11
Drag force computation Martin Main CFD Forum 9 July 11, 2008 10:10
Computation of Lift and Drag Ramanath KS Siemens 1 December 27, 2000 04:25


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