Project 3- Adding a temperature dictionary to the incompressible icoFoam case to solve the energy equation
Code used in latex:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\title{Adding Temperature equation to icoFoam}
\author{Aditya Bantwal}
\date{10th August 2022}
\begin{document}
\maketitle
\newpage
\section{Introduction}
In this study, the transport equation for temperature is modelled using OpenFOAM. The equation is solved by adding it to the icoFoam solver, which is incompressible and transient.
\section{Methodology}
First, the icoFoam solver is copied to the user solver directory. It is renamed to icoTempFoam. Then, "icoFoam.C" is moved to "icoTempFoam.C".
Within the Make folder, the "files" file is changed to the following:
\begin{verbatim}
icoTempFoam.C
EXE = $(FOAM_USER_APPBIN)/icoTempFoam
\end{verbatim}
Next, in createFields.H, the temperature field is created using an IOObject. The heat diffusion coefficient kappa is also added.
\begin{verbatim}
dimensionedScalar kappa
(
"kappa",
dimViscosity,
transportProperties
);
Info<< "Reading field T\n" << endl;
volScalarField T
(
IOobject
(
"T",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
\end{verbatim}
Now, the temperature equation is added after the PISO loop is completed and the pressure and velocity fields have been established. The transport equation for temperature is given as:
$$ \frac{\partial T }{\partial t} + {(U.\nabla) T } = k\nabla^2 T$$
\begin{verbatim}
\end{verbatim}
This is represented in the icoTempFoam.C file as:
\begin{verbatim}
fvScalarMatrix TEqn
(
fvm::ddt(T)
+ fvm::div(phi, T)
- fvm::laplacian(kappa, T)
);
TEqn.solve();
\end{verbatim}
Finally, the wmake command is run in the main folder of icoTempFoam and then the solver is created.
\section{Case setup}
The cavity tutorial case is copied and run using icoTempFoam. In the 0 folder, the temperature file is created and the following boundary conditions are added:
\begin{verbatim}
dimensions [0 0 0 1 0 0 0];
internalField uniform 300;
boundaryField
{
movingWall
{
type fixedValue;
value uniform 400;
}
fixedWalls
{
type fixedValue;
value uniform 300;
}
frontAndBack
{
type empty;
}
}
\end{verbatim}
In the constant folder, the value for kappa is then provided. Note that is has the same units as kinematic viscosity.
\begin{verbatim}
kappa 0.001;
\end{verbatim}
In fvSchemes, laplacian and divergence schemes are added for temperature as:
\begin{verbatim}
divSchemes
{
default none;
div(phi,U) Gauss linear;
div(phi,T) Gauss linear;
}
laplacianSchemes
{
default Gauss linear orthogonal;
laplacian(kappa,T) Gauss linear orthogonal;
}
\end{verbatim}
In fvSolution, a solver for T is added as:
\begin{verbatim}
T
{
solver smoothSolver;
smoother symGaussSeidel;
tolerance 1e-07;
relTol 0;
}
\end{verbatim}
\section{Results}
\begin{figure}[htp]
\centering
\includegraphics[width=13cm]{temp}
\caption{Temperatue field icoFoam}
\label{fig:temp}
\end{figure}
As observed from Figure 1., the temperature field is solved using icoFoam.
\section{Conclusion}
In this study, the temperature transport equation was added to icoFoam. The cavity tutorial was tested and results were visualized using paraview.
\end{document}
Find the report in the google drive link:
https://drive.google.com/file/d/14XvYyxLsEniflAOPYBj6g6OqgDtZWj9L/view?usp=sharing