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/)
-   -   adding lift model to twoPhaseEulerFoam (https://www.cfd-online.com/Forums/openfoam-programming-development/123630-adding-lift-model-twophaseeulerfoam.html)

mehrdad_kbg September 17, 2013 12:28

adding lift model to twoPhaseEulerFoam
 
Hi everybody,

I am trying to add new interfacial models to the twoPhaseEulerFoam solver. So, I started from lift force. I followed the drag model existing in the default solver and developed the lift model according to that. Every thing is exactly similar except the changes that I have made to implement the lift.

There was no issue when I compiled the interfacialModels library by doing wmake libso. But when I do a wmake for the solver I get the following error:

mytwoPhaseEulerFoam2.C:(.text+0x8a6b): undefined reference to `Foam::liftModel::New(Foam::dictionary const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::phaseModel const&, Foam::phaseModel const&)'
mytwoPhaseEulerFoam2.C:(.text+0x8ab9): undefined reference to `Foam::liftModel::New(Foam::dictionary const&, Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::phaseModel const&, Foam::phaseModel const&)'
collect2: ld returned 1 exit status
make: *** [/home/mehrdad/OpenFOAM/mehrdad-2.1.1/platforms/linux64GccDPOpt/bin/mytwoPhaseEulerFoam2] Error 1


Do you have any idea what can cause this error?!

Thanks.

dkxls September 17, 2013 12:53

Without having your error message further checked: Did you set you linker options correctly and included:
Code:

-L$(FOAM_USER_LIBBIN)

mehrdad_kbg September 17, 2013 13:13

The "files" and "options" in the interfacial Models folder are attached:

liftModels/liftModel/liftModel.C
liftModels/liftModel/newLiftModel.C
liftModels/Tomiyama/Tomiyama.C

dragModels/dragModel/dragModel.C
dragModels/dragModel/newDragModel.C
dragModels/WenYu/WenYu.C

LIB = $(FOAM_USER_LIBBIN)/libEulerianInterfacialModels

------------------------------------------------------------------------------------------
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I../phaseModel/lnInclude

LIB_LIBS = \
-lphaseModel

dkxls September 17, 2013 13:25

The options file of your solver?

dkxls September 17, 2013 13:28

The options file of your solver should look something like this:
Code:

EXE_LIBS = \
    -L$(FOAM_USER_LIBBIN) \
    -lEulerianInterfacialModels \
    -lfiniteVolume \
    -lmeshTools \
    -lincompressibleTransportModels \
    -lphaseModel \
    -lkineticTheoryModel


mehrdad_kbg September 17, 2013 13:34

here is my solver's option file:

EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
-IturbulenceModel \
-IinterfacialModels/lnInclude \
-IphaseModel/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-Iaveraging

EXE_LIBS = \
-L$(FOAM_USER_LIBBIN) \
-lincompressibleTransportModels \
-lphaseModel \
-lEulerianInterfacialModels \
-lfiniteVolume \
-lmeshTools

dkxls September 17, 2013 14:05

Sorry, these were just the simple guesses... Without checking in detail what goes wrong I don't have any ideas any more.

dkxls September 17, 2013 15:18

Something I just realized, you named the modified library the same as the original one.
Quote:

Originally Posted by mehrdad_kbg (Post 452248)
LIB = $(FOAM_USER_LIBBIN)/libEulerianInterfacialModels

I'm not sure if this work, at least I have never tried it to not even get into the situation of confusing them.

You could try something like:
Code:

LIB = $(FOAM_USER_LIBBIN)/libEulerianInterfacialModelsMod
and
Code:

EXE_LIBS = \
      -L$(FOAM_USER_LIBBIN) \
      -lincompressibleTransportModels \
      -lphaseModel \
      -lEulerianInterfacialModelsMod \
      -lfiniteVolume \
      -lmeshTools


mehrdad_kbg September 17, 2013 16:08

You solved my problem.

Thank you veryyyyyyyyyyyyy much.


All times are GMT -4. The time now is 02:45.