Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 0c90a43
Showing
5 changed files
with
132 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
polyMesh | ||
linux64Gcc* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
burgersFoam.C | ||
|
||
EXE = $(FOAM_APPBIN)/burgersFoam |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
EXE_INC = \ | ||
-I$(LIB_SRC)/finiteVolume/lnInclude \ | ||
-I$(LIB_SRC)/fvOptions/lnInclude \ | ||
-I$(LIB_SRC)/meshTools/lnInclude \ | ||
-I$(LIB_SRC)/sampling/lnInclude | ||
|
||
EXE_LIBS = \ | ||
-lfiniteVolume \ | ||
-lfvOptions \ | ||
-lmeshTools \ | ||
-lsampling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/*---------------------------------------------------------------------------*\ | ||
========= | | ||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox | ||
\\ / O peration | | ||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation | ||
\\/ M anipulation | | ||
------------------------------------------------------------------------------- | ||
License | ||
This file is part of OpenFOAM. | ||
OpenFOAM is free software: you can redistribute it and/or modify it | ||
under the terms of the GNU General Public License as published by | ||
the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT | ||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | ||
for more details. | ||
You should have received a copy of the GNU General Public License | ||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. | ||
Application | ||
burgersFoam | ||
Description | ||
Solves a transport equation for a passive scalar | ||
\*---------------------------------------------------------------------------*/ | ||
|
||
#include "fvCFD.H" | ||
#include "fvIOoptionList.H" | ||
#include "simpleControl.H" | ||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
#include "setRootCase.H" | ||
#include "createTime.H" | ||
#include "createMesh.H" | ||
|
||
simpleControl simple(mesh); | ||
|
||
#include "createFields.H" | ||
#include "createFvOptions.H" | ||
|
||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // | ||
|
||
Info<< "\nCalculating scalar transport\n" << endl; | ||
|
||
#include "CourantNo.H" | ||
|
||
while (simple.loop()) | ||
{ | ||
Info<< "Time = " << runTime.timeName() << nl << endl; | ||
|
||
while (simple.correctNonOrthogonal()) | ||
{ | ||
solve | ||
( | ||
fvm::ddt(U) | ||
+ fvm::div(phi, U) | ||
- fvm::laplacian(nu, U) | ||
); | ||
} | ||
phi = linearInterpolate(U) & mesh.Sf(); | ||
runTime.write(); | ||
} | ||
|
||
Info<< "End\n" << endl; | ||
return 0; | ||
} | ||
|
||
|
||
// ************************************************************************* // |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Info<< "Reading field U\n" << endl; | ||
|
||
volVectorField U | ||
( | ||
IOobject | ||
( | ||
"U", | ||
runTime.timeName(), | ||
mesh, | ||
IOobject::MUST_READ, | ||
IOobject::AUTO_WRITE | ||
), | ||
mesh | ||
); | ||
|
||
|
||
Info<< "Reading transportProperties\n" << endl; | ||
|
||
IOdictionary transportProperties | ||
( | ||
IOobject | ||
( | ||
"transportProperties", | ||
runTime.constant(), | ||
mesh, | ||
IOobject::MUST_READ_IF_MODIFIED, | ||
IOobject::NO_WRITE | ||
) | ||
); | ||
|
||
|
||
Info<< "Reading viscosity nu\n" << endl; | ||
|
||
dimensionedScalar nu | ||
( | ||
transportProperties.lookup("nu") | ||
); | ||
|
||
#include "createPhi.H" |