CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (https://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Calculating Torque (https://www.cfd-online.com/Forums/openfoam-post-processing/119073-calculating-torque.html)

kingmaker June 9, 2013 09:34

Calculating Torque
 
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

wyldckat June 9, 2013 15:47

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

Boloar July 26, 2013 00:36

evaluating torque in VAWT simulation AMI region
 
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


wyldckat August 18, 2013 12:00

Hi Anand,

Quote:

Originally Posted by Boloar (Post 442059)
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 (Post 442059)
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

Boloar August 19, 2013 05:44

Excellent, successful compilation.

Quote:

Originally Posted by wyldckat (Post 446449)
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?

wyldckat August 19, 2013 12:41

Hi Anand,

Quote:

Originally Posted by Boloar (Post 446587)
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 (Post 446587)
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

Boloar August 20, 2013 00:50

Quote:

Originally Posted by wyldckat (Post 446720)
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 (Post 446720)
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.

wyldckat August 21, 2013 10:42

Quote:

Originally Posted by Boloar (Post 446789)
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

Boloar August 22, 2013 01:07

Quote:

Originally Posted by wyldckat (Post 447180)
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. :D


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