CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   generally defined boundary conditions (https://www.cfd-online.com/Forums/openfoam-programming-development/131692-generally-defined-boundary-conditions.html)

linch March 19, 2014 08:21

generally defined boundary conditions
 
Hi foamers,

Following problem: I want to create a volScalarField with a given boundary condition on all the boundaries of this field. The implementation should be general and valid regardless of the number and the type of the boundaries defined elsewhere.

Here's an example. In createFields.H I want to create a field someField with boundaries
Code:

    {
        type            fixedValue;
        value          uniform 0;
    }

prescribed everywhere. Something looking like this

Code:

    volScalarField someField
    (
        IOobject
        (
            "someField",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::AUTO_WRITE
        ),
        mesh,
        dimensionedScalar("someField", dimensionSet(0,1,0,0,0,0,0), 0.0),
        ???? boundaries ????
    );

The red marked piece is what I'm looking for

ngj March 21, 2014 17:48

Hi Linch,

Replacing the red text with

Code:

"fixedValue"
should do the trick.

Good luck,

Nield


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