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/)
-   -   MRFSource no more available in OpenFOAM 4? (https://www.cfd-online.com/Forums/openfoam-solving/176919-mrfsource-no-more-available-openfoam-4-a.html)

donQi August 30, 2016 23:11

MRFSource no more available in OpenFOAM 4?
 
Hello,

in the past, when launching simpleFoam simulations with MRF, I used to write in the fvOptions file :

Code:

MRF1
{
    type            MRFSource;
    active          true;
    selectionMode  cellZone;
    cellZone        cylinder_inner;

    MRFSourceCoeffs
    {
        origin      (0 0 0);
        axis        (-1 0 0);
        omega    90;
    }
}

in OpenFOAM 2.4 the source file was here:
src/fvOptions/sources/derived/MRFSource/MRFSource.C

but in OpenFOAM 4 is no more there. I would like to know what do you currently use to set an MRF source in OpenFOAM 4?

akidess August 31, 2016 02:37

Have a look at the tutorials. The relevant file is constant/MRFProperties.

donQi August 31, 2016 03:39

Thank you very much Anton.

for future readers, I copy here an example from the tutorial:
incompressible/simpleFoam/mixerVessel2D/constant/MRFProperties

Origin, axis and omega of the MRF zone are now set in the constant/MRFProperties file:

Code:

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

MRF1
{
    cellZone    rotor;
    active      yes;

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

    origin    (0 0 0);
    axis      (0 0 1);
    omega    104.72;
}

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


JasonG July 26, 2017 11:23

I recently upgrade from OF 2.4, and now I am also having issues running a past model on OF 3.0. I am attempted to model a fluid region that has an impeller to increase the static pressure.

The model has two zones: c0 = impeller domain, c1 = everything else. The previous fvOptions file looked like:

Code:

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


#include        "../0/initialConditions"

MRF1
{
    type            MRFSource;
    active          true;
    selectionMode  cellZone;
    cellZone        c0;

    MRFSourceCoeffs
    {
        // Fixed patches (by default they 'move' with the MRF zone)
        active          true;
        nonRotatingPatches ( inlet_1 outlet_1 boundary diffuser );  //patches need to be ones not rotating in actual frame
        origin (0 0 0);
        axis  (0 0 1);
    //  omega  constant 638.7905062;
       
        omega table
        (
        (0 0)
        (100 0)
        (200 $omega)
        (10000 $omega)
        );


               
    }
}


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


Per the above, I attempted to run the following:

Code:

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


#include        "../0/initialConditions"

MRF1
{

//    selectionMode  cellZone;
    cellZone        c0;
    active          yes;

    // Fixed patches (by default they 'move' with the MRF zone)

    nonRotatingPatches ( inlet_1 outlet_1 boundary diffuser );  //patches need to be ones not rotating in actual frame
    origin (0 0 0);
    axis  (0 0 1);
    //  omega  constant 638.7905062;
    omega table
    (
    (0 0)
    (100 0)
    (200 $omega)
    (10000 $omega)
    );


               

}


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


When I examine my two different log files, I notice the following:
OF 3.0:
Code:

Creating MRF zone list from MRFProperties
    creating MRF zone: MRF1
No finite volume options present

OF 2.4:

Code:

Creating finite volume options from "system/fvOptions"

Selecting finite volume options model type MRFSource
    Source: MRF1
    - applying source for all time
    - selecting cells using cellZone c0
    - selected 690499 cell(s) with volume 1.49875838




The model begins looking normal, but then suddenly crashes during the Omega ramping. I reviewed results just after the ramping, and the rotational velocity appears to correctly apply to only the impeller fluid domain. Just as the solution crashed, it appeared it was applying velocities to the entire domain. Any help is greatly appreciated!


EDIT: Honing in on my results just as the solution crashes, I am able to see that a few elements where the pressure field goes unbounded (outside of the MRF zone). I assume this is likely an issue with internal solver controls slightly changing b/t the two OF versions, as I am utilizing the same mesh file for both runs.

Taozi February 20, 2019 20:31

I am puzzled as to why the openfoam developers keep shoveling things around. To me this change adds no new functionality, only creates annoying compatibility issues that cost researchers precious time to fix.


All times are GMT -4. The time now is 08:43.