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   July 20, 2008, 23:51
Default Hi all, I'm confused - the
  #1
New Member
 
Richard Jones
Join Date: Mar 2009
Location: Adelaide, South Australia, Australia
Posts: 22
Rep Power: 17
richard is on a distinguished road
Hi all,

I'm confused - the 1.5 release notes mention forces and forceCoeffs utilities, but they're not recognized as commands and I can't find anything in the users or programmers guides..?

Cheers,
Richard
richard is offline   Reply With Quote

Old   July 21, 2008, 04:15
Default I've tried added the following
  #2
New Member
 
Richard Jones
Join Date: Mar 2009
Location: Adelaide, South Australia, Australia
Posts: 22
Rep Power: 17
richard is on a distinguished road
I've tried added the following to my controlDict file (I haven't used functionObjects much before so I just changed the oodles example to suit - it could be wrong)...

functionObjects
(
forces
{
type forces;
functionObjectLibs ("libforces.so");
patches (airfoil);
factor 1.0;
}
)

but nothing new happens.

Also tried execFlowFunctionObjects after running the case and it spat out garbage about the memory map??

Is there any info on how to use forces and forceCoeffs..?
richard is offline   Reply With Quote

Old   July 21, 2008, 08:33
Default Good morning, I was able to
  #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 morning,

I was able to use the force object using this in my controlDict :

forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load -> dylib on Mac and so on Linux
patches (Bridge); //Name of patche to integrate forces
rhoInf 1.0; //Reference density for fluid - can be changed later ...
CofR (2.1267 0 0); //Origin for moment calculations
}

A "forces" directory is created and results for each time step are written in a .dat file.

I compared the results with the tool available in 1.4.1-dev and everything looks good. The only thing is that I don't know (without modifications in the source code) is how to extract each force component with foamLog or the new tool foamCalc in order to make 2d plots?

Any idea ?

Regards,

PO
podallaire is offline   Reply With Quote

Old   July 21, 2008, 09:17
Default Hi Pierre So you say that i
  #4
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi Pierre

So you say that in each and every time directory a file called 'forces.dat' is placed?

Could you please post one such forces.dat file, and I might be able to help you on making something which you can put into foamLog (still using 1.4.1, thus cannot access the functionObject).

Best regards,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   July 21, 2008, 10:01
Default Hi PO Okay, just a little b
  #5
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi PO

Okay, just a little bit of clarification.

1: So assume you have two patches (ora ny finite number), you would like to have the force/moment data written to two different (or any finite number of) files? (Please, because that would make everything significantly easier.)

2: You would like the files to be placed where?

3: I have made some small preliminary stuff, but will not make it more generic before we have agreed on some overall features. The preliminary output looks like:

#Time FpX FpY FpZ FvX FvY FvZ MpX MpY MpZ MvX MvY MvZ
1 41.9563 38.5186 1.23717e-06 -0.126958 -0.0442683 -0.00278829 -0.13884 0.0776653 -2.13127 -0.000449653 0.00121981 -0.000584387
2 41.9562 38.5193 1.23748e-06 -0.126959 -0.044268 -0.00278827 -0.139218 0.07758 -2.13122 -0.000449613 0.00122021 -0.000584434
3 41.9559 38.5201 1.23745e-06 -0.126961 -0.0442673 -0.00278824 -0.139608 0.0775009 -2.13116 -0.00044978 0.00122059 -0.000584453
4 41.9555 38.5209 1.23734e-06 -0.126962 -0.0442663 -0.00278812 -0.14007 0.0774062 -2.1311 -0.000450026 0.0012211 -0.000584461
5 41.9551 38.5221 1.23731e-06 -0.126964 -0.0442651 -0.00278792 -0.140901 0.0773055 -2.13104 -0.000450371 0.0012217 -0.000584472
6 41.955 38.5237 1.23846e-06 -0.126964 -0.044264 -0.0027877 -0.142047 0.0771426 -2.13097 -0.000450925 0.0012224 -0.000584534
7 41.955 38.5248 1.23847e-06 -0.126965 -0.0442625 -0.00278749 -0.142744 0.0771074 -2.13094 -0.000451635 0.00122299 -0.000584546

Which is simply done using the command:

echo "#Time FpX FpY FpZ FvX FvY FvZ MpX MpY MpZ MvX MvY MvZ" > forceData;awk '/[0-9]/ {print}' <testforces>> forceData

Where the data you delivered is placed in testForces.

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   July 21, 2008, 10:10
Default Hi Niels, 1) Yes, different
  #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
Hi Niels,

1) Yes, different files are fine

2) I would say in "logs" directory if possible (created by foamLog)

3) That is exactly what I need - I will try. Is there a way to introduce this command in foamLog.db ? If not, I will just copy it in my run script.

Thanks !

PO
podallaire is offline   Reply With Quote

Old   July 21, 2008, 10:18
Default Hi PO I can see that the po
  #7
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi PO

I can see that the poster has truncated my post or at least removed some of the internal part of the command.

I'll try to wrap thing up and put it in foamLog, but so far, please use the following attached file:

extractForces

/Niels

/ Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   July 21, 2008, 10:23
Default Niels, thanks a lot, really
  #8
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17
podallaire is on a distinguished road
Niels,

thanks a lot, really appreciated !

PO
podallaire is offline   Reply With Quote

Old   July 21, 2008, 12:01
Default Hi PO No problem, I like a
  #9
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi PO

No problem, I like a small shell-scripting brush-up from time to time

I have made this small script, which I believe should work as 'ordered' if you add it to the very bottom of the foamLog script. I have commented it quite extensively, hope that can enlighten you.

addToFoamLog

There is a small detail, namely in line 2. My experience from Fedora and Mac tells me that 'find' works a little bit different with respect to the -maxdepth command, thus if you run into problems with that just 'man find'. I am on a Fedora machine right now, thus cannot verify my suspicion.

Have fun,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   July 21, 2008, 12:44
Default Nice, thanks again ! I will
  #10
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17
podallaire is on a distinguished road
Nice, thanks again !

I will verify the maxdepth command but it should be fine.

Best regards,

PO
podallaire is offline   Reply With Quote

Old   July 21, 2008, 19:51
Default Thanks for you help fellas! Fo
  #11
New Member
 
Richard Jones
Join Date: Mar 2009
Location: Adelaide, South Australia, Australia
Posts: 22
Rep Power: 17
richard is on a distinguished road
Thanks for you help fellas! For others trying to get it to work, put Pierre's forces object (post 3) in

functions
(
//pierre's code
);

at the end of the controlDict file.
richard is offline   Reply With Quote

Old   July 21, 2008, 20:08
Default Also, if you're adding Neils c
  #12
New Member
 
Richard Jones
Join Date: Mar 2009
Location: Adelaide, South Australia, Australia
Posts: 22
Rep Power: 17
richard is on a distinguished road
Also, if you're adding Neils code (cheers Neils, top work!) to foamLog change the $ROOT/$CASE to $CASEDIR since the . . has been left out of the arguments in 1.5
richard is offline   Reply With Quote

Old   July 21, 2008, 20:47
Default Hi ! Yes,$ROOT and $CASE ar
  #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
Hi !

Yes,$ROOT and $CASE are not used in 1.5 but I don't think that $CASEDIR is an argument with FoamLog - I "tweaked" Neils's code
to use the current directory instead.

Thanks !

PO
podallaire is offline   Reply With Quote

Old   July 21, 2008, 23:53
Default As far as I can tell this is w
  #14
New Member
 
Richard Jones
Join Date: Mar 2009
Location: Adelaide, South Australia, Australia
Posts: 22
Rep Power: 17
richard is on a distinguished road
As far as I can tell this is what you need for the forceCoeffs version... the variables are reasonably self explanatory

forceCoeffs
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
patches (airfoil);
rhoInf 1.0;
CofR (0.25 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0.25 0 0);
magUInf 10.0;
lRef 1.0;
Aref 1.0;
}

foamLog can be modified as above, changing the forces reference to forceCoeffs where appropriate.
richard is offline   Reply With Quote

Old   July 22, 2008, 04:19
Default Hi Well, here you go. Can s
  #15
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi

Well, here you go. Can someone please make foamLog v. OF1.5 available to me.

Thanks,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   July 22, 2008, 07:17
Default How do we attach files ???
  #16
Senior Member
 
Pierre-Olivier Dallaire
Join Date: Mar 2009
Location: Montreal, Quebec, Canada
Posts: 192
Rep Power: 17
podallaire is on a distinguished road
How do we attach files ???

Thanks

PO
podallaire is offline   Reply With Quote

Old   July 22, 2008, 07:29
Default Hi Niels Please excuse me f
  #17
Senior Member
 
Join Date: Mar 2009
Posts: 248
Rep Power: 18
jaswi is on a distinguished road
Hi Niels

Please excuse me for interrupting the thread but I tried to send you an email and it returned me an negative Delivery Status Notification.

Could you please mail me your email address.
I have some doubts and need you help

Thanks alot
Jaswi
jaswi is offline   Reply With Quote

Old   July 22, 2008, 07:47
Default Hi PO Look in the Documenta
  #18
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hi PO

Look in the Documentation->Formatting section to the left.

- Niels

BTW. Richard have mailed it to me directly.
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj is offline   Reply With Quote

Old   July 22, 2008, 08:02
Default Here it is ... http://www
  #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
Here it is ...

addToFoamLogV2.txt

It assumes that foamLog is executed from the case directory where the folder "forces" can be found and where the output folder "logs" will be created.

Thanks

PO
podallaire is offline   Reply With Quote

Old   July 22, 2008, 17:42
Default Thank you guys for all the pos
  #20
sjs
New Member
 
Sylvia Smullin
Join Date: Mar 2009
Posts: 10
Rep Power: 17
sjs is on a distinguished road
Thank you guys for all the posts --- I was just trying to sort through this on my own. unfortunately, copying the code for the controlDict doesn't seem to work for me (I used snappyHexMesh and then ran icoFoam). I don't see any forces directory. Where is this directory supposed to be created?

Also, what are the units of the output? Are they Newtons for force and N*m for moment and dimensionless for the output of force coeff? (just want to make sure it isn't somehow N/m^2)

Thank you.
Sylvia
sjs 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 09:40
Fan type BC in OF15 hsieh OpenFOAM Running, Solving & CFD 31 July 30, 2015 12:22
Bug in patchIntegrateC OF15 anger OpenFOAM Bugs 8 May 29, 2009 04:36
OpenFOAMdev migration to OF15 fisher OpenFOAM Installation 1 November 25, 2008 14:39
Bug or a feature of OF15 rafal OpenFOAM Bugs 5 July 25, 2008 05:25


All times are GMT -4. The time now is 01:27.