CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM (http://www.cfd-online.com/Forums/openfoam/)
-   -   any idea about forces with interFoam in OF-2.1.0 (http://www.cfd-online.com/Forums/openfoam/101821-any-idea-about-forces-interfoam-2-1-0-a.html)

Teemo May 15, 2012 04:51

any idea about forces with interFoam in OF-2.1.0
 
Good morning everyone,

I got some problem with forces in solver interFoam, I added forces function in ControlDict file but I got a error said :keyword nu is undefined in dictionary.

I did some search in this forum but got nothing about how to solve this problem. Any idea will be appreciate.


Regards,
T

colinB May 15, 2012 05:19

Hey,

first of all, the information you provide is very little and it would be helpful
if you could post the complete error message, so we know which dictionary
is affected.
Maybe the dictionary its self helps us also to track your error down!

By heart I can remember just two places where nu is required:

- constant/transportProperties
- system/controlDict (in the forces section, not sure about that)

So the error message tells you that this entity is not defined, which can
have two possible reasons:

- you didn't define them! solution: do so
- typo before the entry (e.g. semicolon missing or something like that)
solution: correct the typo

If something else is wrong, maybe your extended error message will tell us.

I hope I could contribute

regards

Teemo May 15, 2012 05:30

Hi colinB,

I am a newer so I started with tutorial Dambreak bundled in OF-2.1.0.
Then, I would like to know the forces vs t on the Dam so I added the following into controlDict file:
functions
(

forces
{

type forces;

functionObjectLibs ("libforces.so");

patches (wall);

rhoName rho;

rhoInf 1000;

CofR (0 0 0);

outputControl timeStep;

outputInterval 1;

}
and error occured
keyword nu is undefined in transportProperties dictionary, but it works well without the above information.

Regards

colinB May 15, 2012 05:50

would you mind posting your transportProperties file here?

either set it in code quotes or store it as a:

transportProperties.txt file

and upload it

There the parameter nu should be defined and for some reason
he cannot find/read it

Edit:

I just had another quick look at my controlDict file:

In your force section the line

nuInf 10e-6;

is missing after the line with rhoInf.

Check that and post the result here!

Teemo May 15, 2012 05:52

here is the transportProperties:

phase1
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1e-06;
rho rho [ 1 -3 0 0 0 0 0 ] 1000;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 0;
}

BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 99.6;
n n [ 0 0 0 0 0 0 0 ] 0.1003;
}
}

phase2
{
transportModel Newtonian;
nu nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
rho rho [ 1 -3 0 0 0 0 0 ] 1;
CrossPowerLawCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 1e-06;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
m m [ 0 0 1 0 0 0 0 ] 1;
n n [ 0 0 0 0 0 0 0 ] 0;
}

BirdCarreauCoeffs
{
nu0 nu0 [ 0 2 -1 0 0 0 0 ] 0.0142515;
nuInf nuInf [ 0 2 -1 0 0 0 0 ] 1e-06;
k k [ 0 0 1 0 0 0 0 ] 99.6;
n n [ 0 0 0 0 0 0 0 ] 0.1003;
}
}

sigma sigma [ 1 0 -2 0 0 0 0 ] 0.07;

colinB May 15, 2012 05:55

looks good so far,

have you checked my edit on my comment?

Teemo May 15, 2012 06:01

Is it possible that force function does not apply to multiphase situation? It can only read one nu?

colinB May 15, 2012 06:06

well, in your specific case I'm not sure, but actually I don't think so.
For me it works perfectly fine, and the patches I usually calculate
are also only partially submerged.
So with one nu in the forces section it should be totally fine.

Have you tried what I recommended you?

Teemo May 15, 2012 06:11

Yes, I have tried the method you recommended me but it still have this problem

colinB May 15, 2012 06:23

I just found something which might help you:

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

they have the same issue but what I understood they also couldn't solve it.
I'm still wondering y, for my files work completely fine.

here is what I used:

Code:


functions
(
        forces
        {
                type forces;
                functionObjectLibs ("libforces.so"); //Lib to load
                outputControl    timeStep;
                outputInterval 1;       
                patches (solid); // change to your patch name
                rhoInf 1000;                //Reference density for fluid
                nuInf 1e-6;                //Reference kinetic viscosity for fluid
                CofR (0 0 0);              //Origin for moment calculations
        }
        forceCoeffs
        {
                type forceCoeffs;
                functionObjectLibs ("libforces.so");
                outputControl  timeStep;
                outputInterval 1;
                patches (solid); //change to your patch name
                rhoInf 1000;
                nuInf 1e-6;
                CofR (0 0 0);
                liftDir (0 0 1);
                dragDir (-1 0 0);
                pitchAxis (0 1 0);
                magUInf -2.25;
                lRef 11.97;
                Aref 29.74341;
        }
);


Teemo May 15, 2012 07:31

I tried your codes but the problem's still there.

I dont quite understand what does jordi.muela say " I made some test and i found that if you write a nu definition out of the phases definition, it works." Do you have any idea?

And do you know any other way to plot forces on structure?

Regards

colinB May 15, 2012 08:04

I guess he means in the transportProperties file:

(see red highlighted part)

Code:


/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.7.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.com                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ] 1e-06;


twoPhase
{
    transportModel  twoPhase;
    phase1          phase1;
    phase2          phase2;
}

phase1
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ] 1e-06;
    rho            rho [ 1 -3 0 0 0 0 0 ] 1000;

}

phase2
{
    transportModel  Newtonian;
    nu              nu [ 0 2 -1 0 0 0 0 ] 1.48e-05;
    rho            rho [ 1 -3 0 0 0 0 0 ] 1;

}

sigma          sigma [ 1 0 -2 0 0 0 0 ] 0.07;


// ************************************************************************* //

Quote:


And do you know any other way to plot forces on structure?

Well, to plot them you first need to calculate them and as far as I know,
this is the only way to do it.
However I'm not sure if somebody else made a tool to do it otherwise
(maybe pyFoam has a feature like that)

Teemo May 22, 2012 05:23

hi colinB,

I made a new compiling with the suggestion of andrea and it works now,
I would like to ask you how to you define your forceCoeffs, how to you set these values:
magUInf -2.25; lRef 11.97; Aref 29.74341;

masterblaster May 22, 2012 08:59

magUInf is the freestream velocity. lref is the characteristic lengthscale (e.g. diameter) and Aref is the are you're calculating your force on, e.g. for cylinder that would probably be the projected area...

Teemo May 25, 2012 08:00

Hi,

If the freestream is linear wave or take the dambreak tutorial as example, how to set up the velocity?


All times are GMT -4. The time now is 20:48.