CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Post-Processing (http://www.cfd-online.com/Forums/openfoam-post-processing/)
-   -   Calculate the mixing time using a tracer (http://www.cfd-online.com/Forums/openfoam-post-processing/110417-calculate-mixing-time-using-tracer.html)

 voingiappone December 10, 2012 23:19

Calculate the mixing time using a tracer

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!

 olivierG December 11, 2012 04:19

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

 voingiappone December 11, 2012 10:52

Quote:
 Originally Posted by olivierG (Post 396842) 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.

 voingiappone December 12, 2012 01:54

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::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> 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::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> 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.

 voingiappone December 12, 2012 11:03

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

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