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

Adding a new drag force to icoUncoupledKinematicParcelFoam

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 1 Post By Jan_B
  • 1 Post By DustExplosion

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 9, 2015, 13:32
Default Adding a new drag force to icoUncoupledKinematicParcelFoam
  #1
New Member
 
Jan Bartel
Join Date: Jul 2015
Location: Germany
Posts: 5
Rep Power: 11
Jan_B is on a distinguished road
Hey everyone,
I am pretty new to CFD and OF and got stuck right now.

I am trying to implement a new drag force to the Solver icoUncoupledKinematicParcelFoam in OF 2.3.1.

Therefore I followed the step by step guide for SpraySubModels in the openfoamwiki:
http://openfoamwiki.net/index.php/Ho...SpraySubModels

The only difference is, that I cannot compile in the original OF Folder. Thus I copied the Folder OF/src/lagrangian/intermediate and compiled it with "wmake libso" as a user library with "LIB = $(FOAM_USER_LIBBIN)/libmylagrangianIntermediate" in make/files on its own.

In my next step I compiled an own solver based on icoUncoupledKinematicParcelFoam and named it "myParcelFoam". in make/options I changed the links, that relate to the standard "intermediate"-library to my own one.

However when Using this solver I encount the following error:

Quote:
Reading g

Reading transportProperties

Reading field U

Reading/calculating face flux field phi

Selecting incompressible transport model Newtonian
Selecting turbulence model type RASModel
Selecting RAS turbulence model kOmegaSST
kOmegaSSTCoeffs
{
alphaK1 0.85;
alphaK2 1;
alphaOmega1 0.5;
alphaOmega2 0.856;
gamma1 0.555556;
gamma2 0.44;
beta1 0.075;
beta2 0.0828;
betaStar 0.09;
a1 0.31;
b1 1;
c1 10;
F3 false;
}

Constructing kinematicCloud kinematicCloud
Constructing particle forces
Selecting particle force sphereDrag
Selecting particle force electric


--> FOAM FATAL ERROR:
Unknown particle force type electric, constructor not in hash table

Valid particle force types are:

13
(
ErgunWenYuDrag
PlessisMasliyahDrag
SRF
SaffmanMeiLiftForce
TomiyamaLift
WenYuDrag
gravity
nonInertialFrame
nonSphereDrag
paramagnetic
pressureGradient
sphereDrag
virtualMass
)


From function ParticleForce<CloudType>::New(CloudType&, const fvMesh&, const dictionary&)
in file lagrangian/intermediate/lnInclude/ParticleForceNew.C at line 55.

FOAM exiting
By changing the TypeName of an already implemented drag force (submodels/Kinematic/ParticleForces/Drag/SphereDrag) I got the result, that the solver isn't using the submodels of my library at all, since the Typenames listed in the report dont change when I change the ones in the library.

However, since I already implemented an additional parcel property in parcels/Templates/KinematicParcel and could see those by running the solver without my own submodel, I am pretty sure, that i included the library to the solver the right way.


Am I Missing something out? I just don't get, why the addition in KinematicParcel was successful, but the submodels aren't.
Jan_B is offline   Reply With Quote

Old   July 10, 2015, 09:44
Default
  #2
Member
 
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12
a.weber is on a distinguished road
did you also change /intermediate/parcels/include/makeParcelForces.H?
There you'll have to add your own force model as well.
a.weber is offline   Reply With Quote

Old   July 10, 2015, 10:16
Default
  #3
New Member
 
Jan Bartel
Join Date: Jul 2015
Location: Germany
Posts: 5
Rep Power: 11
Jan_B is on a distinguished road
Hey a.weber, thx for the reply!

I did add it to makeParcelForces.H.

But I found out, I did not link the Library the right way. Now the make/options file of the solver looks like this:

Quote:
EXE_INC = \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-Ilagrangian/intermediate/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
-I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/regionModels/regionModel/lnInclude \
-I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude

EXE_LIBS = \
-llagrangian \
-L$(FOAM_USER_LIBBIN) \
-lmylagrangianIntermediate \
-llagrangianTurbulence \
-lthermophysicalFunctions \
-lfluidThermophysicalModels \
-lspecie \
-lradiationModels \
-lincompressibleRASModels \
-lincompressibleLESModels \
-lincompressibleTransportModels \
-lfiniteVolume \
-lmeshTools \
-lregionModels \
-lsurfaceFilmModels


So i forgot to add the library name (-lmylagrangianIntermediate \) AND the path (-L$(FOAM_USER_LIBBIN) \) to EXE_LIBS.
In fact I substituted the entries for the intermediate part of the solver compared to the standard solver.

Now by running the solver, it recognizes my own new drag force, but i get several Warnings for having duplicate entries. Also changes in the existing forces don't show in the results. One section of the Report I get by running the Solver is listed here:

Quote:
#1 /home/bartel/OpenFOAM/bartel-2.3.1/platforms/linux64GccDPOpt/lib/libmylagrangianIntermediate.so(_ZN4Foam14Injection ModelINS_14KinematicCloudINS_5CloudINS_11MPPICParc elINS_15KinematicParcelINS_8particleEEEEEEEEEE31ad ddictionaryConstructorToTableINS_23FieldActivatedI njectionIS9_EEEC2ERKNS_4wordE+0xce) [0x7f01c75767de]
#2 /home/bartel/OpenFOAM/bartel-2.3.1/platforms/linux64GccDPOpt/lib/libmylagrangianIntermediate.so(+0x2029b1) [0x7f01c73d69b1]
#3 /lib64/ld-linux-x86-64.so.2(+0x1013a) [0x7f01c7afc13a]
#4 /lib64/ld-linux-x86-64.so.2(+0x10223) [0x7f01c7afc223]
#5 /lib64/ld-linux-x86-64.so.2(+0x130a) [0x7f01c7aed30a]
Duplicate entry inflationInjection in runtime selection table InjectionModel
So I guess the Solver is reading the entries for intermediate from my own library and the standard one, though I substituted the standard one with my own one.

My question would be, how I can keep OF from reading the intermediate part of the standard library and depend only on my own one. As you can see, I already deleted the standard one from make/options.
Jan_B is offline   Reply With Quote

Old   July 13, 2015, 02:36
Default
  #4
Member
 
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12
a.weber is on a distinguished road
I also added several force models. My "options" look like this:
Code:
EXE_INC = \
    -I$(FOAM_APP)/solvers/lagrangian/reactingParcelFoam \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I${LIB_SRC}/meshTools/lnInclude \
    -I${LIB_SRC}/sampling/lnInclude \
    -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
    -I$(LIB_SRC)/lagrangian/basic/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/lagrangian/intermediate/lnInclude \
    -I$(WM_PROJECT_USER_DIR)/src/lagrangian/spray/lnInclude \
    -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
    -I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
    -I$(LIB_SRC)/ODE/lnInclude \
    -I$(LIB_SRC)/regionModels/regionModel/lnInclude \
    -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \
    -I$(LIB_SRC)/fvOptions/lnInclude \
    -I$(LIB_SRC)/combustionModels/lnInclude


EXE_LIBS = \
    -lfiniteVolume \
    -lmeshTools \
    -lsampling \
    -lcompressibleTurbulenceModel \
    -lcompressibleRASModels \
    -lcompressibleLESModels \
    -llagrangian \
    -llagrangianIntermediate \
    -llagrangianTurbulence \
    -llagrangianSpray \
    -lspecie \
    -lfluidThermophysicalModels \
    -lliquidProperties \
    -lliquidMixtureProperties \
    -lsolidProperties \
    -lsolidMixtureProperties \
    -lthermophysicalFunctions \
    -lreactionThermophysicalModels \
    -lSLGThermo \
    -lchemistryModel \
    -lradiationModels \
    -lODE \
    -lregionModels \
    -lsurfaceFilmModels \
    -lfvOptions \
    -lcombustionModels
As you see, I added my own intermediate and spray library. I didnt change the name of them and it works great.
a.weber is offline   Reply With Quote

Old   July 15, 2015, 09:40
Default
  #5
New Member
 
Jan Bartel
Join Date: Jul 2015
Location: Germany
Posts: 5
Rep Power: 11
Jan_B is on a distinguished road
Not changing the library names did the trick for me, thanks a lot!
As a note I still had to add "-L$(FOAM_USER_LIBBIN) " in the options file, since the solver else loaded the original lbrary and didn't recognize my added forces.
elomri likes this.
Jan_B is offline   Reply With Quote

Old   November 29, 2016, 16:01
Default
  #6
Member
 
Chris Cloney
Join Date: Jun 2016
Location: Halifax, Canada
Posts: 62
Rep Power: 10
DustExplosion is on a distinguished road
One note on this.

Keeping the names the same worked for me as well (got rid of the warnings), but I think it masks a potentially bad problem if you are not careful.

In my case I am compiling the intermediate and coalCombustion libraries under lagrange.

However, I did the approach outlined here with each but realized that coalCombustion also includes the intermediate library.

Therefore my code worked happily although the solver was linked to my version of the intermediate libraries while coalCombustion was linked to the original OF version.

It doesn't matter for me as I am just putting in debug statements, but keep this in mind if you put something more substantial in. It is probably best in this case to rename the directory and search and replace any other files that are linking against that library.
qiang92 likes this.
DustExplosion is offline   Reply With Quote

Old   September 17, 2017, 00:15
Default
  #7
New Member
 
Fengli Shen
Join Date: Dec 2016
Posts: 7
Rep Power: 9
qiang92 is on a distinguished road
Quote:
Originally Posted by DustExplosion View Post
One note on this.

Keeping the names the same worked for me as well (got rid of the warnings), but I think it masks a potentially bad problem if you are not careful.

In my case I am compiling the intermediate and coalCombustion libraries under lagrange.

However, I did the approach outlined here with each but realized that coalCombustion also includes the intermediate library.

Therefore my code worked happily although the solver was linked to my version of the intermediate libraries while coalCombustion was linked to the original OF version.

It doesn't matter for me as I am just putting in debug statements, but keep this in mind if you put something more substantial in. It is probably best in this case to rename the directory and search and replace any other files that are linking against that library.
Thank for solving my doubt
qiang92 is offline   Reply With Quote

Old   March 20, 2018, 10:31
Default similar problem
  #8
New Member
 
Join Date: Nov 2017
Location: Germany
Posts: 11
Rep Power: 9
elomri is on a distinguished road
I have a similar problem with icoUncoupledKinematicParcelFoam.. The solver does not recognize the changes i included in a model included in the lagrangian/intermediate library and still solves with the old formula.

the library as well as the solver were compiled successfully after each modification but still i get exactly the same results with both formulas.

Any ideas why ?
elomri is offline   Reply With Quote

Old   March 21, 2018, 11:45
Default
  #9
Member
 
Chris Cloney
Join Date: Jun 2016
Location: Halifax, Canada
Posts: 62
Rep Power: 10
DustExplosion is on a distinguished road
Not sure. The first step would be to put a print statement directly before the code you are trying to run. Copy a line that is printed to the console and put it right before (with modified text). Run the simulation and check that the print statement is being hit at runtime. If it is then you must be using the incorrect variables or something in you new code - hope that helps!
DustExplosion is offline   Reply With Quote

Old   March 23, 2018, 06:09
Default
  #10
New Member
 
Join Date: Nov 2017
Location: Germany
Posts: 11
Rep Power: 9
elomri is on a distinguished road
Thanks Chris for the answer.
I did something similar which is changing the variable names within the library. But the solver still uses the old variable names.

This is the case even when i clear the whole platform and recompile every single library in src.

I really don't understant from where does the solver keeps the old library even when all of the them are wiped out and recompiled...
I directly include the canges in LIB_SRC
elomri is offline   Reply With Quote

Old   June 27, 2018, 02:56
Post Brownian motion force not running when using uncoupledKinematicParcelFoam
  #11
Member
 
AJAY BHANDARI
Join Date: Jul 2015
Location: INDIA
Posts: 57
Rep Power: 11
AJAY BHANDARI is on a distinguished road
Hi all,

I think my post best suits here.

Basically i am solving a steady state continuity and darcy equation to get steady state pressure and velocity fields, which go into a transient convection diffusion equation to solve time dependent concentration of a species in a computational domain. Now i want to couple my developed eulerain solver with lagrangian one.

For that i am using uncoupledKinematicParcelFoam and coupling it with my eulerian solver. The solver is compiled succesfully. But when i am running the case it is giving following error.

Constructing kinematicCloud kinematicCloud
--> FOAM Warning :
From function entry::getKeyword(keyType&, Istream&)
in file db/dictionary/entry/entryIO.C at line 80
Reading /home/ajay/OpenFOAM/ajay-4.1/run/mytutorials/srmparticlenew/constant/kinematicCloudProperties
found on line 64 the punctuation token '{'
expected either } or EOF
Constructing particle forces
Selecting particle force sphereDrag
Selecting particle force gravity
Selecting particle force BrownianMotion


--> FOAM FATAL ERROR:
Unknown particle force type BrownianMotion, constructor not in hash table

Valid particle force types are:

13
(
ErgunWenYuDrag
PlessisMasliyahDrag
SRF
SaffmanMeiLiftForce
TomiyamaLift
WenYuDrag
gravity
nonInertialFrame
nonSphereDrag
paramagnetic
pressureGradient
sphereDrag
virtualMass
)


From function static Foam::autoPtr<Foam::ParticleForce<CloudType> > Foam::ParticleForce<CloudType>::New(CloudType&, const Foam::fvMesh&, const Foam::dictionary&, const Foam::word&) [with CloudType = Foam::KinematicCloud<Foam::Cloud<Foam::CollidingPa rcel<Foam::KinematicParcel<Foam:article> > > >]
in file lagrangian/intermediate/lnInclude/ParticleForceNew.C at line 47.

FOAM exiting
I know the error is coming because of addition of Brownian motion force in the case.

Can anybody please help why the brownian motion force is not running for the case.
Any help will be appreciated.

Thanks
Ajay
AJAY BHANDARI is offline   Reply With Quote

Old   October 24, 2018, 04:27
Default
  #12
New Member
 
Hongxiang Yu
Join Date: Jul 2018
Posts: 4
Rep Power: 8
Nicole Yu LZ is on a distinguished road
Quote:
Originally Posted by a.weber View Post
did you also change /intermediate/parcels/include/makeParcelForces.H?
There you'll have to add your own force model as well.
Hi, I have already add in makeParcelForces.H,but it still says unknown particle force type, I wonder why ? and how to solve it, thanks.
Nicole Yu LZ is offline   Reply With Quote

Old   November 25, 2021, 08:27
Default
  #13
Senior Member
 
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17
vonboett is on a distinguished road
are you sure you recompiled the lagrangian/intermediate? Make sure the lagrangian/lnInclude points to your modified makeParcelForces.H

Last edited by vonboett; November 25, 2021 at 09:34.
vonboett is offline   Reply With Quote

Reply

Tags
drag force, lagrangian, of2.3.1


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
ActuatorDiskExplicitForce in OF2.1. Help be_inspired OpenFOAM Programming & Development 10 September 14, 2018 12:12
FLUENT: how to record drag force at every time step? qiulan FLUENT 4 March 20, 2017 22:22
Force can not converge colopolo CFX 13 October 4, 2011 23:03
Force vectors for drag during sweeping motion aamer FLUENT 0 April 18, 2011 09:17
formula used for drag force? kamma Main CFD Forum 0 April 2, 2010 11:21


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