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/)
-   -   CodedFixedValue (https://www.cfd-online.com/Forums/openfoam-programming-development/239741-codedfixedvalue.html)

Erikaaa November 22, 2021 09:37

CodedFixedValue
 
Hello! FOAMers,

I am using the boundary function CodedFixedValue in icoFoam. The simulation works, but there is a problem when I am using paraFoam.

Version: openFOAM v8
Case: elbow.

Code:

boundaryField
{
    wall-4
    {
        type            noSlip;
    }

    velocity-inlet-5
    {
        //type            fixedValue;
        //value          uniform (1 0 0);
        type            codedFixedValue;
        value          $internalField;
        name          myPolynomialTemperature
       
        code
        #{
            scalar U_ave = 1;
            scalar h = 1.3;

            const fvPatch& boundaryPatch = this->patch();

            const vectorField& Cf = boundaryPatch.Cf();
           
            vectorField& field = *this;

            forAll(boundaryPatch, i)
            {
                field[i] = vector(U_ave*(1 - Foam::pow( Cf[i].y() / h, 2) ), 0, 0);
            }
        #};

        codeOptions
        #{
            -I$(LIB_SRC)/finiteVolume/lnInclude \
            -I$(LIB_SRC)/meshTools/lnInclude
        #};

        codeInclude
        #{
            #include "fvCFD.H"
            #include <cmath>
            #include <iostream>
        #};
    }

    velocity-inlet-6
    {
        type            fixedValue;
        value          uniform (0 3 0);
    }

    pressure-outlet-7
    {
        type            zeroGradient;
    }

    wall-8
    {
        type            noSlip;
    }

    frontAndBackPlanes
    {
        type            empty;
    }
}

command: paraFoam.

problem:
Code:

--> FOAM FATAL IO ERROR:
Failed wmake "dynamicCode/myPolynomialTemperature/platforms/linux64GccDPInt32Opt/lib/libmyPolynomialTemperature_582e4eff53768672661639ab4caa2cd31b164fcf.so"


file: /home/cfd/OpenFOAM/cfd-8/run/tutorials/incompressible/icoFoam/elbow_quad_refined_codedVelocity/1/U/boundaryField/velocity-inlet-5 from line 8843 to line 8846.

    From function void Foam::codedBase::createLibrary(Foam::dynamicCode&, const Foam::dynamicCodeContext&) const
    in file db/dynamicLibrary/codedBase/codedBase.C at line 206.

FOAM exiting

I would be grateful if someone could answer me.

rsa August 18, 2022 09:23

Hi,


maybe too late to reply but could it be that you need to remove codeOptions & codeInclude?


/R

ovozdemir January 10, 2023 03:40

I am getting same error, did anyone solve this?


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