# Calculate the mixing time using a tracer

 Register Blogs Members List Search Today's Posts Mark Forums Read

 December 10, 2012, 22:19 Calculate the mixing time using a tracer #1 Member   Luca Giannelli Join Date: Jun 2010 Location: Kobe, Japan Posts: 58 Rep Power: 15 Hello everybody, as per title, I would like to calculate the mixing time of the reactor I am simulating using interfoam (a bubble column). I will surely do that using a tracer in the reactor but would like to simulate it as I have found papers where they're doing such analysis. Unfortunately they're not using OpenFOAM as the solver. The idea is really simple: - you define a probing spot (somewhere inside the domain) - inject a tracer (maybe defining a concentration? Or a fixed quantity?) - run the simulation and record the step-by-step time variation of the tracer concentration in the probe. - go for a coffee while the trinket kindly works out the solution. - plot the results Looks easy but, I've been looking for an answer to this question for some time and I was not able to figure out how to do it! I start think I have to add the concentration component in the solver equation... Any idea? Thanks!

 December 11, 2012, 03:19 #2 Senior Member   Olivier Join Date: Jun 2009 Location: France, grenoble Posts: 272 Rep Power: 17 Hello, You could to that with a tracer, or do a full residence time distribution (RTD). And yes, you should add a passive scalar to interFoam (take a look at http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam regards, olivier

December 11, 2012, 09:52
#3
Member

Luca Giannelli
Join Date: Jun 2010
Location: Kobe, Japan
Posts: 58
Rep Power: 15
Quote:
 Originally Posted by olivierG Hello, You could to that with a tracer, or do a full residence time distribution (RTD). And yes, you should add a passive scalar to interFoam (take a look at http://openfoamwiki.net/index.php/Ho...ure_to_icoFoam regards, olivier
Olivier,

thank you for the swift response and for pointing me to that wiki page. As i was looking for the mixing time (not for the residence time) i was getting 0 results! keywords....

I was also starting to suspect the need for an added variable (that is what happens in the real situation) but I dare to hope there was a quicker way to do that.

I'll go the rough way then... and report if I succeed. But that will be tomorrow.

Thanks again.

 December 12, 2012, 00:54 #4 Member   Luca Giannelli Join Date: Jun 2010 Location: Kobe, Japan Posts: 58 Rep Power: 15 Ok, I am a step forward in the solution of my problem but still a step before that! I clarify what I mean: - read thoroughly the Wiki page and followed the step-by-step guide - compiled and run the modified file flawlessly (as a test for the future duty) - moved the interFoam files to my folder ad run the test "wmake" (before any modification) and I got this wonderful output: Code: ```Making dependency list for source file tracer_interFoam.C SOURCE=tracer_interFoam.C ; g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/transportModels -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/transportModels/incompressible/lnInclude -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/transportModels/interfaceProperties/lnInclude -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/incompressible/turbulenceModel -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC -c \$SOURCE -o Make/linux64GccDPOpt/tracer_interFoam.o /home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H: In function ‘int main(int, char**)’: /home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’ [-Wunused-variable] /home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’ [-Wunused-variable] /home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:3:9: warning: unused variable ‘nCorr’ [-Wunused-variable] /home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:8:10: warning: unused variable ‘momentumPredictor’ [-Wunused-variable] /home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:11:10: warning: unused variable ‘transonic’ [-Wunused-variable] /home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude/readPISOControls.H:14:9: warning: unused variable ‘nOuterCorr’ [-Wunused-variable] g++ -m64 -Dlinux64 -DWM_DP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3 -DNoRepository -ftemplate-depth-40 -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/transportModels -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/transportModels/incompressible/lnInclude -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/transportModels/interfaceProperties/lnInclude -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/turbulenceModels/incompressible/turbulenceModel -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/finiteVolume/lnInclude -IlnInclude -I. -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/OpenFOAM/lnInclude -I/home/piota/OpenFOAM/OpenFOAM-1.6/src/OSspecific/POSIX/lnInclude -fPIC Make/linux64GccDPOpt/tracer_interFoam.o -L/home/piota/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt \ -linterfaceProperties -lincompressibleTransportModels -lincompressibleRASModels -lincompressibleLESModels -lfiniteVolume -lOpenFOAM -liberty -ldl /home/piota/OpenFOAM/OpenFOAM-1.6/lib/linux64GccDPOpt/openmpi-1.3.3/libPstream.so -lm -o /home/piota/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/tracer_interFoam Make/linux64GccDPOpt/tracer_interFoam.o: In function `main': tracer_interFoam.C:(.text.startup+0xe77): undefined reference to `Foam::incompressible::turbulenceModel::New(Foam::GeometricField, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField const&, Foam::transportModel&)' collect2: ld returned 1 exit status make: *** [/home/piota/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/tracer_interFoam] Error 1``` I am no expert in compilation but I guess there's something wrong in the declaration of functions. I suppose I can ignore the "unused variable" errors.... so, probably the error is located in the very last step: Code: ```Make/linux64GccDPOpt/tracer_interFoam.o: In function `main': tracer_interFoam.C:(.text.startup+0xe77): undefined reference to `Foam::incompressible::turbulenceModel::New(Foam::GeometricField, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField const&, Foam::transportModel&)' collect2: ld returned 1 exit status make: *** [/home/piota/OpenFOAM/OpenFOAM-1.6/applications/bin/linux64GccDPOpt/tracer_interFoam] Error 1``` I tried to go through all the dep files (which are A LOT) looking for those keywords it reports in the error (i.e. fvPatchField, volMesh etc etc) but I were not able to get any solution. I don't actually know why every time I get to compile something in OpenFOAM it takes me one week of fiddling..... As I just need to add the scalar (and I know how to do that now) I am a step from the solution! Any suggestion is strongly appreciated.

 December 12, 2012, 10:03 #5 Member   Luca Giannelli Join Date: Jun 2010 Location: Kobe, Japan Posts: 58 Rep Power: 15 Solved the problem for now.... http://www.cfd-online.com/Forums/ope...ion-fails.html and the tracer system seems to be perfect for my needs! I'll update info here if I will have some problems