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/)
-   -   Failed wmake when using scalaCodedSource in fvOptions (https://www.cfd-online.com/Forums/openfoam-programming-development/229455-failed-wmake-when-using-scalacodedsource-fvoptions.html)

napattorn August 10, 2020 04:18

Failed wmake when using scalaCodedSource in fvOptions
 
Hi all,

I am currently struggling with setting up coded source via fvOptions. I have looked at previous discussions on this forum about this and used them as guideline, for instance, in creating the following momentum source term:

Code:

momentumSource
{
    type            vectorCodedSource;
    active          on;
    name    sourceTime;   
    vectorCodedSourceCoeffs
    {
    fields  (U);

    selectionMode  all

    redirectType  sourceTime;
   
    codeInclude
    #{

    #};
       
    codeCorrect
    #{
        Pout<< "**codeCorrect**" << endl;
    #};
   
        codeAddSup
    #{
        const scalarField& V = mesh_.V();
        vectorField& USource = eqn.source();
        USource += (100 1 1)*V; // Definition of the user-defined momentum source term
    #};
       
    codeSetValue
    #{
        Pout<< "**codeSetValue**" << endl;
    #};
       
    // Dummy entry. Make dependent on above to trigger recompilation
    code
    #{
        $codeInclude
        $codeCorrect
        $codeAddSup
        $codeSetValue
    #};
    }
   
    sourceTimeCoeffs
    {
    // Dummy entry
    }
 
}

However, when I run the simulation, the following error message pops up:

Code:

Invoking "wmake -s libso /home/user/CFDEM/user-PUBLIC-5.x/run/Original/CFD/dynamicCode/heatSink"
sh: 1: Syntax error: "(" unexpected
[0]
[0]
[0] --> FOAM FATAL IO ERROR:
[0] Failed wmake "dynamicCode/heatSink/platforms/linux64GccDPInt32Opt/lib/libheatSink_7946a6c1177d969821ce64c8d265d148e8176c3e.so"
[0]
[0]
[0] file: /home/user/CFDEM/user-PUBLIC-5.x/run/Original//CFD/constant/scalarTransportProperties.generalManualProps.fvOptionsT.scalarCodedSourceCoeffs from line 67 to line 101.
[0]
[0]    From function void Foam::codedBase::createLibrary(Foam::dynamicCode&, const Foam::dynamicCodeContext&) const
[0]    in file db/dynamicLibrary/codedBase/codedBase.C at line 206.
[0]
FOAM parallel run exiting
[0]

I also counter this error when I create similar field for scalarCodedSource. I looked up this error online but none seems relevant to my case.

Could any experienced users provide insights into this issue?

Thank you very much.

PS. I'm running a CFD-DEM simulation using CFDEM project - I'm not sure if this has anything to do with the error, but from my understanding fvOptions is initiated independent of the coupling.


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