CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   a phase exist in two fields,how to patch it (https://www.cfd-online.com/Forums/openfoam/213132-phase-exist-two-fields-how-patch.html)

huie December 16, 2018 06:29

a phase exist in two fields,how to patch it
 
SetfieldDict can patch initial phase in one region.now I want to patch two fields with one phase.So I code like this:

regions
(
BoxToCell
box (0 0.02 0) (0.003 0.023 0.1)
fieldValues
(
volScalarFieldValue alpha.water 0
box (0.08 0 0) (0.1 0.05 0.1)
fieldValues
(
volScalarFieldValue alpha.water 0

);
}
);

but actually it only patched the second field i have patched,what's wrong with my code?

gkarlsen December 19, 2018 07:37

Quote:

Originally Posted by huie (Post 719271)
SetfieldDict can patch initial phase in one region.now I want to patch two fields with one phase.So I code like this:

regions
(
BoxToCell
box (0 0.02 0) (0.003 0.023 0.1)
fieldValues
(
volScalarFieldValue alpha.water 0
box (0.08 0 0) (0.1 0.05 0.1)
fieldValues
(
volScalarFieldValue alpha.water 0

);
}
);

but actually it only patched the second field i have patched,what's wrong with my code?

You need to do boxToCell twice. Something like this:

Code:


regions
(
    boxToCell
    {
        box (-1 -1 -1) (1 0.6 0.1);
        fieldValues
        (
            volScalarFieldValue alpha.water 1
        );
    }
    boxToCell
    {
        box (-1 -1 -1) (1 0.6 0.1);
        fieldValues
        (
            volScalarFieldValue p_rgh 1000
        );

    }
    boxToCell
    {

        box (-1 0.6 -1) (1 5 0);
        fieldValues
        (
            volScalarFieldValue alpha.water 1
        );
    }
);


huie December 23, 2018 09:06

much help,thank you


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