|
[Sponsors] |
Adding a new drag force to icoUncoupledKinematicParcelFoam |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 9, 2015, 13:32 |
Adding a new drag force to icoUncoupledKinematicParcelFoam
|
#1 | |
New Member
Jan Bartel
Join Date: Jul 2015
Location: Germany
Posts: 5
Rep Power: 11 |
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:
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. |
||
July 10, 2015, 09:44 |
|
#2 |
Member
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12 |
did you also change /intermediate/parcels/include/makeParcelForces.H?
There you'll have to add your own force model as well. |
|
July 10, 2015, 10:16 |
|
#3 | ||
New Member
Jan Bartel
Join Date: Jul 2015
Location: Germany
Posts: 5
Rep Power: 11 |
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:
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:
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. |
|||
July 13, 2015, 02:36 |
|
#4 |
Member
Andreas Weber
Join Date: Jun 2014
Posts: 37
Rep Power: 12 |
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 |
|
July 15, 2015, 09:40 |
|
#5 |
New Member
Jan Bartel
Join Date: Jul 2015
Location: Germany
Posts: 5
Rep Power: 11 |
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. |
|
November 29, 2016, 16:01 |
|
#6 |
Member
Chris Cloney
Join Date: Jun 2016
Location: Halifax, Canada
Posts: 62
Rep Power: 10 |
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. |
|
September 17, 2017, 00:15 |
|
#7 | |
New Member
Fengli Shen
Join Date: Dec 2016
Posts: 7
Rep Power: 10 |
Quote:
|
||
March 20, 2018, 10:31 |
similar problem
|
#8 |
New Member
Join Date: Nov 2017
Location: Germany
Posts: 11
Rep Power: 9 |
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 ? |
|
March 21, 2018, 11:45 |
|
#9 |
Member
Chris Cloney
Join Date: Jun 2016
Location: Halifax, Canada
Posts: 62
Rep Power: 10 |
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!
|
|
March 23, 2018, 06:09 |
|
#10 |
New Member
Join Date: Nov 2017
Location: Germany
Posts: 11
Rep Power: 9 |
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 |
|
June 27, 2018, 02:56 |
Brownian motion force not running when using uncoupledKinematicParcelFoam
|
#11 |
Member
AJAY BHANDARI
Join Date: Jul 2015
Location: INDIA
Posts: 57
Rep Power: 11 |
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 |
|
October 24, 2018, 04:27 |
|
#12 |
New Member
Hongxiang Yu
Join Date: Jul 2018
Posts: 4
Rep Power: 8 |
||
November 25, 2021, 08:27 |
|
#13 |
Senior Member
Albrecht vBoetticher
Join Date: Aug 2010
Location: Zürich, Swizerland
Posts: 240
Rep Power: 17 |
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. |
|
Tags |
drag force, lagrangian, of2.3.1 |
|
|
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 |