CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Monitoring Torque on rotating body in MRFSimpleFoam (https://www.cfd-online.com/Forums/openfoam-solving/58291-monitoring-torque-rotating-body-mrfsimplefoam.html)

mahendra November 15, 2008 06:53

Monitoring Torque on rotating body in MRFSimpleFoam
 
Dear Foamers Hi !

Hope you all are doing very well.

It has been a very good experience with OpenFOAM till date and I am enjoying it a lot.
Thanks for the support and courtesy that you guys are extending to beginners like me.
This only drive us to learn more and more about OpenFOAM.

Right now I am looking into the MRFSimpleFoam cases and I was wondering how to set a monitor point that monitors the torque on the rotating body.
So when I see that the torque has become flat I can stop my simulation and it will add to my confidence about the results.

Hope to hear from you http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

Thanks and Regards,
Mahendra

paul_mathis November 17, 2008 11:45

Hi Mahendra, I found a tool
 
Hi Mahendra,

I found a tool to calculate torque on the board and modified it a little bit to match my requirements. It now calculates the torque based on pressure and wall shear stress on patches wich are entered in a dict file. I can send you a copy of it to your email address.

PM

mahendra November 17, 2008 23:33

Dear Pual, Thanks for the r
 
Dear Pual,

Thanks for the reply and Are you talking of computeTorqueMRF?

Can I use it in the form of probes?

You can reach me at mahendra.wankhede@gmail.com

Regards,
Mahendra.

mahendra November 18, 2008 23:13

Dear Paul, Thanks for the u
 
Dear Paul,

Thanks for the utility now I can calculate the torque on the required patch.

Still I was wondering if I can use the torque as a monitor point on a patch and how to do it. I beg your pardon as my know-how of C++ is very limited.

functions
(
Probes
{
// Type of functionObject
type probes;

// Where to load it from (if not already in solver)
functionObjectLibs ("libsampling.so");

// Locations to be probed. runTime modifiable!
probeLocations
(
(0 0 0.25)
);

// Fields to be probed. runTime modifiable!
fields
(
p
U
Torque // Like this
);
}
);

Regards,
Mahendra

mahendra November 18, 2008 23:56

Dear Paul, I am a little co
 
Dear Paul,

I am a little confused with this two utilities.

1.computeTorqueMRF
2.calculateTorque

When I execute the two on my case, it gives me different results.

So now I am confused with which utility should I use to compute the torque.

Regards,
Mahendra.

paul_mathis November 19, 2008 03:15

Hi Mahendra, have a look in
 
Hi Mahendra,

have a look into the code - maybe computeTorqueMRF calculates torque just based on pressure forces and does not take into account the viscous forces (calculated by wallShearStress), whereas the utility I sent you does.

Regards,
Paul

mahendra November 19, 2008 03:31

Hi Paul, As you have said,
 
Hi Paul,

As you have said, I checked the computeTorqueMRF.C and found that it computes the pressure torque on a given surface.

So I think the utility you sent to me is the one I need.

Still my earlier question remains...about monitoring torque (Like Probes for Pressure or velocity)

Regards,
Mahendra

jason November 19, 2008 14:11

Hi Paul, Any chance I could
 
Hi Paul,

Any chance I could also get a copy of your utility? Would really appreciate it.

jason.dale (at) tesco.net

Many Thanks

Jason

jaswi November 19, 2008 16:50

Hi Paul I request you to pl
 
Hi Paul

I request you to please post the utility on the this thread for all of us to use

Kind Regards
Jaswi

paul_mathis November 20, 2008 03:59

Dear foamers, here are my u
 
Dear foamers,

here are my utilities to calculate torque for incomressible (calculateTroque) and comressible flows (calculateTroqueCompressible).

Torque is computed based on pressure and viscous forces on patches specified in the calculateTorqueDict file which has to be located in the system directory.

Enjoy,
Paul

http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif \Client\C$\Documents and Settings\c563640\Desktop\calculateTorque.tar.gz
http://www.cfd-online.com/OpenFOAM_D...hment_icon.gif \Client\C$\Documents and Settings\c563640\Desktop\calculateTorqueCompressib le.tar.gz

paul_mathis November 20, 2008 04:03

Something seems to go wrong wi
 
Something seems to go wrong with the path...
What is my mistake while uploading?

mattijs November 21, 2008 03:49

If they are general perhaps th
 
If they are general perhaps they can go onto http://openfoamwiki.net?

mahendra November 21, 2008 04:59

Dear Paul, I ran a simple M
 
Dear Paul,

I ran a simple MRF case and compared the results with Fluent. The velocity vectors seems ok and matches fairly with Fluent.

But when I see the torque it does not match with Fluent. I checked each and every thing thoroughly, but could not dig into why the torque is not matching?

Paul, what could be the possible cause?

Regards,
Mahendra

mahendra November 21, 2008 05:03

I did multiply the torque form
 
I did multiply the torque form OpenFOAM with density. Even then it is not matching?

paul_mathis November 25, 2008 09:02

Hello, a useful tool for mo
 
Hello,

a useful tool for monitoring forces/torque during calculation process is found here:

http://www.cfd-online.com/cgi-bin/Op...4787#POST24787

Regards, Paul

cfdjeya July 22, 2011 00:12

Monitor torque in each time step in MRFSimpleFOAM
 
Hi,
This is Jeya, doing Vertical Axis Wind Turbine Simulations. I already simulated this in Ansys Fluent. In Fluent, we can monitor torque. From this I able to find Cp of Vertical Axis Wind Turbine.
Now I tried to do the same simulation in OpenFOAM. I manage to do other settings and I able to run my simulation in OpenFOAM. In the following thread (http://www.cfd-online.com/Forums/ope...implefoam.html) I found a file "calculateToque". By using this I able to calculate torque at a particular times (i.e.: calculateTorque -time 10) But I am interested to plot torque versus time graph. Therefore I need to monitor torque in each timestep. Please help me. I am stuck on this for long time. My programming skills also very poor. Your helps are very much appreciated.
Thank you so much

Sincerely,
Jeya

ChristianE46 July 25, 2011 12:28

Hi Yeya!

I'm using OF 1.6 ext and I Coudn't compile it with wmake.
What did you do to compile it?

Regards Christian

cfdjeya July 25, 2011 12:44

I figure it out my torque problems in openfoam. Thank you very much
 
Hello Christian,
I am using Openfoam from my university cluster. It is already installed. I tried in my home computer(Linux fedora). I couldn't install it. Then I give up to install in my home computer. I deal with more than a million elements therefore I need the help of cluster.
You could find some other threads where you may find some answers
Thanks.

desert_1250 July 26, 2011 01:43

calculate torque
 
hi, i hope that all are well :)
i wanna calculate torque in the VAWT,i modeled it successfully but when i use computeTorque, the result is wrong!!!
some questions a bout the code are :
1-what's the meaning of "r0" in the code, what is the unit?
2-is it just needed to compile calculateTorque utility and run it ?
3-in my case, the radius is 0.75, density is 1.205kg/m^3 and the name of 3Blades is "rotor", how to understand these to the code??!
4-is it needed a file added in the system directory or add code to the controlDict??!

tanx
_______
Rasoul

linnemann July 26, 2011 01:56

Just a question.

Why dont you just use the forces library already present in OF?

put this in the end of the controlDict.

Code:

functions
(
    forces
    {
        type forces;
        functionObjectLibs ("libforces.so");
        outputControl timeStep;
        outputInterval 1;
        patches (wallBlade);
//        pname p;
//        Uname U;
        rhoName rhoInf;
        log true;
        rhoInf 1.205;
        CofR (0 0 0);
    }
);

This will output the forces/torque in x,y,z direction.

The output to the terminal will look like this.

Code:

    forces(pressure, viscous)((2162.2 -313.192 35.8823) (12.5865 3.1166 3.97532))
    moment(pressure, viscous)((1162.4 6862.37 100.944) (-12.5067 35.4299 -50.9462))

Then you can always make your own script to add the pressure torque with the viscous torque or just calculate them by hand.

desert_1250 July 26, 2011 02:17

tnx Linnemann, your suggestion is the best :) you are right

ebah6 February 21, 2012 15:15

Hello Niels,

I am trying to use this forces function to extract moment. But the output is all the time zero. would you have an idea of what I am doing wrong?
Here is a sample output:
-----------------------
forces output:
forces(pressure, viscous)((0 0 0) (0 0 0))
moment(pressure, viscous)((0 0 0) (0 0 0))
--------------------
Basically what I am trying to do is to get the moment and calculate the rpm such that the next iteration has this rpm.

Thank you for your time.

Best regards.

ebah6 February 21, 2012 16:35

Hello Niels and anyone reading this post and the previous one,

Please, disregard the fact about the outputs being all zeros.
I made a stupid mistake by not mis-spelling on of my patches.

Yet if one has a lead on the second part, any suggestion is welcome.

My best regards.

ebah6 March 1, 2012 16:52

Dear all,

Is there a way to choose the output format.
For instance, in file forces/0/forces.dat, every thing is output in one line for each time step.
How should proceed to have this output in column.
e.g.,
Fpx = ....
Fpy = ....
Fpz = ....
etc.

I want to do this because I need to read some of the components and do some calculations the result od which I feed to the next iteration.

Thank you all for your time.

protarius March 7, 2012 12:48

Hi

There is a Python script in this thread:

http://www.cfd-online.com/Forums/ope...-brackets.html

Regards

ebah6 March 7, 2012 23:08

Thanks Gabriele for answering,

I wrote a dummy script of my own.

Best regards.

prasanth July 2, 2012 04:43

Hello All,

Can any body face the issue with torque value in OpenFOAM? Currently I am using OpenFOAM-2.1.1. Torque value is not matching with any of the other commercial packages like CCM+ or fluent etc. In CCM+ there is option called wall rotation set to zero for some patches. Is it same as non rotating Patches in OpenFOAM. If I am giving patch names under non rotating patches, velocity is showing zero on those patches. According to settings, it is correct only. But There is a Rotating Zone. So, there should be some relative velocity on those patches. I am thinking, this may be the reason, why OF torque value is not matching. May be my thinking can be wrong.

Can any body help me on this.

prasanth July 2, 2012 04:44

Torque value in OpenFOAM
 
Hello All,

Can any body face the issue with torque value in OpenFOAM? Currently I am using OpenFOAM-2.1.1. Torque value is not matching with any of the other commercial packages like CCM+ or fluent etc. In CCM+ there is option called wall rotation set to zero for some patches. Is it same as non rotating Patches in OpenFOAM. If I am giving patch names under non rotating patches, velocity is showing zero on those patches. According to settings, it is correct only. But There is a Rotating Zone. So, there should be some relative velocity on those patches. I am thinking, this may be the reason, why OF torque value is not matching. May be my thinking can be wrong.

Can any body help me on this.

pechwang February 6, 2013 17:16

Hi Linnemann,

I want to know the torques on two patches. So I added two names. However, OpenFOAM only gives me the sum of the two torques. Can you help me with this? Thank you very much.

Pengchuan

Quote:

Originally Posted by linnemann (Post 317482)
Just a question.

Why dont you just use the forces library already present in OF?

put this in the end of the controlDict.

Code:

functions
(
    forces
    {
        type forces;
        functionObjectLibs ("libforces.so");
        outputControl timeStep;
        outputInterval 1;
        patches (wallBlade);
//        pname p;
//        Uname U;
        rhoName rhoInf;
        log true;
        rhoInf 1.205;
        CofR (0 0 0);
    }
);

This will output the forces/torque in x,y,z direction.

The output to the terminal will look like this.

Code:

    forces(pressure, viscous)((2162.2 -313.192 35.8823) (12.5865 3.1166 3.97532))
    moment(pressure, viscous)((1162.4 6862.37 100.944) (-12.5067 35.4299 -50.9462))

Then you can always make your own script to add the pressure torque with the viscous torque or just calculate them by hand.


olivierG February 7, 2013 08:11

hello,

I guess you already have find the solution, but just in case :

Code:

functions
(
forces_patch1
  {
  type forces;
  ...
  patches (patch1);
  ...
  }
forces_patch2
  {
  type forces;
  ...
  patches(patch2);
  ...
  }
)

regards,
olivier

pechwang February 7, 2013 09:33

Hi Olivier,

Thank you very much. It helps me a lot. I have another question. Do you know how to calculate the flow rate on one surface. It seems that it is very complex to do that. Is that right?Thank you again.

Pengchuan

olivierG February 7, 2013 09:59

Hello Pengchuan,

If you are using OF version <= 2.0, take a look at http://openfoamwiki.net/index.php/Contrib_simpleFunctionObjects.
If this is not the case, take a look at swak4foam.

regards,
olivier

pechwang March 19, 2013 19:55

Hi Olivier,

Now I use SRFSimplefoam to do some simulations. In SRFsimpleFoam, there is no U file, only Urel. I modify the code to Pname P; Uname Urel. Unfortunately, it didn't work. Can you give me a hand on this?

neiht September 9, 2013 21:34

I think just waiting for some writing steps and modify controdict with Uabs.

MadsR November 12, 2013 05:58

Hi guys,

I use Urel (this is the only one that works) in the force section of controlDict but I get very wrong torque. Any suggestions here? Or anyone having issues with SRFSimpleFoam and torque/forces.

Mads

Tobias Adam November 18, 2013 08:01

Calculating Forces at SRFSimpleFoam
 
I have the same problem as Pengchuan. I use SRFSimpleFoam and donīt get the right name for U. I even tried Urel but it didnīt work!
Code:

forces
    {
        type forces;
        functionObjectLibs ("libforces.so");
        outputControl timeStep;
        outputInterval 20;
        patches (BLADE);
        pname p;
        Uname Uabs;  // or Urel, or U, nothing worked...
        rhoName rhoInf;
        log true;
        rhoInf 1.205;
        CofR (0 0 0);
        liftDir (0 0 1);
        dragDir (1 0 0);



I get the following error message:
Code:

  FOAM Warning :
    From function void forces::read(const dictionary&)
    in file forces/forces.C at line 449
    Could not find U, p in database.
    De-activating forces.



I donīt understand why Urel does not work.
I use a second Run-time Post-processing library called Probes which works perfectly with Urel.
Code:

probes
    {
        type probes;
        functionObjectLibs ("libsampling.so");
        probeLocations ((0 0 -0.7) (1 0 -0.1) (1 0 0.1)  (1.55 0 0));
        fields ( Urel p );



Thank you very much for your help.

Best regards
Tobias



Aurelien Thinat November 18, 2013 08:47

Hi Tobias,

I have never used SRFSimpleFoam, but there are some similar problem other solvers.

If there is no file U in your solver : it's possible that the force calculating utility use a hard coded name of the velocity file. If you can compile on your machine, you can juste create a field U defined by U = Uabs. And then use the force function with this new field. It should work.

You may have to do the same with the pressure if there is no "p" field.

immortality November 19, 2013 14:48

Hi dear Tobias,
I haven't worked with this solver,what are the fields it uses?

Tobias Adam November 20, 2013 05:46

Problem solved
 
Thank you very much for your help!

The problem is resolved as I changed

Uname Urel; to
UName Urel;

I found the problem, after trying all different controll dict entries listed in the different threads for this problem (also on other websites).
Many posts include this error that only leads to problems if your velocity-field is not named "U".

@ Aurelien: This seems to be easier than craeting the new U field ;-). Nevertheless thank you very much for your help

@ Eshan: As far as I understood the question, it uses Urel for the data output in the output-file from the backround process and from this it generates the Folder Urel and Uabs in the time directory.
The rest is similar to SimpleFoam :-)

best regards
Tobias :-)

ozes November 7, 2018 18:12

Torque
 
Hi Friends, Somebody can compilate the files of calculateTorque?


All times are GMT -4. The time now is 04:35.