CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Compilation error with custom boundary condition

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 15, 2023, 04:21
Default Compilation error with custom boundary condition
  #1
New Member
 
Wilhelm Furian
Join Date: Apr 2023
Location: Berlin
Posts: 16
Rep Power: 3
Florian Mlehliw is on a distinguished road
Hello all!

I'm trying to write a custom boundary condition for U, but before I can get to the programming part I just tried to compile the dynamicCode folder and the following errors show and not all files get generated.

I've looked at other questions regarding this, but most of them seem to be related to a malfunctioning make-package, which seems to be working in my case. I guess the *** recipe commences before first target. Stop. is a clue, but I don't know how to fix it because I did not alter any Make file.
I got the code for the codedFixedValue from one of Tobis tutorials for OpenFoam 8, maybe it has to be adapted for v2112?

Any ideas on what I am missing?
Thank you very much!

Code:
interFoam
/*---------------------------------------------------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2112                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
Build  : _14aeaf8dab-20211220 OPENFOAM=2112 version=v2112
Arch   : "LSB;label=32;scalar=64"
Exec   : interFoam
Date   : Sep 15 2023
Time   : 09:39:22
Host   : login.cirrus
PID    : 4184221
I/O    : uncollated
Case   : ***/OpenFOAM/testCases/DynamicMesh_activeBaffleVelocity
nProcs : 1
trapFpe: Floating point exception trapping enabled (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 5, maxFileModificationPolls 20)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0


PIMPLE: Operating solver in PISO mode

Reading field p_rgh

Reading field U

Using dynamicCode for patch blockedDamBaffle on field U at line 62 in "/***/OpenFOAM/testCases/DynamicMesh_activeBaffleVelocity/0/U.boundaryField.blockedDamBaffle"
Could not load "/***/OpenFOAM/testCases/DynamicMesh_activeBaffleVelocity/dynamicCode/platforms/linux64IccDPInt32Opt/lib/libmyActiveBaffle_0fb4b9e64f0c755f920dca3b607e39455a768a92.so"
/***/OpenFOAM/testCases/DynamicMesh_activeBaffleVelocity/dynamicCode/platforms/linux64IccDPInt32Opt/lib/libmyActiveBaffle_0fb4b9e64f0c755f920dca3b607e39455a768a92.so: cannot open shared object file: No such file or directory
Creating new library in "dynamicCode/myActiveBaffle/platforms/linux64IccDPInt32Opt/lib/libmyActiveBaffle_0fb4b9e64f0c755f920dca3b607e39455a768a92.so"
Invoking wmake libso /***/OpenFOAM/testCases/DynamicMesh_activeBaffleVelocity/dynamicCode/myActiveBaffle
wmake libso /***/OpenFOAM/testCases/DynamicMesh_activeBaffleVelocity/dynamicCode/myActiveBaffle
Make/linux64IccDPInt32Opt/options:65: *** recipe commences before first target.  Stop.
Make/linux64IccDPInt32Opt/options:65: *** recipe commences before first target.  Stop.
wmake error: file 'Make/linux64IccDPInt32Opt/sourceFiles' could not be created in /***/OpenFOAM/testCases/DynamicMesh_activeBaffleVelocity/dynamicCode/myActiveBaffle


--> FOAM FATAL IO ERROR: (openfoam-2112)
Failed wmake "dynamicCode/myActiveBaffle/platforms/linux64IccDPInt32Opt/lib/libmyActiveBaffle_0fb4b9e64f0c755f920dca3b607e39455a768a92.so"


file: 0/U.boundaryField.blockedDamBaffle at line 62 to 86.

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

FOAM exiting
This is what gets generated, but there should be much more files, if I understood correctly:
Code:
tree dynamicCode/
dynamicCode/
└── myActiveBaffle
    ├── fixedValueFvPatchFieldTemplate.C
    ├── fixedValueFvPatchFieldTemplate.H
    └── Make
        ├── files
        ├── linux64IccDPInt32Opt
        │   └── options
        ├── options
        └── SHA1Digest
My U file looks as follows:
Code:
blockedDamBaffle
    {
        type             codedFixedValue;
        value            $internalField;
        
        name            myActiveBaffle;        
        
        code
        #{
            // These lines give us access to mesh and field information in the patch.
            const fvPatch& boundaryPatch = patch();            
            const vectorField& Cf = boundaryPatch.Cf();        
            
            vectorField& field = *this;                    
            
            //Here would be the code.
            
        #};
        
        codeOptions
        #{
            // Compilation options
            -I$(LIB_SRC)/finiteVolume/lnInclude \
            -I$(LIB_SRC)/meshTools/lnInclude    
        #};
        
        codeInclude
        #{
            // Files needed for compilation
            #include "fvCFD.H"
            #include <cmath>
            #include <iostream>
            #include "activeBaffleVelocityFvPatchVectorField.H"
            #include "addToRunTimeSelectionTable.H"
            #include "volFields.H"
            #include "surfaceFields.H"
            #include "cyclicFvPatch.H"
        #};
    }
Florian Mlehliw is offline   Reply With Quote

Old   September 23, 2023, 23:44
Default
  #2
Member
 
Amirhossein Taran
Join Date: Sep 2016
Location: Dublin, Ireland
Posts: 50
Rep Power: 9
amirhosseintaran is on a distinguished road
Hello,

It sounds like a weird error, just one question, do you have writing permissions in this directory?

Quote:
/***/OpenFOAM/testCases/DynamicMesh_activeBaffleVelocity/dynamicCode/myActiveBaffle
amirhosseintaran is offline   Reply With Quote

Reply

Tags
compilation error, custom boundary condition, openfoam2112

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Constant mass flow rate boundary condition sahm OpenFOAM 0 June 20, 2018 22:45
Question about adaptive timestepping Guille1811 CFX 25 November 12, 2017 17:38
Centrifugal fan-reverse flow in outlet lesds to a mass in flow field xiexing CFX 3 March 29, 2017 10:00
Basic Nozzle-Expander Design karmavatar CFX 20 March 20, 2016 08:44
Question about heat transfer coefficient setting for CFX Anna Tian CFX 1 June 16, 2013 06:28


All times are GMT -4. The time now is 07:46.