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   March 18, 2010, 19:50
Default running modified foamLog script
  #141
New Member
 
Join Date: Mar 2009
Posts: 14
Rep Power: 17
jakaranda is on a distinguished road
Quote:
Originally Posted by ngj View Post
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
Hello Niels,
I have created a ModfoamLog file where I have added your script to the bottom of the foamLog file but when I try to run ModfoamLog I get that it can't read the ModfoamLog.db database.

Any ideas on what this means?

Thank you
jakaranda is offline   Reply With Quote

Old   April 25, 2010, 14:15
Default
  #142
Senior Member
 
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17
enry is on a distinguished road
Hi all, I'm simulating a 3D flow around a Vertical axis wind turbine, and I need the force on the blades. I had no problem with 2D model. For 3D model I have an error:


*** glibc detected *** turbDyMFoam: corrupted double-linked list: 0x088463a0 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb59400cd]
/lib/tls/i686/cmov/libc.so.6[0xb594188e]
/lib/tls/i686/cmov/libc.so.6(cfree+0x90)[0xb59454f0]
/home/enrico/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux/lib/libstdc++.so.6(_ZdlPv+0x21)[0xb5b22051]
/home/enrico/OpenFOAM/ThirdParty/gcc-4.3.1/platforms/linux/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1d )[0xb5b0061d]
/home/enrico/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPOpt/libOpenFOAM.so(_ZN4Foam14primitiveEntryD0Ev+0x111)[0xb5d0f531]
/home/enrico/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPOpt/libOpenFOAM.so(_ZN4Foam10dictionaryD2Ev+0x79)[0xb5d08d79]
/home/enrico/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPOpt/libOpenFOAM.so(_ZN4Foam15dictionaryEntryD0Ev+0x33)[0xb5d15da3]
/home/enrico/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPOpt/libOpenFOAM.so(_ZN4Foam10dictionaryD1Ev+0x79)[0xb5d073a9]
/home/enrico/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPOpt/libOpenFOAM.so[0xb5c93aeb]
/lib/tls/i686/cmov/libc.so.6(__cxa_finalize+0xb1)[0xb59043b1]
/home/enrico/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPOpt/libOpenFOAM.so[0xb5c93893]
/home/enrico/OpenFOAM/OpenFOAM-1.5-dev/lib/linuxGccDPOpt/libOpenFOAM.so[0xb5f9a31c]
/lib/ld-linux.so.2[0xb771f00f]
/lib/tls/i686/cmov/libc.so.6(exit+0xd4)[0xb5904084]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe8)[0xb58ec458]
turbDyMFoam(_ZNK4Foam11regIOobject11writeObjectENS _8IOstream12streamFormatENS1_13versionNumberENS1_1 5compressionTypeE+0xcd)[0x8058ee1]
======= Memory map: ========
08048000-080a3000 r-xp 00000000 08:05 434209 /home/enrico/OpenFOAM/OpenFOAM-1.5-dev/applications/bin/linuxGccDPOpt/turb

.................................................. .........................etc etc ....................................

I attached the following line on my controlDict:


force
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (blades); // change to your patch name
rhoName rhoInf;
rhoInf 1.225; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
outputControl timeStep;
outputInterval 1;
}



Any ideas?
Thanks in advance.
Enry.

Last edited by enry; April 25, 2010 at 15:08.
enry is offline   Reply With Quote

Old   May 27, 2010, 07:43
Thumbs up keyword nu is undefined
  #143
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 16
flowris is on a distinguished road
Hello,

I m calculating the flow around a ship using interFoam in OF-1.5. The simulation worked fine, and then I decided to calculate forces generated on the patch HULL, so I added following lines to the end of my controlDict:

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (HULL); // change to your patch name
rhoInf 1.225; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
}
);


Running interFoam again, I received following error message:

keyword nu is undefined in dictionary "/home/jmatthei/OpenFOAM/jmatthei-1.5/run/monohull2/constant/transportProperties"

file: /home/jmatthei/OpenFOAM/jmatthei-1.5/run/monohull2/constant/transportProperties from line 29 to line 70.

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

FOAM exiting
flowris is offline   Reply With Quote

Old   May 27, 2010, 16:31
Default
  #144
Senior Member
 
Herman
Join Date: Nov 2009
Posts: 122
Rep Power: 17
enry is on a distinguished road
Hi, try to add the following line:

functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (HULL); // change to your patch name
rhoName rhoInf;
rhoInf 1.225; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
}
);
enry is offline   Reply With Quote

Old   May 28, 2010, 09:34
Default
  #145
Member
 
Nick Gardiner
Join Date: Apr 2009
Location: Chichester, UK
Posts: 94
Rep Power: 17
NickG is on a distinguished road
Hi Enry

Does adding:
outputControl timeStep;
outputInterval 1;

actually do anything?
I've tried changing the outputInterval so that I don't get so many data points but it makes no difference whether it's there or not.

Do you how I could reduce the sampling?

Thanks

Nick
NickG is offline   Reply With Quote

Old   May 28, 2010, 09:37
Default
  #146
Member
 
Nick Gardiner
Join Date: Apr 2009
Location: Chichester, UK
Posts: 94
Rep Power: 17
NickG is on a distinguished road
I'm using 1.5-dev so maybe it only works for 1.6?
NickG is offline   Reply With Quote

Old   May 28, 2010, 10:53
Default
  #147
Member
 
Nick Gardiner
Join Date: Apr 2009
Location: Chichester, UK
Posts: 94
Rep Power: 17
NickG is on a distinguished road
Answering my own question: i found that OutputFilterFunctionObject looks for "interval" and uses that, so adding:

interval 10;

to the forces {...} function, outputs the force every 10 timesteps...
NickG is offline   Reply With Quote

Old   June 1, 2010, 03:35
Default
  #148
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 16
flowris is on a distinguished road
Hi Enry (and others),


I added the line in red, but this doesn't fix the problem. The error remains the same:

keyword nu is undefined in dictionary "/home/jmatthei/OpenFOAM/jmatthei-1.5/run/monohull2/constant/transportProperties"

file: /home/jmatthei/OpenFOAM/jmatthei-1.5/run/monohull2/constant/transportProperties from line 29 to line 70.

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


The funny thing is that the keyword nu IS defined in constant/transportProperties, for both phases. And if I do not calculate the forces, the error does not occur.

Where can I find info on libforces.so?
flowris is offline   Reply With Quote

Old   June 1, 2010, 06:53
Default
  #149
Member
 
Nick Gardiner
Join Date: Apr 2009
Location: Chichester, UK
Posts: 94
Rep Power: 17
NickG is on a distinguished road
Hi flo

Has libforces.so compiled - it should be in /OpenFOAM/OpenFOAM-1.5-dev/lib/linux64GccDPOpt?

The source files are in /src/postProcessing/forces/forces if that's any help. Are you using 1.5 or 1.5-dev? I'm using the latter.

Nick
NickG is offline   Reply With Quote

Old   June 2, 2010, 04:01
Default
  #150
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 16
flowris is on a distinguished road
Hi Nick,

I am using OF-1.5, and I do have the file libforces.so in the folder OpenFOAM-1.5/lib/linux64GccDPOpt.
The solver I use is interFoam, a solver for multiphase systems. After having a look at the source file (though I lack experience in C++), I think libforces does not work for interFoam. If I understand things right, the force consists of
1) pressure force, which can be calculated
2) viscous friction
Viscous friction cannot be calculated everywhere, because the kinematic viscosity coefficient nu is different for different phases, as defined in constant/transportProperties. This also explains the error:

keyword nu is undefined in dictionary "/home/jmatthei/OpenFOAM/jmatthei-1.5/run/monohull2/constant/transportProperties"


Is this reasoning correct? If so, another library for the calculation of forces for multiphase systems should be made.
flowris is offline   Reply With Quote

Old   June 2, 2010, 09:39
Default
  #151
Member
 
Nick Gardiner
Join Date: Apr 2009
Location: Chichester, UK
Posts: 94
Rep Power: 17
NickG is on a distinguished road
That makes sense to me since in forces.C it is only looking for one nu.
So it looks like you need to write a new forces library function to account for both (and possibly sigma - I haven't used interFoam so don't know)
I'm afraid you'll need someone else to help with that as I'm only a beginner on that front.
Alternatively you could split your HULL patch into above and below the waterline but that may not be easy and I don't know if the waterline is fixed or time dependent

Good luck -Nick
NickG is offline   Reply With Quote

Old   June 11, 2010, 06:01
Default
  #152
New Member
 
Gonzalo Tampier
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 9
Rep Power: 17
gtampier is on a distinguished road
Hello flo, hello Nick,

I think I've managed to find a solution if you are looking for the forces caused by only one of the phases (in my case water). First I did the change proposed in #111. Additionally, I multiply the viscous force with gamma, in order to "deactivate" the viscous force produced by air with the false viscosity:

//this line (in OF15dev line 369 of forces.C) was commented out:
//vectorField vf = Sfb[patchi] & devRhoReffb[patchi];
//and was replaced by this:
vectorField vf = Sfb[patchi] * gamma.boundaryField()[patchi] & devRhoReffb[patchi];

for this I needed to declare gamma in this object (after line 347):
const volScalarField& gamma = obr_.lookupObject<volScalarField>("gamma");

surely is it a "quick 'n dirty" solution, but it seems to work fine! If anyone has a better proposal I would be glad to hear about it.
BTW: in order to keep using the forces library for single phase solvers, I've put all this in a new directory called "forcesInter" under $FOAM_SRC/postProcessing/forces and renamed everything (forcesInter instead of forces) accordingly.. then I can call in my controldict:
functions
(
forcesInter
{
type forcesInter; // class
functionObjectLibs ("libforces.so"); // req. lib.
patches (ship); // name of patches
...
}
When I compare the output from forces.dat and forcesInter.dat, I get a viscous force which is very similar to the expected from the ITTC of flat plate friction line. The forces.dat delivered a force almost 4 times greater!
Regards

Gonzalo
dupeng likes this.
gtampier is offline   Reply With Quote

Old   June 24, 2010, 13:46
Default Forces on Biphasic Flows ( nu's )
  #153
New Member
 
Saśl Balsa
Join Date: Jun 2010
Posts: 5
Rep Power: 16
Saśl Balsa is on a distinguished road
Greetings to all Foamers !

First, I am kind of a newbie related to all the OpenFOAM stuff, so my apologies in advance in case any of my questions are of a really basic level!

I am now starting to work on the very beginning of what I consider could be the main topic of my PhD thesis ( Free surface flows simulation ) ... but don't know yet. The thing is that I am involved in calculations to obtain the forces/moments generated by anti-roll U tank used as a pasive stabilisation system on ships, ... well, actually I am benchmarking the numerical method with a well proved and test 2D rectangular tank.

I have been struggling for quite a time to understand how to obtain forces with the already built-in utilities of OpenFOAM ( forces.C ) when I came to find this useful thread and the idea of getting not accurate results is planning around my messy head ...

The point of having (physically) two nus in the model (air plus water ) is incongruent with the numerical method, which only accounts for one, thus, providing bad results ??? Do I have to use an ad-hoc class as the one suggested by Gonzalo ( thx by the way! )??? ... is this issue of having to modify the class to account for both nus been noticed and assumed by the Foam developers? ...

Looking forward for your witty guidance!
Greetings to all
Saśl
Saśl Balsa is offline   Reply With Quote

Old   July 9, 2010, 10:58
Default
  #154
New Member
 
Sofia
Join Date: May 2010
Location: Toulouse, France
Posts: 14
Rep Power: 16
Sofia is on a distinguished road
Hi everyone,

I have always the same problem:
bounding nuTilda, min: -1416.98 max: 92790.2 average: 4.61316...
anf after my calcul crash. I work on an naca airfoil with freestreampressure and freestream for U, zeroGradient for nut and nuthilda with internafiled nut=3e-4 but I don't know wh
Sofia is offline   Reply With Quote

Old   July 23, 2010, 08:48
Default Post-running forces
  #155
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 16
flowris is on a distinguished road
Is it possible to run forces AFTER the simulation and how does one do this?
flowris is offline   Reply With Quote

Old   July 23, 2010, 10:47
Default
  #156
Member
 
Paulo Alexandre Costa Rocha
Join Date: Mar 2009
Posts: 71
Rep Power: 17
paulo is on a distinguished road
Quote:
Originally Posted by flowris View Post
Is it possible to run forces AFTER the simulation and how does one do this?
Hi, Flowris.

I never thought about this problem. I set the changes in controlDict on and run only one timestep.

Best regards,

Paulo Rocha
paulo is offline   Reply With Quote

Old   July 26, 2010, 08:13
Default
  #157
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 16
flowris is on a distinguished road
Hello,


This function to calculate forces keeps on giving me headaches. I try to do it as simple as possible: I add the following lines to the system /controlDict of the cavity tutorial:

Code:
functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (fixedWall); // change to your patch name
rhoName rhoInf;
rhoInf 1.225; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
}
);

The calculations runs well, but for the forces I get the following output:
Code:
*** glibc detected *** icoFoam: corrupted double-linked list: 0x000000000257e920 ***
Inconsistency detected by ld.so: dl-open.c: 221: dl_open_worker: Assertion `_dl_debug_initialize (0, args->nsid)->r_state == RT_CONSISTENT' failed!
flowris is offline   Reply With Quote

Old   July 26, 2010, 11:36
Default interFoam forces 1.6
  #158
Senior Member
 
Join Date: Apr 2010
Posts: 151
Rep Power: 16
flowris is on a distinguished road
Gonzalo,


Thanks for the advise. I implemented the changes in thread #111 and #152 also for OF-1.6. If you are interested, I can send you the files.

I would like to do the same flat plate validation as you did for 1.5-dev. I think it is the best if I use the same data. Where did you get them? I found for example 23rd ITTC, The Propulsion Committee, paragraph 5.3, pp. 106, fig. 5.7.


Greetings,


Joris
flowris is offline   Reply With Quote

Old   August 10, 2010, 12:01
Default OF 1.7 multiphase forces
  #159
Senior Member
 
Dave
Join Date: Jul 2010
Posts: 100
Rep Power: 16
daveatstyacht is on a distinguished road
Hi all,
I was curious, has the forces functions for multiphase solvers been modified in 1.7 to take into account the different densities of the phases (ie: water and air)? I am interested in determining the total force (resistance) acting on a surface (ship hull) and the results I am getting with interDyMFoam are little high compared to StarCCM results. If not has anyone managed to make a modification that can take into account both phases (as opposed to only one by multiplying the pressures by alpha to eliminate one phase)?

Thanks to anyone who can provide some insight into this.

-Dave
daveatstyacht is offline   Reply With Quote

Old   September 22, 2010, 08:01
Default
  #160
Senior Member
 
Join Date: Mar 2009
Posts: 225
Rep Power: 18
paka is on a distinguished road
Good day to everyone!

Quote:
Originally Posted by tomislav_maric View Post
to answer myself: forces lib has trouble finding the right nu in the transportProperties dict for interFoam cases.

in the ~/OpenFOAM/OpenFOAM-1.5-dev/src/postProcessing/forces/forces.C go to line number 101 and look around

[...]

I've commented the original troublesome part:
//ORIGINAL line
//dimensionedScalar nu(transportProperties.lookup("nu"));

because it tries to search for "nu" in transportProperties, and "nu" is nested within "phase1" or "phase2" subdictionary, so I've added this:

dimensionedScalar nu(transportProperties.lookupEntry("phase1").dict( ).lookup("nu"));
The problem still persists in the new version of OpenFOAM 1.7. I tried to add forces() function to controlDict, I also tried to apply above changes, in both cases I don't get any force output. I'm using interFoam solver.

Thanks for your time and I hope someone can help me. Have a great day!
K
paka 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 10:40
Fan type BC in OF15 hsieh OpenFOAM Running, Solving & CFD 31 July 30, 2015 13:22
Bug in patchIntegrateC OF15 anger OpenFOAM Bugs 8 May 29, 2009 05:36
OpenFOAMdev migration to OF15 fisher OpenFOAM Installation 1 November 25, 2008 15:39
Bug or a feature of OF15 rafal OpenFOAM Bugs 5 July 25, 2008 06:25


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