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/)
-   -   Forces in V1.6 (https://www.cfd-online.com/Forums/openfoam-post-processing/67984-forces-v1-6-a.html)

sandy March 28, 2010 21:43

Sigh, I just want to solve my simulation problems and get a correct result. It is right or wrong, you think....

sandy April 10, 2010 22:50

Quote:

Originally Posted by jploz (Post 240164)
Hi Gonzalo,

no, the forces object supplied with OF 1.6 does not support multiphase flow. It uses the prescribed density "rhoInf" when calculating the viscous forces (as I already wrote here http://www.cfd-online.com/Forums/ope...ip-flow-2.html) which is obviously not correct in the case of compressible flow and flow involving more than a single incompressible phase. If you would use a constant density in such case your resulting viscous forces would differ a lot.

In order to fix this, you need to read the current density field and use that instead of the defined "rhoInf".

Good luck.
Jean-Peer

.

Wat ??

Adrien June 23, 2010 01:29

To remove barckets in bash for a file called crap:

cat crap | sed s/\(//g | sed s/\)//g > crap_nobracket

For the Headers, I would just open remove and save (it is not elegant but easy...)

In Octave, to give it the format you want:

myFile = fopen('<FileName.txt>',"w");
fprintf(myFile,"(%f %f %f)\n",<Vector>);
fclose(myFile);

petterab June 25, 2010 08:20

Quote:

Originally Posted by g.redondo (Post 240096)
Hi all,

I was trying to include the density in the forces.C file and I found that there are already some lines regarding to it. Therefore I wonder if multi-phase is already supported in OF1.6.

If so, how should the controlDict entry be. If it doesn't support it, how should it be included? The most important line would be the following. I think it should be:

vectorField vf = (Sfb[patchi] & devRhoReffb[patchi])*rho.boundaryField()[patchi];

and it is:

vectorField vf = Sfb[patchi] & devRhoReffb[patchi]

has anyone fixed this?

Gonzalo

Does anyone know how to fix this for multiphase flow (e.g. interFoam) and does anyone have an updated force.C which accounts for variable density and viscosity/or instructions saying where to change the file force.C?

Any comments are highly appreciated :)

Thanx,

Andreas

Hrushi July 26, 2010 07:51

forces and monents in OF1.6
 
I am trying to calculate torque generated by impellar using execFlowFunctionObjects.

Hrushi July 27, 2010 01:09

Hi Stephane,

I am also using MRFSimpleFoam OF1.6.
I am trying to calculate moment about x.y and z axis.
I get the following error:

Create time
Create mesh for time = 500
Time = 500
Reading phi
Reading U
Reading p
Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmaEps 1.3;
}

Unknown function type Forces
Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.
FOAM exiting

My controlDict is:
application MRFSimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 500;
deltaT 1;
writeControl timeStep;
writeInterval 50;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;

functions
{
forces
{
type Forces;
functionObjectsLibs ("libforces.so");
outputControl outputTime;
patches (Rushton_Turbine_5_To_WALL);
rhoNmae rhoInf;
rhoInf 1.0;
pName p;
Uname U;
log true;
CofR (0 0 0);
}
forceCoeffs
{
type forceCoeffs;
functionObjectsLibs ("libforces.so");
patches (Rushton_Turbine_5_To_WALL);
pName p;
Uname U;
rhoName rhoInf;
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 55.5;
lRef 0.6;
ARef 1;
}
};

What should I do to get the moments? Do I need to change anything else?

Regrads,
Hrushikesh

openfoam_user July 27, 2010 02:12

Hello,
try this !

-----------------

functions
(
forces
{
type forces;
functionObjectsLibs ("libforces.so");
patches (Rushton_Turbine_5_To_WALL);
rhoName rhoInf;
pName p;
Uname U;
rhoInf 1.0;
CofR (0 0 0);
outputControl timeStep;
outputInterval 1;
log true;
}
forceCoeffs
{
type forceCoeffs;
functionObjectsLibs ("libforces.so");
patches (Rushton_Turbine_5_To_WALL);
pName p;
Uname U;
rhoName rhoInf;
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 55.5;
lRef 0.6;
ARef 1;
}
);

-----------------
Regards,
Stephane.

Hrushi July 27, 2010 02:25

Hi Stephane,

I have tried this. But it gives me following error.

Unknown function type Forces
Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.
FOAM exiting

openfoam_user July 27, 2010 02:36

My controlDict is :

---------------------------------

application MRFSimpleFoam;
startFrom startTime;
startTime 0;
stopAt endTime;
endTime 5000;
deltaT 1;
writeControl timeStep;
writeInterval 1000;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;

functions
(
forces_turbine
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (Rushton_Turbine_5_To_WALL); // change to your patch name
pName p;
Uname U;
rhoName rhoInf;
rhoInf 1; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
outputControl timeStep;
outputInterval 1;
log true;
}
);

-------------------------------------------------
This controlDict (only calculate forces) works fine for me.
Warning : 'type forces;' not 'type Forces;'
Stephane.

Hrushi July 27, 2010 02:56

I have tried your 2nd reply also.
Do we have to modify anything alse in our case directory like changes in 0..
I am still getting the same error:
Unknown function type forces
Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.
FOAM exiting

Hrushikesh

naveen July 27, 2010 03:04

Forces in V1.6
 
hi Hrushikes,

try this to get the forces in OpenFOAM 1.6..

functions
(
forces
{
type forceCoeffs;
functionObjectsLibs ("libforces.so");
outputControl timeStep;
outputInterval 1;
patches
{
Rushton_Turbine_5_To_WALL
);
pName p;
Uname U;
log true;
rhoInf 1.225;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 55.5;
lRef 0.6;
ARef 1;
}
);

Regards

Naveen
NAL, Bangalore

Hrushi July 27, 2010 04:12

Hi Naveen,
I have tried the things you have mentioned. But the error still remains.

Unknown function type force_coeffs
Table of functionObjects is empty

From function functionObject::New(const word& name, const Time&, const dictionary&)
in file db/functionObjects/functionObject/functionObject.C at line 74.
FOAM exiting

What do the 1st two lines of error mean?

regards
Hrushikesh

paka September 22, 2010 07:30

Any update in that matter? I tried different approaches, I mainly followed the following post: http://www.cfd-online.com/Forums/ope...es-of15-8.html

I'm using OpenFOAM 1.7.1 and interFoam solver.

Have a great day everyone!
K

paka September 22, 2010 15:25

I also tried to use icoFoam solver. In both cases I do not get any force output, neither in the screen output, nor in any file format.

Hrushi September 23, 2010 01:43

Quote:

Originally Posted by paka (Post 276139)
Any update in that matter? I tried different approaches, I mainly followed the following post: http://www.cfd-online.com/Forums/ope...es-of15-8.html

I'm using OpenFOAM 1.7.1 and interFoam solver.

Have a great day everyone!
K

Hi,
I am attaching my controlDict file here. This version of controlDict is working for me (OF 1.6).


application MRFSimpleFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 1500;
deltaT 1;
writeControl timeStep;
writeInterval 10;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
runTimeModifiable yes;
functions
{
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
patches (Rushton_Turbine_5_To_WALL); // change to your patch name
pName p;
Uname U;
rhoName rhoInf;
rhoInf 1000;
CofR (0.16 0 0); //Origin for moment calculations
outputControl timeStep;
outputInterval 1;
}
}

paka September 23, 2010 05:40

Hrushi,

Really, really appreciate your post. Your controlDict file worked perfectly fine. At the current moment I'm not sure what exactly made a trick, but it work.

Best,
K

paka September 23, 2010 05:56

I know the tool is not fully suitable for two-phase flows, but assuming that I only care for water domain (not air) I assume the tool gives acceptable solution.

So trying to use interFoam solver, the solver quits saying it cannot find "nu" in constant/transportProperties. I tried to redefine the code in forces.C, but for now I gave up. I found some work around, to add additional line at the beginning of transportProperties such as:

nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;

Can any of OpenFOAM gurus comment on that? Is such work around acceptable? I think the other two nu-s in phase1 and phase2 are read correctly by the solver.

Thanks,
K

desert_1250 January 14, 2011 17:17

drag & force over a cylinder patch
 
Hi all of foamers
I hope that you are well.
I have one question:
I want to calculate dragCoefficient over a cylinder with 0.025 diameter with viscoelasticFluidFoam solver. ( I use Kubuntu, OF 1-5 decv) . I add the code below in controlDict file
application viscoelasticFluidFoam;
startFrom latestTime;
startTime 0;
stopAt endTime;
endTime 300;
deltaT 1e-5;
writeControl adjustableRunTime;
writeInterval 1;
purgeWrite 0;
writeFormat ascii;
writePrecision 6;
writeCompression uncompressed;
timeFormat general;
timePrecision 6;
graphFormat raw;
runTimeModifiable yes;
adjustTimeStep on;
maxCo 0.8;
maxDeltaT 0.001;
functions
(
forces
{
type forces;
functionObjectLibs ("libforces.so"); //Lib to load
outputControl runTime;
outputInterval 1;
patches (cylinder); // change to your patch name
PName p;
Uname U;
rhoInf 803.87097; //Reference density for fluid
CofR (0 0 0); //Origin for moment calculations
}
forceCoeffs
{
type forceCoeffs;
functionObjectLibs ("libforces.so");
outputControl runTime;
outputInterval 1;
patches (cylinder); //change to your patch name
PName p;
Uname U;
log true;
rhoInf 803.87097;
CofR (0 0 0);
liftDir (0 1 0);
dragDir (1 0 0);
pitchAxis (0 0 0);
magUInf 0.036;
lRef 0.025;
Aref 0.025;
}
);
// ************************************************** *********************** //
, but when run it,after one step, this error appear :
Courant Number mean: 3.24445e-07 max: 5.10534e-06 velocity magnitude: 0.000421808
deltaT = 1.43997e-05
No valid model for viscous stress calculation.
From function forces::devRhoReff()
in file forces/forces.C at line 306.
FOAM exiting
*** glibc detected *** viscoelasticFluidFoam: double free or corruption (fasttop): 0x0902a378 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6(+0x6b591)[0x52c591]
/lib/tls/i686/cmov/libc.so.6(+0x6cde8)[0x52dde8]
/lib/tls/i686/cmov/libc.so.6(cfree+0x6d)[0x530ecd]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0x7b3741]
/usr/lib/libstdc++.so.6(_ZNSs4_Rep10_M_destroyERKSaIcE+0x1d )[0x78fc2d]
/usr/lib/libstdc++.so.6(_ZNSsD2Ev+0x4c)[0x79163c]
/usr/lib/OpenFOAM-1.5-dev/lib/libfiniteVolume.so(_ZN4Foam4wordD1Ev+0x1d)[0xcf2efd]
/lib/tls/i686/cmov/libc.so.6(+0x2f1bf)[0x4f01bf]
/lib/tls/i686/cmov/libc.so.6(+0x2f22f)[0x4f022f]
/usr/lib/OpenFOAM-1.5-dev/lib/libOpenFOAM.so(_ZN4Foam5error4exitEi+0x1f9)[0x3f5d2f9]
/usr/lib/OpenFOAM-1.5-dev/lib/libforces.so(_ZNK4Foam6forces10devRhoReffEv+0xf54)[0x65315f4]
/usr/lib/OpenFOAM-1.5-dev/lib/libforces.so(_ZNK4Foam6forces10calcForcesEv+0x32)[0x652c852]
.
.
.
======= Memory map: ========
00110000-0024a000 r-xp 00000000 00:10 16478 /usr/lib/OpenFOAM-1.5-dev/lib/libviscoelasticTransportModels.so
0024a000-0024b000 ---p 0013a000 00:10 16478 /usr/lib/OpenFOAM-1.5-dev/lib/libviscoelasticTransportModels.so
0024b000-0024d000 r--p 0013a000 00:10 16478 /usr/lib/OpenFOAM-1.5-dev/lib/libviscoelasticTransportModels.so
0024d000-0024e000 rw-p 0013c000 00:10 16478 /usr/lib/OpenFOAM-1.5-dev/lib/libviscoelasticTransportModels.so
0024e000-00410000 r-xp 00000000 00:10 16479 /usr/lib/OpenFOAM-1.5-dev/lib/libmeshTools.so
00410000-00413000 r--p 001c1000 00:10 16479 /usr/lib/OpenFOAM-1.5-dev/lib/libmeshTools.so
00413000-00415000 rw-p 001c4000 00:10 16479 /usr/lib/OpenFOAM-1.5-dev/lib/libmeshTools.so
00415000-00416000 rw-p 00000000 00:00 0
.
.
.
1) can u guide me What is the problem?
2) did I enter Aref number truly? how Lref ? ( my diameter cylinder is 0.025 & 2D)
3) If needed to complile forceCoeffs, can you tell me how complie it successfully?
Thank a lot, Rasoul

desert_1250 March 26, 2011 09:43

Hi
 
can every one help me that how to solve this error when i want to calculate cd (drag coeff),

No valid model for viscous stress calculation.

From fuction forces::devRhoReff()
in file foeces/forces.C at line 306


i added the turbulence lib & related lib to the solver and compiled it but this error always appear the run is stoped :(

Best, Rasoul

Eren10 June 10, 2011 10:44

mine BC conditions for pressure is zeroGradient, so I do not know what the pressure is at the farfield. at default pRef is set to 0.

How can I specify the pRef at the freestream pressure ? I have just added this line : pRef -1000; But this did not change anything , apparantly it did not use this value. I am calculating Cl Cd..


All times are GMT -4. The time now is 23:39.