CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Turbulent scalar mixing

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 19, 2015, 06:10
Default Turbulent scalar mixing
  #1
New Member
 
Join Date: Apr 2013
Posts: 3
Rep Power: 4
pippo2013 is on a distinguished road
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
ScalarTransportFoam for RTD calculations
Unfortunately the link in the post to is not working anymore.

thanks a lot in advance!
pippo2013 is offline   Reply With Quote

Old   February 19, 2015, 06:47
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,110
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
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).
alexeym is offline   Reply With Quote

Old   February 19, 2015, 07:18
Default
  #3
New Member
 
Join Date: Apr 2013
Posts: 3
Rep Power: 4
pippo2013 is on a distinguished road
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
pippo2013 is offline   Reply With Quote

Old   February 19, 2015, 12:16
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,110
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
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:

D = D_{molecular} + \frac{\nu_t}{Sc_t}

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
    );
to read turbulent viscosity. Then you add

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()
    );
to calculate turbulent diffusivity. As velocity and turbulent viscosity fields are taken from steady state simulation we need to calculate turbulent diffusivity only once. And finally you modify scalarTransportFoam.C, to account for new diffusivity:

Code:
            solve
            (
                fvm::ddt(T)
              + fvm::div(phi, T)
              - fvm::laplacian(DTt, T)
             ==
                fvOptions(T)
            );
And that's all.

See attached archive for source code and test case.
Attached Files
File Type: gz turbulentScalarTransportFoam.tar.gz (7.6 KB, 10 views)
alexeym is offline   Reply With Quote

Old   February 24, 2015, 08:08
Default
  #5
New Member
 
Join Date: Apr 2013
Posts: 3
Rep Power: 4
pippo2013 is on a distinguished road
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.
pippo2013 is offline   Reply With Quote

Old   February 24, 2015, 08:37
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,110
Rep Power: 19
alexeym will become famous soon enoughalexeym will become famous soon enough
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
everything start to run properly. Also you can modify DTt constructor in createField.H:

Code:
    volScalarField DTt
    (
        IOobject
        (
            "DTt",
            runTime.timeName(),
            mesh,
            IOobject::NO_READ,
            IOobject::NO_WRITE
        ),
        nut/Sct + DT,
        nut.boundaryField().types()
    );
to avoid this

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.
during run-time.
alexeym is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
whats the cause of error? immortality OpenFOAM Running, Solving & CFD 11 April 22, 2014 12:32
add a pssive scalar in turbulent flow zxj160 OpenFOAM 11 January 27, 2013 14:57
a question of turbulent mixing layer JJY OpenFOAM Running, Solving & CFD 4 April 3, 2009 11:25
Mixing of a passive scalar Maged Ismail FLUENT 0 June 10, 2005 09:09
LES unsteady : Turbulent Mixing Layer Flav FLUENT 5 December 13, 1999 04:11


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