From a7f68e85efaaef69c2e5dd13b7b72fab62c119ab Mon Sep 17 00:00:00 2001
From: andy <a.heather@opencfd.co.uk>
Date: Wed, 11 Feb 2009 18:49:54 +0000
Subject: [PATCH] restructuring

---
 .../buoyantSimpleRadiationFoam.C              |  1 +
 .../convergenceCheck.H                        |  9 --
 .../buoyantSimpleRadiationFoam/createFields.H | 97 -------------------
 .../createRadiationModel.H                    |  5 +
 .../initConvergenceCheck.H                    |  7 --
 5 files changed, 6 insertions(+), 113 deletions(-)
 delete mode 100644 applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/convergenceCheck.H
 delete mode 100644 applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/createFields.H
 create mode 100644 applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/createRadiationModel.H
 delete mode 100644 applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/initConvergenceCheck.H

diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
index 5b794252011..21059f50649 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
+++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/buoyantSimpleRadiationFoam.C
@@ -47,6 +47,7 @@ int main(int argc, char *argv[])
 #   include "createMesh.H"
 #   include "readEnvironmentalProperties.H"
 #   include "createFields.H"
+#   include "createRadiationModel.H"
 #   include "initContinuityErrs.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/convergenceCheck.H b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/convergenceCheck.H
deleted file mode 100644
index 8958063193a..00000000000
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/convergenceCheck.H
+++ /dev/null
@@ -1,9 +0,0 @@
-// check convergence
-
-if (maxResidual < convergenceCriterion)
-{
-    Info<< "reached convergence criterion: " << convergenceCriterion << endl;
-    runTime.writeAndEnd();
-    Info<< "latestTime = " << runTime.timeName() << endl;
-}
-
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/createFields.H b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/createFields.H
deleted file mode 100644
index 62c06ec38d6..00000000000
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/createFields.H
+++ /dev/null
@@ -1,97 +0,0 @@
-    Info<< "Reading thermophysical properties\n" << endl;
-
-    autoPtr<basicThermo> thermo
-    (
-        basicThermo::New(mesh)
-    );
-
-    volScalarField rho
-    (
-        IOobject
-        (
-            "rho",
-            runTime.timeName(),
-            mesh,
-            IOobject::NO_READ,
-            IOobject::NO_WRITE
-        ),
-        thermo->rho()
-    );
-
-    volScalarField& p = thermo->p();
-    volScalarField& h = thermo->h();
-    const volScalarField& T = thermo->T();
-
-
-    Info<< "Reading field U\n" << endl;
-    volVectorField U
-    (
-        IOobject
-        (
-            "U",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
-#   include "compressibleCreatePhi.H"
-
-
-    Info<< "Creating turbulence model\n" << endl;
-    autoPtr<compressible::RASModel> turbulence
-    (
-        compressible::RASModel::New
-        (
-            rho,
-            U,
-            phi,
-            thermo()
-        )
-    );
-
-    Info<< "Calculating field g.h\n" << endl;
-    volScalarField gh("gh", g & mesh.C());
-    surfaceScalarField ghf("gh", g & mesh.Cf());
-
-    dimensionedScalar pRef("pRef", p.dimensions(), thermo->lookup("pRef"));
-
-    Info<< "Creating field pd\n" << endl;
-    volScalarField pd
-    (
-        IOobject
-        (
-            "pd",
-            runTime.timeName(),
-            mesh,
-            IOobject::MUST_READ,
-            IOobject::AUTO_WRITE
-        ),
-        mesh
-    );
-
-    p = pd + rho*gh + pRef;
-    thermo->correct();
-
-
-    label pdRefCell = 0;
-    scalar pdRefValue = 0.0;
-    setRefCell
-    (
-        pd,
-        mesh.solutionDict().subDict("SIMPLE"),
-        pdRefCell,
-        pdRefValue
-    );
-
-
-    Info<< "Creating radiation model\n" << endl;
-    autoPtr<radiation::radiationModel> radiation
-    (
-        radiation::radiationModel::New(T)
-    );
-
-
-    dimensionedScalar initialMass = fvc::domainIntegrate(rho);
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/createRadiationModel.H b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/createRadiationModel.H
new file mode 100644
index 00000000000..babe3c4dbe1
--- /dev/null
+++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/createRadiationModel.H
@@ -0,0 +1,5 @@
+    Info<< "Creating radiation model\n" << endl;
+    autoPtr<radiation::radiationModel> radiation
+    (
+        radiation::radiationModel::New(thermo->T())
+    );
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/initConvergenceCheck.H b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/initConvergenceCheck.H
deleted file mode 100644
index b56197f22a5..00000000000
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/initConvergenceCheck.H
+++ /dev/null
@@ -1,7 +0,0 @@
-// initialize values for convergence checks
-
-    scalar eqnResidual = 1, maxResidual = 0;
-    scalar convergenceCriterion = 0;
-
-    simple.readIfPresent("convergence", convergenceCriterion);
-
-- 
GitLab