CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Calculating Torque

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 9, 2013, 10:34
Unhappy Calculating Torque
  #1
New Member
 
Aditya
Join Date: May 2013
Location: Munich Germany
Posts: 29
Rep Power: 13
kingmaker is on a distinguished road
Hello I am farely new to OpenFoam. I am using OpenFoam 2.1

I am trying to use MRFSimpleFoam and calculate torque on a rotating body. I found this (http://openfoamwiki.net/index.php/ComputeTorque) program which is for OpenFoam 1.4. But since I am using version 2.1 I cannot compile it. Also I am not quite sure how to use that utility. I want to have torque printed during the simulation in every say 10 time steps or so. Any suggestion will be of very helpful for me.

thanks in advance
kingmaker is offline   Reply With Quote

Old   June 9, 2013, 16:47
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings kingmaker,

I tested only with the second file:
Quote:
Originally Posted by http://openfoamwiki.net/index.php/ComputeTorque
A slightly modified version that computes the torque by reading an MRFZones file is available here: [[2]]
and apparently it is somewhat damaged.
The missing fix is to edit the file "Make/files" and use the following content instead:
Code:
computeTorque.C
MRFZoneDrg.C
MRFZonesDrg.C

EXE = $(FOAM_USER_APPBIN)/computeTorqueMRF
Then run the following command from within the "computeTorqueMRF" folder:
Code:
wmake
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   July 26, 2013, 01:36
Default evaluating torque in VAWT simulation AMI region
  #3
Member
 
Anand Lobo
Join Date: Jun 2013
Posts: 56
Rep Power: 13
Boloar is on a distinguished road
Hi Bruno,
Could you explain, roughly, how this utility works? My programming background is weak at best.
Are there any prerequisites required in the case files or setup for the tool to work?

UPDATE:

I tried to build it as you suggested above, for OpenFOAM 2.2.1. I got this error:

Code:
$ wmake
/opt/openfoam221/wmake/wmake: 222: /opt/openfoam221/wmake/wmake: make: not found
/opt/openfoam221/wmake/wmake: 223: /opt/openfoam221/wmake/wmake: make: not found
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created in /home/admin/Documents/computeTorqueMRF

Last edited by Boloar; July 26, 2013 at 05:26. Reason: update
Boloar is offline   Reply With Quote

Old   August 18, 2013, 13:00
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Anand,

Quote:
Originally Posted by Boloar View Post
Could you explain, roughly, how this utility works? My programming background is weak at best.
What exactly do you want to know? The math part or the programming part?

Quote:
Originally Posted by Boloar View Post
Are there any prerequisites required in the case files or setup for the tool to work?

UPDATE:

I tried to build it as you suggested above, for OpenFOAM 2.2.1. I got this error:

Code:
$ wmake
/opt/openfoam221/wmake/wmake: 222: /opt/openfoam221/wmake/wmake: make: not found
/opt/openfoam221/wmake/wmake: 223: /opt/openfoam221/wmake/wmake: make: not found
wmake error: file 'Make/linux64GccDPOpt/objectFiles' could not be created in /home/admin/Documents/computeTorqueMRF
You need to install make; gcc and g++ are also necessary. On Ubuntu, to install them, you can simply run:
Code:
sudo apt-get install build-essential
Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 19, 2013, 06:44
Default
  #5
Member
 
Anand Lobo
Join Date: Jun 2013
Posts: 56
Rep Power: 13
Boloar is on a distinguished road
Excellent, successful compilation.

Quote:
Originally Posted by wyldckat View Post
What exactly do you want to know? The math part or the programming part?
A bit on the programming. Although I wouldn't say no to a refresher on the math - aerodynamics isn't my main field of study.
There are no MRFZones files I can find in the tutorials for OpenFOAM 2.2.x, so I'm not entirely sure how to use it with my 2D AMI simulation. There's MRFProperties though - same idea?
Boloar is offline   Reply With Quote

Old   August 19, 2013, 13:41
Default
  #6
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Anand,

Quote:
Originally Posted by Boloar View Post
A bit on the programming. Although I wouldn't say no to a refresher on the math - aerodynamics isn't my main field of study.
I'm not much in the mood right now to spend 30 to 60 minutes writing down how this utility works. Nonetheless, here are some links I suggest you read, to learn some more on how to interpret C++ and OpenFOAM source code:


Quote:
Originally Posted by Boloar View Post
There are no MRFZones files I can find in the tutorials for OpenFOAM 2.2.x, so I'm not entirely sure how to use it with my 2D AMI simulation. There's MRFProperties though - same idea?
The AMI capability in OpenFOAM is meant be used with dynamic mesh motion.
As for using MRF, you don't need AMI, since it uses a stationary mesh; but you will need a cellZone for indicating which cells are assigned to the MRF zone.

The reference tutorials for each one are:
  • AMI: "incompressible/pimpleDyMFoam/propeller"
  • MRF: "multiphase/MRFInterFoam/mixerVessel2D"
If you study these two tutorials, you should be able to later find other similar tutorials.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   August 20, 2013, 01:50
Default
  #7
Member
 
Anand Lobo
Join Date: Jun 2013
Posts: 56
Rep Power: 13
Boloar is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
I'm not much in the mood right now to spend 30 to 60 minutes writing down how this utility works. Nonetheless, here are some links I suggest you read ...
Lol, no worries, I wouldn't ask for a blow-by-blow breakdown, just an overview. I'll take a look, although I find I learn more from other people's guidance rather than peering through reams of code.

Quote:
Originally Posted by wyldckat View Post
The AMI capability in OpenFOAM is meant be used with dynamic mesh motion.
As for using MRF, you don't need AMI, since it uses a stationary mesh; but you will need a cellZone for indicating which cells are assigned to the MRF zone.
I'm looking at the MRF tutorials already, and my rotating AMI simulation is up and running. It's how to combine the two that I'm trying to figure out, so I can figure out the torque in the rotating region.
Boloar is offline   Reply With Quote

Old   August 21, 2013, 11:42
Default
  #8
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Quote:
Originally Posted by Boloar View Post
I'm looking at the MRF tutorials already, and my rotating AMI simulation is up and running. It's how to combine the two that I'm trying to figure out, so I can figure out the torque in the rotating region.
Mmm... why not use the "forces" function object? It provides the vectorial forces and momentums for the desired patch list. I wrote some information on where you can find information about this on this post: http://www.cfd-online.com/Forums/ope...tml#post446397 post #6
__________________
wyldckat is offline   Reply With Quote

Old   August 22, 2013, 02:07
Default
  #9
Member
 
Anand Lobo
Join Date: Jun 2013
Posts: 56
Rep Power: 13
Boloar is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Mmm... why not use the "forces" function object? It provides the vectorial forces and momentums for the desired patch list.
... Good point, lol. Looks I have the forces enabled in my controlDict but I didn't see the output as it was hidden in a subfolder, and not directly readable by ParaView. Looks like I'll have to manually convert those outputs to CSV.

Edit: well, I think I've got it figured out. Found out the section of code dealing with the file output and modified that to look closer to CSV format.

Last edited by Boloar; August 22, 2013 at 04:11.
Boloar is offline   Reply With Quote

Reply

Tags
mrfsimplefoam, openfoam 2.1, torque


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
Calculating Torque tripa58 CFX 1 October 28, 2010 19:10
Calculating torque beejois FLUENT 2 March 12, 2010 02:22
calculating torque shawn123 STAR-CCM+ 3 January 23, 2010 22:32
Calculating torque Andrew FLUENT 5 September 4, 2007 12:10
How to update polyPatchbs localPoints liu OpenFOAM Running, Solving & CFD 6 December 30, 2005 18:27


All times are GMT -4. The time now is 15:41.