|
[Sponsors] |
February 19, 2015, 06:10 |
Turbulent scalar mixing
|
#1 |
New Member
Join Date: Apr 2013
Posts: 26
Rep Power: 13 |
Hello Foamers,
I need to modify scalarTransportFoam to take into account turbulent dispersion. I would like to simulate pollutant dispersion around buildings. but I'm not sure how to modify scalarTransportFoam, any help or example? I've read this interesting post http://www.cfd-online.com/Forums/ope...tml#post280210 Unfortunately the link in the post to is not working anymore. thanks a lot in advance! |
|
February 19, 2015, 06:47 |
|
#2 |
Senior Member
|
Hi,
A few clarifications. Would you like to calculate velocity & turbulence fields with another solver (let's say pimpleFoam), map these fields to your test case and then use scalarTransportFoam to calculate mixing? Also you can use scalarTransport function object with other solvers. It can take constant value of diffusivity or calculate it from turbulence model (though in assumption that turbulent Schmidt number is 1 and turbulent diffusivity is much higher than molecular). |
|
February 19, 2015, 07:18 |
|
#3 |
New Member
Join Date: Apr 2013
Posts: 26
Rep Power: 13 |
Hi Alexeym,
and thanks for your prompt reply! That's exactly what I would like to do, I have already computed steady flow field with SIMPLE solver and now I would like to use this solution to understand how a source of pollutant in between two buildings (imposing a fixed gradient as a BC) would mix. At this stage my simulation is 2D and the pollutant source should be a line. I would like to simulate turbulent Schmidt numbers ranging from 0.2 to 0.7, however turbulent diffusivity is much higher than molecular and as a first step, scalarTransport function would perfectly fit, but I do not understand how to use it!! Thanks in advance |
|
February 19, 2015, 12:16 |
|
#4 |
Senior Member
|
Hi,
Well, if you use simpleFoam, then scalarTransport function object is not an option, cause it uses fvm::ddt operator which will not be happy about steadyState ddt scheme which is usually used in simpleFoam simulations. So you really need to modify scalarTransportFoam. Let's assume, will go with this expression for diffusivity: Molecular diffusivity and turbulent Schmidt number are constant read from dictionary, turbulent viscosity is a field calculated with simpleFoam. So you take createFields.H and add Code:
volScalarField nut ( IOobject ( "nut", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh ); Code:
Info<< "Reading turbulent Schmidt number\n" << endl; dimensionedScalar Sct ( transportProperties.lookup("Sct") ); volScalarField DTt ( IOobject ( "DTt", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), nut/Sct + DT, nut.boundaryField().types() ); Code:
solve ( fvm::ddt(T) + fvm::div(phi, T) - fvm::laplacian(DTt, T) == fvOptions(T) ); See attached archive for source code and test case. |
|
February 24, 2015, 08:08 |
|
#5 |
New Member
Join Date: Apr 2013
Posts: 26
Rep Power: 13 |
Dear Alexey,
thank you so much for your help!! I am trying to use your code but I have some problems... I have tried different configuration in order to avoid bothering you but without success...so I hope you can help me again! When I run the test case you attached everything works (except for a warning) but the field does not change after the first time step!! I attach the a few lines of log.turbulentScalarTransportFoam Create time Create mesh for time = 0 Reading field T Reading field nut Reading field U Reading transportProperties Reading diffusivity DT Reading turbulent Schmidt number --> FOAM Warning : From function GeometricField<Type, PatchField, GeoMesh>::readIfPresent() in file /opt/openfoam231/src/OpenFOAM/lnInclude/GeometricField.C at line 108 read option IOobject::MUST_READ or MUST_READ_IF_MODIFIED suggests that a read constructor for field DTt would be more appropriate. Reading/calculating face flux field phi No finite volume options present SIMPLE: no convergence criteria found. Calculations will run for 1 steps. Calculating scalar transport Courant Number mean: 0.447422 max: 1.94995 Time = 0.0001 DILUPBiCG: Solving for T, Initial residual = 1, Final residual = 1.39684e-16, No Iterations 1 Time = 0.0002 DILUPBiCG: Solving for T, Initial residual = 1.76667e-45, Final residual = 1.76667e-45, No Iterations 0 Time = 0.0003 DILUPBiCG: Solving for T, Initial residual = 1.76667e-45, Final residual = 1.76667e-45, No Iterations 0 Time = 0.0004 DILUPBiCG: Solving for T, Initial residual = 1.76667e-45, Final residual = 1.76667e-45, No Iterations 0 Time = 0.0005 DILUPBiCG: Solving for T, Initial residual = 1.76667e-45, Final residual = 1.76667e-45, No Iterations 0 Time = 0.0006 DILUPBiCG: Solving for T, Initial residual = 1.76667e-45, Final residual = 1.76667e-45, No Iterations 0 Time = 0.0007 and it continues like that, without any change. I have tried to change diffusivity and Schmidt number but nothing changes. And the field is not stationary at all!! Any help is highly appreciated Thanks in advance. |
|
February 24, 2015, 08:37 |
|
#6 |
Senior Member
|
Hi,
Well, it is rather interesting modification of mapFields in 2.3.1. After mapFields mapped values of nut are in the range [-2; infinity] (in 2.3.0 it was OK). So if you modify mapFields line of Allrun script to: Code:
runApplication mapFields -mapMethod direct -consistent -fields '(U nut)' -sourceTime latestTime ../pitzDaily-simple Code:
volScalarField DTt ( IOobject ( "DTt", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), nut/Sct + DT, nut.boundaryField().types() ); Code:
--> FOAM Warning : From function GeometricField<Type, PatchField, GeoMesh>::readIfPresent() in file /opt/openfoam231/src/OpenFOAM/lnInclude/GeometricField.C at line 108 read option IOobject::MUST_READ or MUST_READ_IF_MODIFIED suggests that a read constructor for field DTt would be more appropriate. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
whats the cause of error? | immortality | OpenFOAM Running, Solving & CFD | 13 | March 24, 2021 08:15 |
add a pssive scalar in turbulent flow | zxj160 | OpenFOAM | 13 | January 28, 2020 13:11 |
a question of turbulent mixing layer | JJY | OpenFOAM Running, Solving & CFD | 4 | April 3, 2009 12:25 |
Mixing of a passive scalar | Maged Ismail | FLUENT | 0 | June 10, 2005 10:09 |
LES unsteady : Turbulent Mixing Layer | Flav | FLUENT | 5 | December 13, 1999 04:11 |