Skip to content

fixedProfile condition does not permit restarting simulation from last time step

Summary:

When using the fixedProfile boundary condition, I am unable to restart a simulation from the last saved time directory. The issue appears to be that fixedProfile does not write the field so that it can then be read when restarting the simulation. I am solving a Poisson equation using the laplacianFoam solver. I implement fixedProfile in my 0/T file as shown below, where east is one of my boundaries.

east
{
    type fixedProfile;
    profile coded;
    name EastBC;

    codeInclude #{ #};

    code
    #{
        #include "../../Inputs/Properties.H"
        return scalar
        (
           sin(Lx)*sin(x)
        );
     #};
     direction (0 1 0);
     origin 0;
}

The simulation runs fine the first time. But when I try to rerun from the last saved time directory, I get the error below:

--> FOAM FATAL IO ERROR: (openfoam-2406) Unknown Function1 type fixedProfile for profile

Valid Function1 types :

26 ( coded constant cosine csvFile expression functionObjectTrigger functionObjectValue halfCosineRamp inputValueMapper linearRamp lookup none one polynomial quadraticRamp quarterCosineRamp quarterSineRamp sample scale sine square step table tableFile uniform zero )

file: 4/T/boundaryField/east at line 1060 to 1079.

From static Foam::autoPtr<Foam::Function1<Type>> Foam::Function1<double>::New(const Foam::word &, const Foam::entry *, const Foam::dictionary &, const Foam::word &, const Foam::objectRegistry *, const bool) [Type = double]
in file /Volumes/OpenFOAM-v2406/src/OpenFOAM/lnInclude/Function1New.C at line 140.

FOAM exiting

If I then open the 4/T file, here is what the east boundary looks like:

east
{
    type            fixedProfile;
    profile
    {
        type            fixedProfile;
        profile         coded;
        name            EastBC;
        codeInclude     #{ #};
        code            #{
    #include "../../Inputs/Properties.H"
    return scalar
    (
       sin(Lx)*sin(x)
    );
 #};
        direction       ( 0 1 0 );
        origin          0;
    }
    direction       (0 1 0);
    origin          0;
    value           nonuniform List<scalar> 

32 ( 0.07804555139 0.232235118612 0.380766408992 0.520020541954 ....

Environment: I am using v2406 on a MacOS.

Edited by Andrew Heather