|
[Sponsors] |
adding new injector in Intermediate directory |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 26, 2015, 04:33 |
adding new injector in Intermediate directory
|
#1 |
Member
Join Date: Jul 2012
Posts: 67
Rep Power: 14 |
Hi foamers,
I am encountering a problem about how to call new injectors added to the Intermediate directory in sprayFoam. The detailed explanation is: I have written a new injector based on the ManualInjection model in OF, and I named it as myManualInjection. All references in such a model were changed accordingly. I then processed to compile the modified model in $FOAM_SRC/lagrangian/Intermediate by using wclean and wmake libso, and this executed without problems. I then use "banana" method to test whether I can call my new injector in the aachenBomb simulation, and it was unfortunate that my new injector is not in the available options: Valid injection model types are: 9 ( cellZoneInjection coneInjection coneNozzleInjection fieldActivatedInjection inflationInjection manualInjection none patchFlowRateInjection patchInjection ) as you can see there is no myManualInjection. How can I solve this problem? Kind regards, Carlen |
|
March 26, 2015, 04:57 |
|
#2 | |
Member
Join Date: Jul 2012
Posts: 67
Rep Power: 14 |
Quote:
post#10 and it didnt work |
||
March 26, 2015, 09:50 |
|
#3 |
Member
Join Date: Jul 2012
Posts: 67
Rep Power: 14 |
update: this new injector works in DPMFoam but does not work in sprayFoam:
12 ( carlenManualInjection cellZoneInjection coneInjection coneNozzleInjection fieldActivatedInjection inflationInjection kinematicLookupTableInjection manualInjection myInjection none patchFlowRateInjection patchInjection ) |
|
March 26, 2015, 11:32 |
|
#4 |
Member
Join Date: Jul 2012
Posts: 67
Rep Power: 14 |
BTW, I am using OpenFoam 2.3.1 the latest version
|
|
March 26, 2015, 13:28 |
|
#5 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Have you tried recompiling the spray library? Looking at Make/options files on both solvers, it seems that DPMFoam doesn't use the spray class, whereas sprayFoam does. It may be that DPMFoam is using the base lagrangian libraries directly, whereas the spray class does a lot of templating. The compiled version of the liblagrangianSpray.so may not have your model inside of it. Try recompiling and see if that helps...
|
|
March 26, 2015, 20:49 |
|
#6 |
Member
Join Date: Jul 2012
Posts: 67
Rep Power: 14 |
Hi Turcios,
I did compile the sprayFoam in its original folder. However, it looks like it does not use the compiled library. I also noticed that even changing the original injection models(ManualInjection) does not affect the sprayFoam solver. Any idea as to how to solve this problem, or is this a bug that hasnt been reported? Kind regards, Carlen |
|
March 26, 2015, 21:54 |
|
#7 |
Member
Join Date: Jul 2012
Posts: 67
Rep Power: 14 |
Hi Foamers,
I solved this problem. For readers who are interested in the same question, remember to add #include "myInjection" in src/lagrangian/spray/parcels/include/makeSprayParcelInjectionModels.H and declare the model in below lines :makeInjectionModelType(carlenManualInjection, CloudType); \ Then just do a wclean wmake libso, and you are go! |
|
March 27, 2015, 02:02 |
|
#8 |
Super Moderator
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29 |
Did you read this
https://openfoamwiki.net/index.php/H...SpraySubModels |
|
March 27, 2015, 05:42 |
|
#9 |
Member
Join Date: Jul 2012
Posts: 67
Rep Power: 14 |
Hi niklas,
Thank you for your information. I did follow the procedure on that website and it worked fine. Thank you again. Carlen |
|
August 28, 2015, 03:42 |
|
#10 |
New Member
Alexis Espinosa
Join Date: Aug 2009
Location: Australia
Posts: 20
Rep Power: 17 |
Niklas, I read your post. Thanks a lot for that.
I just have some questions. Following your post, I understand that your practice is to add new code inside the original OpenFOAM directories. I thought that the common practice was to put all new code in a user directory, like: $FOAM_USER_SRC (although now I see this is not an already defined variable, but nothing impedes us to define it). And then, the compiled new library would finish in: $FOAM_USER_LIBBIN (which is indeed already defined). I have tried something like this while defining a new integration scheme that would work as a perfect tracer (that is, the velocity of the particle would be equal to the fluid velocity, without the need to 'trick' the drag force model with very small stokes). I succeded but some errors appear at the end of the execution (as will be explained in question 2). I copied the whole $FOAM_SRC/lagrangian/basic and $FOAM_SRC/lagrangian/intermediate directory into $FOAM_USER_SRC/lagrangian. Then I pretty much followed your procedure I finished with two new libraries: $FOAM_USER_LIBBIN/liblagrangianPerfectTracer.so $FOAM_USER_LIBBIN/liblagrangianIntermediatePerfectTracer.so After reading your post, then I realized that maybe this is not the best way to go, and I should keep using $FOAM_SRC and add the code there instead of using my created $FOAM_USER_SRC. But I do not know. So basically, the two questions are: 1)When should we try to use a separated directory and put code in $FOAM_USER_SRC and libraries in $FOAM_USER_LIBBIN instead of adding stuff to $FOAM_SRC and modifying the libraries in $FOAM_LIBBIN?? 2)If there is a typical situation for which 1) has an answer. Then, How to follow this practice in a clean way (without duplicating code). My executable (icoPerfectTracerFoam) runs well, and particle trajectories are solved like perfect tracers. But I still suffer of errors at the end of the execution. At the end of the execution there is an error message saying that a destructor was trying to free memory that was already liberated. I'm guessing that some code has been duplicated in my procedure (another point in favour of your procedure). What may I have done wrong? Many thanks, Alexis Espinosa |
|
March 19, 2016, 10:42 |
new injection model in $FOAM_USER_LIBBIN
|
#11 |
Senior Member
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16 |
Hello together,
I am implementing an additional injectionModel into the lagrangian/intermediate library into $FOAM_USER_LIBBIN (not inside the original installation like descript here). Therefore I copied the whole intermediate library and added the new injection model (also in the make*.H-files). In general the new injection model works and I can use it. But always when I link the library to the solver to make the new model usable I get warnings having "Duplicate entry none in runtime selection table" So that means all other stuff from the intermediate library is found twice by the RTS. I would like to know how exactly I can get rid of those warnings spending the smallest possible effort. The diddiculty for me is to find out what exactly is needed to compile the new injectionModel and what not. That is the reason why I recompiled the whole Intermediate library just with the added injectionModel. Thanks in advance and kind regards! Chrisi |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to calculate mass flow rate on patches and summation of that during the run? | immortality | OpenFOAM Post-Processing | 104 | February 16, 2021 09:46 |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
OpenFoam install script Error during paraFoam installation | SePe | OpenFOAM Installation | 10 | June 19, 2010 16:15 |
critical error during installation of openfoam | Fabio88 | OpenFOAM Installation | 21 | June 2, 2010 04:01 |