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/)
-   -   Libso - error - openfoam 11 (https://www.cfd-online.com/Forums/openfoam-programming-development/255418-libso-error-openfoam-11-a.html)

gu1 April 7, 2024 06:32

Libso - error - openfoam 11
 
Hi,

I'm using OpenFOAM 11 on Ubuntu 22.04 LTS and I'm not able to use the solver I developed. I used it safely in version 9, I made the changes to compile it successfully in version 11 but unfortunately I'm getting the following error:

Code:

~/OpenFOAM/assis-11/run/DOC$ foamRun
/*---------------------------------------------------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  11
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
Build  : 11-c219200fdb8b
Exec  : foamRun
Date  : Apr 07 2024
Time  : 07:30:48
Host  : "assis"
PID    : 6245
I/O    : uncollated
Case  : /home/assis/OpenFOAM/assis-11/run/DOC
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

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

--> FOAM Warning :
    From function void* Foam::dlOpen(const Foam::fileName&, bool)
    in file POSIX.C at line 1247
    dlopen error : /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseSystem.so: undefined symbol: _ZTIN4Foam35interfaceSaturationTemperatureModelE
--> FOAM Warning :
    From function bool Foam::dlLibraryTable::open(const Foam::fileName&, bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 106
    could not load "libphaseMomentumTransportModel.so"
Create mesh for time = 0

Selecting solver multiphaseEuler
Selecting phaseSystem basicMultiphaseSystem
No MRF models present

Selecting phaseModel for air: purePhaseModel
Selecting diameterModel for phase air: constant
Selecting thermodynamics package
{
    type            heRhoThermo;
    mixture        pureMixture;
    transport      const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}

Calculating face flux field phi.air
Selecting turbulence model type laminar
Selecting laminar stress model Stokes
Selecting thermophysical transport type laminar
Selecting default laminar thermophysical transport model unityLewisFourier
Selecting phaseModel for water: purePhaseModel
Selecting diameterModel for phase water: constant
Selecting thermodynamics package
{
    type            heRhoThermo;
    mixture        pureMixture;
    transport      const;
    thermo          hConst;
    equationOfState rhoConst;
    specie          specie;
    energy          sensibleInternalEnergy;
}

Calculating face flux field phi.water
Selecting turbulence model type LES
Selecting LES turbulence model multiphaseNicenoKE


--> FOAM FATAL ERROR:
Unknown LESModel type multiphaseNicenoKE

Valid LESModel types:

5
(
NicenoKEqn
Smagorinsky
SmagorinskyZhang
continuousGasKEqn
kEqn
)


    From function static Foam::autoPtr<Foam::LESModel<BasicMomentumTransportModel> > Foam::LESModel<BasicMomentumTransportModel>::New(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const Foam::viscosity&) [with BasicMomentumTransportModel = Foam::phaseCompressibleMomentumTransportModel; Foam::LESModel<BasicMomentumTransportModel>::alphaField = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>; Foam::LESModel<BasicMomentumTransportModel>::rhoField = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]
    in file ../momentumTransportModels/lnInclude/LESModel.C at line 176.

 FOAM exiting

controlDict:

Code:

/*--------------------------------*- C++ -*----------------------------------*\
  =========                |
  \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox
  \\    /  O peration    | Website:  https://openfoam.org
    \\  /    A nd          | Version:  11
    \\/    M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class      dictionary;
    location    "system";
    object      controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

libs (
        "libphaseMomentumTransportModel.so"
    );   
   
application      foamRun;

 solver            multiphaseEuler;


Code:

$ wmake
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file phaseMomentumTransportModel.C
g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -c phaseMomentumTransportModel.C -o Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o
g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o -L/opt/openfoam11/platforms/linux64GccDPInt32Opt/lib \
    -lphysicalProperties -lfiniteVolume -lmeshTools -lmomentumTransportModels -lphaseSystem -lsampling  -o /home/assis/OpenFOAM/assis-11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so


gu1 April 9, 2024 10:17

Can someone help me? I couldn't evolve alone.

Tobermory April 9, 2024 11:42

Well Guilherme, the error message is saying that it cannot find the LES model multiphaseNicenoKE; it gives you the list of available models in the list after the error message:

Quote:

Unknown LESModel type multiphaseNicenoKE

Valid LESModel types:

5
(
NicenoKEqn
Smagorinsky
SmagorinskyZhang
continuousGasKEqn
kEqn
)
So, assuming that models NicenoKEqn and multiphaseNicenoKE are your own user models, then I guess the real question is why is your multiphaseNicenoKE model not being recognised? Did it compile properly? I'd start there.

amirhosseintaran April 10, 2024 06:44

Hello,

Can you go to your $FOAM_USER_LIBBIN and confirm that your libphaseMomentumTransportModel.so is there or not?

Also, which version of OpenFOAM are you using?


Bests,
Amirhossein.

gu1 April 12, 2024 13:00

Quote:

Originally Posted by Tobermory (Post 867445)
Did it compile properly? I'd start there.

Exactly,
That's the question I can't answer. I put the compilation log in the previous message. For me it was a success. I don't understand what I could have done wrong.

Code:

$ wmake
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file phaseMomentumTransportModel.C
g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -c phaseMomentumTransportModel.C -o Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o
g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o -L/opt/openfoam11/platforms/linux64GccDPInt32Opt/lib \
    -lphysicalProperties -lfiniteVolume -lmeshTools -lmomentumTransportModels -lphaseSystem -lsampling  -o /home/assis/OpenFOAM/assis-11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so


gu1 April 12, 2024 13:01

Quote:

Originally Posted by amirhosseintaran (Post 867494)
Hello,

Can you go to your $FOAM_USER_LIBBIN and confirm that your libphaseMomentumTransportModel.so is there or not?

Also, which version of OpenFOAM are you using?


Bests,
Amirhossein.

Check, it's there.
I'm using OpenFOAM 11.

amirhosseintaran April 12, 2024 13:23

Do one thing, try to compile it in $FOAM_LIBBIN, and see whether it works by compiling there or not,

If it worked, it seems that the PATH to $FOAM_USER_LIBBIN is not defined properly.

gu1 April 12, 2024 18:22

Quote:

Originally Posted by amirhosseintaran (Post 867667)
Do one thing, try to compile it in $FOAM_LIBBIN, and see whether it works by compiling there or not,

If it worked, it seems that the PATH to $FOAM_USER_LIBBIN is not defined properly.

I'll try and get back to you as quickly as I can.

gu1 April 13, 2024 06:35

Quote:

Originally Posted by amirhosseintaran (Post 867667)
Do one thing, try to compile it in $FOAM_LIBBIN, and see whether it works by compiling there or not,

If it worked, it seems that the PATH to $FOAM_USER_LIBBIN is not defined properly.


For your knowledge:


Code:

assis@assis:~$ cd $FOAM_USER_LIBBIN
assis@assis:~/OpenFOAM/assis-11/platforms/linux64GccDPInt32Opt/lib$ ls
libphaseMomentumTransportModel.so

and...


file:
Code:

phaseMomentumTransportModel.C

LIB = $(FOAM_LIBBIN)/libphaseMomentumTransportModel

log:
Code:

$ wmake
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file phaseMomentumTransportModel.C
g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -c phaseMomentumTransportModel.C -o Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o
g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o -L/opt/openfoam11/platforms/linux64GccDPInt32Opt/lib \
    -lphysicalProperties -lfiniteVolume -lmeshTools -lmomentumTransportModels -lphaseSystem -lsampling  -o /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so
/usr/bin/ld.bfd: não foi possível abrir o arquivo de saída /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so: Permissão negada
collect2: error: ld returned 1 exit status
 make: *** [/opt/openfoam11/wmake/makefiles/general:181: /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so] Erro 1

ERRO :(


How can I make sure OF11 is looking at the correct folder ($FOAM_USER_LIBBIN)? Although that doesn't make ANY sense. It locates the folder correctly.

gu1 April 13, 2024 09:38

Code:

--> FOAM FATAL ERROR:
Unknown LESModel type multiphaseNicenoKE

Valid LESModel types:

5
(
NicenoKEqn
Smagorinsky
SmagorinskyZhang
continuousGasKEqn
kEqn
)


    From function static Foam::autoPtr<Foam::LESModel<BasicMomentumTransportModel> > Foam::LESModel<BasicMomentumTransportModel>::New(const alphaField&, const rhoField&, const volVectorField&, const surfaceScalarField&, const surfaceScalarField&, const Foam::viscosity&) [with BasicMomentumTransportModel = Foam::phaseCompressibleMomentumTransportModel; Foam::LESModel<BasicMomentumTransportModel>::alphaField = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>; Foam::LESModel<BasicMomentumTransportModel>::rhoField = Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>; Foam::volVectorField = Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>; Foam::surfaceScalarField = Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh>]
    in file ../momentumTransportModels/lnInclude/LESModel.C at line 176.

 FOAM exiting

Something that is bothering me is the fact that kEqn was not supposed to be cited. It is not a multiphase model...

and, OF mentions the error in line 176, but honestly I didn't see anything...

Tobermory April 20, 2024 11:29

Don't worry about the line 176 - the code exits via the call to FatalErrorInFunction in the following lines:

Code:

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown LESModel type "
            << modelType << nl << nl
            << "Valid LESModel types:" << endl
            << dictionaryConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

where line 176 is the one with the call to the FatalErrorInFuntion. So basically, the code cannot find your chosen LES model in the list of available models, hits end of table and calls the FatalErrorInFuntion, which exits cleanly with the warning message. So all fine there.

Your problem, as I understand it, is that your LES model multiphaseNicenoKE is not appearing in the list of available models, but kEqn is. So here's a thought - try remove your multiphaseNicenoKE model from the library and recompile, and now what is the list of available models? Does kEqn disappear? If so, then we are getting closer - your model has compiled, but is registered with the wrong name; try then checking your coding to see if you have a simple boo-boo (like forgetting to update the Typename to multiphaseNicenoKE).

gu1 May 1, 2024 14:59

Quote:

Originally Posted by Tobermory (Post 868011)
Don't worry about the line 176 - the code exits via the call to FatalErrorInFunction in the following lines:

Code:

    if (cstrIter == dictionaryConstructorTablePtr_->end())
    {
        FatalErrorInFunction
            << "Unknown LESModel type "
            << modelType << nl << nl
            << "Valid LESModel types:" << endl
            << dictionaryConstructorTablePtr_->sortedToc()
            << exit(FatalError);
    }

where line 176 is the one with the call to the FatalErrorInFuntion. So basically, the code cannot find your chosen LES model in the list of available models, hits end of table and calls the FatalErrorInFuntion, which exits cleanly with the warning message. So all fine there.

Your problem, as I understand it, is that your LES model multiphaseNicenoKE is not appearing in the list of available models, but kEqn is. So here's a thought - try remove your multiphaseNicenoKE model from the library and recompile, and now what is the list of available models? Does kEqn disappear? If so, then we are getting closer - your model has compiled, but is registered with the wrong name; try then checking your coding to see if you have a simple boo-boo (like forgetting to update the Typename to multiphaseNicenoKE).

I remain unsuccessful.

I reviewed all the code and nothing! It compiles and the solver don't recognize it. I even compiled OF11 from the source code, placed my solver in the LES folder (phaseCompressible/LES) and NOTHING!
It compiles without errors, but the solver don't recognize it when I try to use it. I don't know if I'll lose hope and go back to OF9. :(

I don't know if the problem is related to the way I reference the solver, through phaseCompressibleMomentumTransportModels.C
However, I can't see a way out.

dlahaye May 2, 2024 01:27

Bom dia!

The linker tells you that

Code:

g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o -L/opt/openfoam11/platforms/linux64GccDPInt32Opt/lib \
    -lphysicalProperties -lfiniteVolume -lmeshTools -lmomentumTransportModels -lphaseSystem -lsampling  -o /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so
/usr/bin/ld.bfd: não foi possível abrir o arquivo de saída /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so: Permissão negada
collect2: error: ld returned 1 exit status
 make: *** [/opt/openfoam11/wmake/makefiles/general:181: /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so] Erro 1

Are you trying to overwrite the OpenFoam installation for which you do not have the permission?

Should you copy the library file momentumTransportModels to a working directory that you can savily write to?

gu1 May 2, 2024 05:53

Quote:

Originally Posted by dlahaye (Post 868625)
Bom dia!

The linker tells you that

Code:

g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o -L/opt/openfoam11/platforms/linux64GccDPInt32Opt/lib \
    -lphysicalProperties -lfiniteVolume -lmeshTools -lmomentumTransportModels -lphaseSystem -lsampling  -o /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so
/usr/bin/ld.bfd: não foi possível abrir o arquivo de saída /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so: Permissão negada
collect2: error: ld returned 1 exit status
 make: *** [/opt/openfoam11/wmake/makefiles/general:181: /opt/openfoam11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so] Erro 1

Are you trying to overwrite the OpenFoam installation for which you do not have the permission?

Should you copy the library file momentumTransportModels to a working directory that you can savily write to?


Hi,

The software output is below:

Code:

$ wmake
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file phaseMomentumTransportModel.C
g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -c phaseMomentumTransportModel.C -o Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o
g++ -std=c++14 -m64 -DLIB_NAME=libphaseMomentumTransportModel.so -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam11/src/physicalProperties/lnInclude -I/opt/openfoam11/src/finiteVolume/lnInclude -I/opt/openfoam11/src/meshTools/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam11/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/phaseSystems/lnInclude -I/opt/openfoam11/src/twoPhaseModels/compressibleTwoPhases/lnInclude -I/opt/openfoam11/src/twoPhaseModels/twoPhaseMixture/lnInclude -I/opt/openfoam11/src/../applications/modules/multiphaseEuler/interfacialModels/lnInclude -I/opt/openfoam11/src/sampling/lnInclude -I/opt/openfoam11/src/thermophysicalModels/basic/lnInclude -IlnInclude -I. -I/opt/openfoam11/src/OpenFOAM/lnInclude -I/opt/openfoam11/src/OSspecific/POSIX/lnInclude  -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/phaseMomentumTransportModel.o -L/opt/openfoam11/platforms/linux64GccDPInt32Opt/lib \
    -lphysicalProperties -lfiniteVolume -lmeshTools -lmomentumTransportModels -lphaseSystem -lsampling  -o /home/assis/OpenFOAM/assis-11/platforms/linux64GccDPInt32Opt/lib/libphaseMomentumTransportModel.so

This output you showed was an attempt suggested by the forum.

Now, in a second moment, I compiled OF11 from the source code and redid the process of compiling my solver in the conventional way. As I said, it compiles but is not recognized by OF. In a second attempt, I took my code and threw it into the OF folder (now, inside the original software), it compiled, but it also remains unrecognized.

dlahaye May 2, 2024 07:01

I understand.

Question: are you sure that the solver you use links with there library that you modify? You are using multiphaseEuler, correct? Can you provide us with the output of

Code:

which multiphaseEuler
and subsequently

Code:

ldd <openfoam-bin-dir>/multiphaseEuler
Thx.

gu1 May 2, 2024 07:09

Quote:

Originally Posted by dlahaye (Post 868643)
I understand.

Question: are you sure that the solver you use links with there library that you modify? You are using multiphaseEuler, correct? Can you provide us with the output of

Code:

which multiphaseEuler
and subsequently

Code:

ldd <openfoam-bin-dir>/multiphaseEuler
Thx.

I am not sure,

I will do what you asked and post the result here as soon as possible.

gu1 May 2, 2024 08:49

Hi,


Code:

which multiphaseEuler
Nothing heappen.


Code:

ldd <openfoam-bin-dir>/multiphaseEuler

log:
Code:

assis@assis:~/OpenFOAM/assis-11/run/DOC$ which multiphaseEuler
assis@assis:~/OpenFOAM/assis-11/run/DOC$ ldd <openfoam-bin-dir>/multiphaseEuler
bash: openfoam-bin-dir: Nonexistent file or directory


Was this really what I should be looking for?

dlahaye May 2, 2024 08:54

1/ what solver are you currently using?

2/ where is the executable of that solver located?

3/ which library does this executable require?

gu1 May 2, 2024 09:16

Hi,

Quote:

Originally Posted by dlahaye (Post 868650)
1/ what solver are you currently using?

I'm using multiphaseEuler. The turbulence model I developed. I was able to use this without any problems in version 9 (it is based on the NicenoKEqn model).

Quote:

Originally Posted by dlahaye (Post 868650)
2/ where is the executable of that solver located?

I don't know if I understood the question well, but I created a folder inside $FOAM_RUN and compiled it.

Quote:

Originally Posted by dlahaye (Post 868650)
3/ which library does this executable require?

I can't say specifically which ones it requires, but as I said, they are the same ones required by NicenoKEqn.

dlahaye May 2, 2024 11:29

It is hard for me to judge for me from a distance what is going on.

OpenFoam works with shared libraries https://en.wikipedia.org/wiki/Shared_library

It us therefore perfectly possible that the library compiles fine, but the executable (the solver) does not pick up the changes, simply because the solver continues to pick up the old (outdated, unmodified) libraries. This (in my very limited understanding) describe the scenario above.

My above suggestion is to find the executable, and to check which libraries are used to build the executable (the solver). The unix command ldd https://en.wikipedia.org/wiki/Ldd_(Unix) does precisely this.

An alternative approach might be to write a C++ program hello-world with a hello-master function in a library file. Not sure how this helps you (in case at all)?

Keep writing us here.

Good luck.


All times are GMT -4. The time now is 14:36.