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

adding new injector in Intermediate directory

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes
  • 2 Post By niklas

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 26, 2015, 04:33
Default adding new injector in Intermediate directory
  #1
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 14
Carlen is on a distinguished road
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
Carlen is offline   Reply With Quote

Old   March 26, 2015, 04:57
Default
  #2
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 14
Carlen is on a distinguished road
Quote:
Originally Posted by Carlen View Post
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
add: I follow solution in this link: http://www.cfd-online.com/Forums/ope...ray-model.html
post#10

and it didnt work
Carlen is offline   Reply With Quote

Old   March 26, 2015, 09:50
Default
  #3
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 14
Carlen is on a distinguished road
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
)
Carlen is offline   Reply With Quote

Old   March 26, 2015, 11:32
Default
  #4
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 14
Carlen is on a distinguished road
BTW, I am using OpenFoam 2.3.1 the latest version
Carlen is offline   Reply With Quote

Old   March 26, 2015, 13:28
Default
  #5
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28
mturcios777 will become famous soon enough
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...
mturcios777 is offline   Reply With Quote

Old   March 26, 2015, 20:49
Default
  #6
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 14
Carlen is on a distinguished road
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
Carlen is offline   Reply With Quote

Old   March 26, 2015, 21:54
Default
  #7
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 14
Carlen is on a distinguished road
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!
Carlen is offline   Reply With Quote

Old   March 27, 2015, 02:02
Default
  #8
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Did you read this
https://openfoamwiki.net/index.php/H...SpraySubModels
alexisespinosa and Carlen like this.
niklas is offline   Reply With Quote

Old   March 27, 2015, 05:42
Default
  #9
Member
 
Join Date: Jul 2012
Posts: 67
Rep Power: 14
Carlen is on a distinguished road
Hi niklas,
Thank you for your information. I did follow the procedure on that website and it worked fine. Thank you again.

Carlen
Carlen is offline   Reply With Quote

Old   August 28, 2015, 03:42
Default
  #10
New Member
 
Alexis Espinosa
Join Date: Aug 2009
Location: Australia
Posts: 20
Rep Power: 17
alexisespinosa is on a distinguished road
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
alexisespinosa is offline   Reply With Quote

Old   March 19, 2016, 10:42
Default new injection model in $FOAM_USER_LIBBIN
  #11
Senior Member
 
Join Date: Jan 2010
Location: Stuttgart
Posts: 150
Rep Power: 16
Chrisi1984 is on a distinguished road
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
Chrisi1984 is offline   Reply With Quote

Reply


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
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


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