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/)
-   -   Problems with setFields (https://www.cfd-online.com/Forums/openfoam-pre-processing/216017-problems-setfields.html)

pbOPEN March 25, 2019 10:58

Problems with setFields
 
1 Attachment(s)
Hi all,

I am having difficulties with the setFields function. I am attempting to run a modified damBreak example, but I am unable to properly initialize water where I want it.

To make the modified mesh, I copied the damBreak tutorial to my run directory, and made some small edits to the mesh. After running blockMesh and modifying setFieldsDict, I attempted to run setFields. It successfully ran with no errors, however, the water is only appearing on the walls of my mesh (with no water in the interior). I have attached a picture of what I am seeing in paraFoam.

I have tried troubleshooting this in various ways. I completely rewrote setFieldsDict, I copied alpha.water.orig to alpha.water before running setFields, etc. I am still unable to properly set water where I want it.

Any help you can provide would be much appreciated and if you need anything else from me, just let me know.

Thank you.

alexeym March 26, 2019 09:28

Hi,

A bit of context would be nice. Could you post "some small edits to the mesh"?
Could you post your setFieldsDict modifications?

pbOPEN March 26, 2019 10:23

Quote:

Originally Posted by alexeym (Post 728910)
Hi,

A bit of context would be nice. Could you post "some small edits to the mesh"?
Could you post your setFieldsDict modifications?

Yes, thank you for the help.

Here is my blockMeshDict:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  6
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 0.001;

vertices
(
    (0 0 0)
    (60 0 0)
    (60 44.45 0)
    (0 44.45 0)
    (0 21.825 0)
    (0 22.625 0)
    (-10 22.625 0)
    (-10 21.825 0)
    (0 0 1)
    (60 0 1)
    (60 44.45 1)
    (0 44.45 1)
    (0 21.825 1)
    (0 22.625 1)
    (-10 22.625 1)
    (-10 21.825 1)
    (60 21.825 0)
    (60 21.825 1)
    (60 22.625 0)
    (60 22.625 1)
);

blocks
(
    hex (0 1 16 4 8 9 17 12) (20 20 1) simpleGrading (1 1 1)
    hex (4 16 18 5 12 17 19 13) (20 5 1) simpleGrading (1 1 1)
    hex (5 18 2 3 13 19 10 11) (20 20 1) simpleGrading (1 1 1)
    hex (4 5 6 7 12 13 14 15) (5 5 1) simpleGrading (1 1 1)
);

edges
(
);

boundary
(
    leftWall
    {
        type wall;
        faces
        (
            (0 8 12 4)
            (5 13 11 3)
            (7 15 14 6)

            (6 14 13 5)
            (3 11 10 2)

            (0 1 9 8)
            (4 12 15 7)
        );
    }
    atmosphere
    {
        type patch;
        faces
        (
            (16 18 19 17)
            (18 2 10 19)
            (1 16 17 9)
            (0 4 16 1)
            (4 5 18 16)
            (5 3 2 18)
            (8 9 17 12)
            (12 17 19 13)
            (13 19 10 11)
            (7 6 5 4)
            (15 12 13 14)
        );
    }
);

mergePatchPairs
(
);

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



And here is my setFieldsDict:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  6
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    location    "system";
    object      setFieldsDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defaultFieldValues
(
    volScalarFieldValue alpha.water 0
);

regions
(
    boxToCell
    {
        box (0 0 -0.02) (0.05 0.018 0.02);
        fieldValues
        (
            volScalarFieldValue alpha.water 1
        );
    }
);


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


I do not believe I changed anything else from the damBreak tutorial (which may be the reason I'm having trouble). Thank you again


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