CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Variable Omega in MRFZones (https://www.cfd-online.com/Forums/openfoam-pre-processing/114872-variable-omega-mrfzones.html)

edalmau March 19, 2013 07:33

Variable Omega in MRFZones
 
Hi to all Foamers,
First thank to all of you cause you've been very helpful in mi introduction to OpenFoam. I've read a lot of posts to fix my errors but now I can't see how to fix this one. So I hope you can tell me what I'm doing wrong.

I'm trying to simulate a tank with a fluid rotating with variable angular velocity (omega). I read that someone tried to do that but I cannot find the post and the reference given by a user was to do the same as if you want to make gravity variable. So what I tried to do was making conditions in the MRFZones file.

Code:

/*--------------------------------*- C++ -*----------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  2.1.1                                |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "constant";
    object      MRFZones;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

3
(
    tank
    {
        // Fixed patches (by default they 'move' with the MRF zone)
        nonRotatingPatches ();

        origin    origin [0 1 0 0 0 0 0]  (0.5 0.5 0);
        axis      axis  [0 0 0 0 0 0 0]  (0 0 1);
        if (runTime.value()<=0.75){
        omega    omega  [0 0 -1 0 0 0 0] -3.14159;
        }
        else {
        omega    omega  [0 0 -1 0 0 0 0] 0.0;
        }
    }
 aire2
    {
        // Fixed patches (by default they 'move' with the MRF zone)
        nonRotatingPatches ();

        origin    origin [0 1 0 0 0 0 0]  (0 0 0);
        axis      axis  [0 0 0 0 0 0 0]  (0 0 1);
        omega    omega  [0 0 -1 0 0 0 0] 0.0;
    }
 aire1
    {
        // Fixed patches (by default they 'move' with the MRF zone)
        nonRotatingPatches ();

        origin    origin [0 1 0 0 0 0 0]  (0 0 0);
        axis      axis  [0 0 0 0 0 0 0]  (0 0 1);
        omega    omega  [0 0 -1 0 0 0 0] 0.0;
    }
)

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

As you can see there are 3 zones, and I want to try to change omega by adding and if condition depending on runTime.

I do all processes (blockMesh, topoSet, setsToZones, setFields,...) but when I try to solve (MRFInterFoam) an error ocurred pointing the MRFZones file.

Code:

Selecting incompressible transport model Newtonian
Selecting incompressible transport model Newtonian
Selecting turbulence model type laminar

Reading g
Calculating field g.h



--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 52 the punctuation token ')'

file: /home/eric/OpenFOAM/eric-2.1.1/run/tutorials/multiphase/MRFInterFoam/Buidat1s2DOV/constant/MRFZones at line 52.

    From function operator>>(Istream&, word&)
    in file primitives/strings/word/wordIO.C at line 74.

FOAM exiting

It seems to be a missing ) or something like that but I really don't see any error in my code.

Anyone can help me?

Thanks
Eric

edalmau March 20, 2013 10:35

After talking to my project tutor I realized that the conditions must not be in the dictionary. So I've fixed the problem.

pablodelag October 2, 2013 12:11

Hi Eric,

I am working with a similar simulation; it is a tank filled with water and an impeller on the bottom. I specified the MRFzones in fvOptions and everything seems okay. However, now I am trying to run it again with other dimensions (the impeller is no longer located at 0,0,0 ) and I don't know if my mistake is where I define the origin of rotation.

Do you know if that origin is the centre of the entire mesh, or is it the centre of the rotating object?

Thanks in advance.

edalmau October 9, 2013 07:13

Hey,
I did another thing to get the omega specified in the MRF dictionary in my solver. The origin defined in MRFZone dictionary is the origin of the rotation of your Reference Frame as far as I know.

If you need the omega in your solver I can tell you how to call it.

nash December 13, 2013 04:11

Quote:

Originally Posted by edalmau (Post 455913)
Hey,
I did another thing to get the omega specified in the MRF dictionary in my solver. The origin defined in MRFZone dictionary is the origin of the rotation of your Reference Frame as far as I know.

If you need the omega in your solver I can tell you how to call it.

can you tell me how?
i set my mrf zone as given:

Code:

MRF1
{
    type            MRFSource;
    active          true;
    selectionMode  cellZone;
    cellZone        fluid-mrf;

    MRFSourceCoeffs
    {
    nonRotatingPatches (rotor);

        origin      (0 0 0);
        axis        (0 0 1);
        omega  constant  806.3421144; /RPM 7700
    }
}

i set the pressure outlet higher as inlet (from the performance curve data) but the effect of the fan is nothing. the fluid flow from outlet to inlet.

can someone help me?

mheinz February 1, 2016 16:06

Hi.

As was the original problem of this post, I want to define a time depending omega for a MRFZone. Considering the boundary condition "rotatingWallVelocity" this can simply be done by defining a table with linear interpolation at intermediate time increments.

What are the options for the definition of a MRFZone?
Quote:

After talking to my project tutor I realized that the conditions must not be in the dictionary. So I've fixed the problem.
I think one way would be to modify the MRFZone.C and update the value of omega on every time increment.
Code:

Foam::MRFZone::MRFZone(const fvMesh& mesh, Istream& is)
:
    mesh_(mesh),
    name_(is),
    dict_(is),
    cellZoneID_(mesh_.cellZones().findZoneID(name_)),
    excludedPatchNames_
    (
        dict_.lookupOrDefault("nonRotatingPatches", wordList(0))
    ),
    origin_(dict_.lookup("origin")),
    axis_(dict_.lookup("axis")),
    omega_(dict_.lookup("omega")),
    Omega_("Omega", omega_*axis_)
{

But I would first like to ask for suggestions which might avoid manipulating the basic solver.

I'm thankful for any help.

Michael


All times are GMT -4. The time now is 09:18.