Walkthrough and Tutorial For Scalartransportfoam: A Solver For Advection-Diffusion of A Passive Scalar

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Walkthrough and tutorial for scalarTransportFoam: a solver for

advection-diffusion of a passive scalar

Eric Paterson
egp@vt.edu

Kevin T. Crofton Department of Aerospace and Ocean Engineering


Virginia Polytechnic Institute and State University

ESOP Workshop
5-8 June 2017
Outline

1 Code walkthrough

2 Tutorial

3 Addition of a source

4 Addition of a source

Eric Paterson (Virginia Tech AOE) scalarTransportFoam 5-8 June 2017 2/6
Code walkthrough

Navigate to the source code of the solvers using the alias sol . Then enter the
command, % sol
% cd basic/scalarTransportFoam/
walkthrough scalarTransportFoam.C
The partial differential equation being solved is:
∂T ~ ) − ∇ · (DT ∇T ) = ST
+ ∇ · (UT (1)
∂t

walkthrough createFields.H
walkthrough Make/files and Make/options

Eric Paterson (Virginia Tech AOE) scalarTransportFoam 5-8 June 2017 3/6
Tutorial

Navigate to the scalarTransportFoam tutorial in


$FOAM_RUN/tutorials/basic/scalarTransportFoam/pitzDaily .
Run the tutorial
Since there is no Allrun script, it is safe to assume that the process is simple
% blockMesh % scalarTransportFoam
Visualize the data using paraView
Review the quality of the mesh using the utility checkMesh
Re–run the case, but lower the diffusivity from 0.01 to 0.0001. Visualize the flow.
What happened?

Eric Paterson (Virginia Tech AOE) scalarTransportFoam 5-8 June 2017 4/6
Addition of a source

OpenFoam includes Run-time selectable physics through a framework that allows


users to select any physics that can be represented as sources or constraints on the
governing equations.
scalarTransportFoam includes the hooks to fvOptions
Let’s go look at the code!
Now run case with a point-source of a fixed value.

Eric Paterson (Virginia Tech AOE) scalarTransportFoam 5-8 June 2017 5/6
Eric Paterson (Virginia Tech AOE) scalarTransportFoam 5-8 June 2017 6/6

You might also like