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

How to add a new multiphase solver for multiphaseEulerFoam? error

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By gu1

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 24, 2023, 12:49
Default How to add a new multiphase solver for multiphaseEulerFoam? error
  #1
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Hello,

I'm having difficulties implementing a new turbulence model in OpenFOAM 9. I want to solve a study of the injection of air bubbles in water columns (bubbleColumn tutorial) using the multiphaseEulerFoam solver.

error:

Code:
wmake libso .
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file phaseDESCompressibleMomentumTransportModels.C
g++ -std=c++14 -m64 -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/openfoam9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam9/src/transportModels/lnInclude -I/opt/openfoam9/src/finiteVolume/lnInclude -I/opt/openfoam9/src/meshTools/lnInclude -I/opt/openfoam9/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam9/src/../applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/lnInclude -I/opt/openfoam9/src/../applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/lnInclude -IlnInclude -I. -I/opt/openfoam9/src/OpenFOAM/lnInclude -I/opt/openfoam9/src/OSspecific/POSIX/lnInclude   -fPIC -c phaseDESCompressibleMomentumTransportModels.C -o Make/linux64GccDPInt32Opt/phaseDESCompressibleMomentumTransportModels.o
phaseDESCompressibleMomentumTransportModels.C:31:1: error: expected constructor, destructor, or type conversion before ‘(’ token
   31 | (
      | ^
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:78:20: error: expected template-name before ‘<’ token
   78 |     public kEpsilon<BasicMomentumTransportModel>
      |                    ^
continuousGasKEDES.H:78:20: error: expected ‘{’ before ‘<’ token
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:45:11: error: ‘alphaField’ does not name a type; did you mean ‘addField’?
   45 |     const alphaField& alpha,
      |           ^~~~~~~~~~
      |           addField
continuousGasKEDES.C:46:11: error: ‘rhoField’ does not name a type
   46 |     const rhoField& rho,
      |           ^~~~~~~~
continuousGasKEDES.C:50:11: error: ‘transportModel’ does not name a type
   50 |     const transportModel& transport,
      |           ^~~~~~~~~~~~~~
continuousGasKEDES.C:52:1: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   52 | )
      | ^
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:100:60: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  100 | bool continuousGasKEDES<BasicMomentumTransportModel>::read()
      |                                                            ^
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:116:66: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  116 | void continuousGasKEDES<BasicMomentumTransportModel>::correctNut()
      |                                                                  ^
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:152:69: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  152 | continuousGasKEDES<BasicMomentumTransportModel>::liquidTurbulence() const
      |                                                                     ^~~~~
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:179:58: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  179 | continuousGasKEDES<BasicMomentumTransportModel>::nuEff() const
      |                                                          ^~~~~
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:206:59: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  206 | continuousGasKEDES<BasicMomentumTransportModel>::rhoEff() const
      |                                                           ^~~~~
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:225:71: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  225 | continuousGasKEDES<BasicMomentumTransportModel>::phaseTransferCoeff() const
      |                                                                       ^~~~~
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:248:60: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  248 | continuousGasKEDES<BasicMomentumTransportModel>::kSource() const
      |                                                            ^~~~~
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:261:66: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  261 | continuousGasKEDES<BasicMomentumTransportModel>::epsilonSource() const
      |                                                                  ^~~~~
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
In file included from continuousGasKEDES.H:171,
                 from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.C:274:58: error: invalid use of incomplete type ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
  274 | continuousGasKEDES<BasicMomentumTransportModel>::sigma() const
      |                                                          ^~~~~
In file included from phaseDESCompressibleMomentumTransportModels.C:43:
continuousGasKEDES.H:76:7: note: declaration of ‘class Foam::LESModels::continuousGasKEDES<BasicMomentumTransportModel>’
   76 | class continuousGasKEDES
      |       ^~~~~~~~~~~~~~~~~~
phaseDESCompressibleMomentumTransportModels.C:44:13: error: expected constructor, destructor, or type conversion before ‘(’ token
   44 | makeLESModel(continuousGasKEDES);
      |             ^
make: *** [/opt/openfoam9/wmake/rules/General/transform:26: Make/linux64GccDPInt32Opt/phaseDESCompressibleMomentumTransportModels.o] Erro 1
I have attached the files I am trying to compile.

options file:
Code:
EXE_INC = \
    -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
    -I$(LIB_SRC)/transportModels/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/../applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/lnInclude \
    -I$(LIB_SRC)/../applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/lnInclude

LIB_LIBS = \
    -libphaseSystem \
    -leulerianInterfacialCompositionModels \
    -lfluidThermophysicalModels \
    -ltransportModels \
    -lfiniteVolume \
    -lmeshTools
files file:
Code:
phaseDESCompressibleMomentumTransportModels.C

LIB = $(FOAM_USER_LIBBIN)/libphaseDESCompressibleMomentumTransportModels
If anyone can help I would be very grateful.

THANKS!
Attached Files
File Type: c continuousGasKEDES.C (7.8 KB, 4 views)
File Type: h continuousGasKEDES.H (5.1 KB, 3 views)
File Type: c phaseDESCompressibleMomentumTransportModels.C (1.8 KB, 4 views)

Last edited by gu1; June 25, 2023 at 10:40.
gu1 is offline   Reply With Quote

Old   June 26, 2023, 14:19
Default
  #2
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Can someone help me? Please

Last edited by gu1; July 4, 2023 at 07:21.
gu1 is offline   Reply With Quote

Old   July 13, 2023, 08:28
Default
  #3
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
I couldn't progress in my studies, can someone help me?
gu1 is offline   Reply With Quote

Old   July 15, 2023, 07:19
Default
  #4
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 745
Rep Power: 14
Tobermory will become famous soon enough
Guilherme - you didn't include the PhaseCompressibleMomentumTransportModel.H file ... check that you're not missing a brace or semicolon at the end of this file ... or that you don't have too may braces. That will sometimes make the compiler throw a fit about the following text.
Tobermory is offline   Reply With Quote

Old   September 23, 2023, 16:15
Default
  #5
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Hi,

Thanks for your reply.

I managed to improve with your advice, but I still can't compile the turbulence model.

Code:
$ wmake
wmakeLnIncludeAll: running wmakeLnInclude on dependent libraries:
    wmakeLnInclude error: base directory ../momentumTransportModels/ does not exist
    wmakeLnInclude error: base directory ../compressible/ does not exist
wmakeLnInclude: linking include files to ./lnInclude
Making dependency list for source file phaseDESMomentumTransportModel.C
g++ -std=c++14 -m64 -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../momentumTransportModels/lnInclude -I../compressible/lnInclude -I/opt/openfoam9/src/transportModels/lnInclude -I/opt/openfoam9/src/finiteVolume/lnInclude -I/opt/openfoam9/src/meshTools/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam9/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/lnInclude -I/opt/openfoam9/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam9/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/lnInclude -IlnInclude -I. -I/opt/openfoam9/src/OpenFOAM/lnInclude -I/opt/openfoam9/src/OSspecific/POSIX/lnInclude   -fPIC -c phaseDESMomentumTransportModel.C -o Make/linux64GccDPInt32Opt/phaseDESMomentumTransportModel.o
g++ -std=c++14 -m64 -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../momentumTransportModels/lnInclude -I../compressible/lnInclude -I/opt/openfoam9/src/transportModels/lnInclude -I/opt/openfoam9/src/finiteVolume/lnInclude -I/opt/openfoam9/src/meshTools/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/phaseCompressible/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/momentumTransportModels/lnInclude -I/opt/openfoam9/src/MomentumTransportModels/compressible/lnInclude -I/opt/openfoam9/applications/solvers/multiphase/multiphaseEulerFoam/phaseSystems/lnInclude -I/opt/openfoam9/src/thermophysicalModels/basic/lnInclude -I/opt/openfoam9/applications/solvers/multiphase/multiphaseEulerFoam/interfacialModels/lnInclude -IlnInclude -I. -I/opt/openfoam9/src/OpenFOAM/lnInclude -I/opt/openfoam9/src/OSspecific/POSIX/lnInclude   -fPIC -fuse-ld=bfd -shared -Xlinker --add-needed -Xlinker --no-as-needed Make/linux64GccDPInt32Opt/phaseDESMomentumTransportModel.o -L/opt/openfoam9/platforms/linux64GccDPInt32Opt/lib \
    -ltransportModels -lfiniteVolume -lmeshTools -libphaseCompressibleMomentumTransportModels -libmomentumTransportModels -libcompressibleMomentumTransportModels -libphaseSystem -libfluidThermophysicalModels -libeulerianInterfacialModels  -o /home/assis/OpenFOAM/assis-9/platforms/linux64GccDPInt32Opt/lib/libhaseDESMomentumTransportModel.so
/usr/bin/ld.bfd: cannot find -libphaseCompressibleMomentumTransportModels
/usr/bin/ld.bfd: cannot find -libmomentumTransportModels
/usr/bin/ld.bfd: cannot find -libcompressibleMomentumTransportModels
/usr/bin/ld.bfd: cannot find -libphaseSystem
/usr/bin/ld.bfd: cannot find -libfluidThermophysicalModels
/usr/bin/ld.bfd: cannot find -libeulerianInterfacialModels
collect2: error: ld returned 1 exit status
make: *** [/opt/openfoam9/wmake/makefiles/general:181: /home/assis/OpenFOAM/assis-9/platforms/linux64GccDPInt32Opt/lib/libhaseDESMomentumTransportModel.so] Erro 1
OpenFOAM didn't explain what the error was and curiously, it doesn't make sense that it couldn't find the files. I made the correct reference.

Code:
EXE_INC = \
    -I../momentumTransportModels/lnInclude \
    -I../compressible/lnInclude \
    -I$(LIB_SRC)/transportModels/lnInclude \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/phaseCompressible/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/momentumTransportModels/lnInclude \
    -I$(LIB_SRC)/MomentumTransportModels/compressible/lnInclude \
    -I$(FOAM_APP)/solvers/multiphase/multiphaseEulerFoam/phaseSystems/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(FOAM_APP)/solvers/multiphase/multiphaseEulerFoam/interfacialModels/lnInclude

LIB_LIBS = \
    -ltransportModels \
    -lfiniteVolume \
    -lmeshTools \
    -libphaseCompressibleMomentumTransportModels \
    -libmomentumTransportModels \
    -libcompressibleMomentumTransportModels \
    -libphaseSystem \
    -libfluidThermophysicalModels \
    -libeulerianInterfacialModels
Would you mind helping me?
gu1 is offline   Reply With Quote

Old   September 23, 2023, 19:04
Default
  #6
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Problem solved.

All you had to do was change from "lib..." to "l..."

Code:
LIB_LIBS = \
    -ltransportModels \
    -lfiniteVolume \
    -lmeshTools \
    -lphaseCompressibleMomentumTransportModels \
    -lmomentumTransportModels \
    -lcompressibleMomentumTransportModels \
    -lphaseSystem \
    -lfluidThermophysicalModels \
    -leulerianInterfacialModels
Tobermory likes this.
gu1 is offline   Reply With Quote

Reply

Tags
multiphase, multiphaseeulerfoam, openfoam9, programming


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
[blockMesh] blockMesh with double grading. spwater OpenFOAM Meshing & Mesh Conversion 92 January 12, 2019 10:00
Compile calcMassFlowC aurore OpenFOAM Programming & Development 13 March 23, 2018 08:43
Mesquite - Adaptive mesh refinement / coarsening? philippose OpenFOAM Running, Solving & CFD 94 January 27, 2016 10:40
Compiling dynamicTopoFvMesh for OpenFOAM 2.1.x Saxwax OpenFOAM Installation 25 November 29, 2013 06:34
How to get the max value of the whole field waynezw0618 OpenFOAM Running, Solving & CFD 4 June 17, 2008 06:07


All times are GMT -4. The time now is 11:20.