From def7148136ed763a56647c0095fa412512c06ffa Mon Sep 17 00:00:00 2001 From: Henry <Henry> Date: Sun, 28 Jul 2013 18:09:54 +0100 Subject: [PATCH] applications/test/PisoFoam: test version of pisoFoam using new templated turbulence library --- applications/test/PisoFoam/Make/options | 8 ++-- applications/test/PisoFoam/PisoFoam.C | 54 +++-------------------- applications/test/PisoFoam/createFields.H | 12 +++-- 3 files changed, 19 insertions(+), 55 deletions(-) diff --git a/applications/test/PisoFoam/Make/options b/applications/test/PisoFoam/Make/options index 259f95f7b93..8e32793a194 100644 --- a/applications/test/PisoFoam/Make/options +++ b/applications/test/PisoFoam/Make/options @@ -1,13 +1,13 @@ EXE_INC = \ - -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ + -I$(LIB_SRC)/TurbulenceModels/turbulenceModel/lnInclude \ + -I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ -I$(LIB_SRC)/finiteVolume/lnInclude EXE_LIBS = \ - -lincompressibleTurbulenceModel \ - -lincompressibleRASModels \ - -lincompressibleLESModels \ + -lturbulenceModels \ + -lincompressibleTurbulenceModels \ -lincompressibleTransportModels \ -lfiniteVolume \ -lmeshTools diff --git a/applications/test/PisoFoam/PisoFoam.C b/applications/test/PisoFoam/PisoFoam.C index 1713e9747c7..bbd28e6f88a 100644 --- a/applications/test/PisoFoam/PisoFoam.C +++ b/applications/test/PisoFoam/PisoFoam.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,12 +33,7 @@ Description #include "fvCFD.H" #include "singlePhaseTransportModel.H" -#include "turbulenceModel.H" - -#include "LduMatrix.H" -#include "diagTensorField.H" - -typedef LduMatrix<vector, scalar, scalar> lduVectorMatrix; +#include "IncompressibleTurbulenceModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -73,50 +68,12 @@ int main(int argc, char *argv[]) + turbulence->divDevReff(U) ); - //UEqn.relax(); - - fvVectorMatrix UEqnp(UEqn == -fvc::grad(p)); - - lduVectorMatrix U3Eqnp(mesh); - U3Eqnp.diag() = UEqnp.diag(); - U3Eqnp.upper() = UEqnp.upper(); - U3Eqnp.lower() = UEqnp.lower(); - U3Eqnp.source() = UEqnp.source(); - - UEqnp.addBoundaryDiag(U3Eqnp.diag(), 0); - UEqnp.addBoundarySource(U3Eqnp.source(), false); - - U3Eqnp.interfaces() = U.boundaryField().interfaces(); - U3Eqnp.interfacesUpper() = UEqnp.boundaryCoeffs().component(0); - U3Eqnp.interfacesLower() = UEqnp.internalCoeffs().component(0); + UEqn.relax(); - autoPtr<lduVectorMatrix::solver> U3EqnpSolver = - lduVectorMatrix::solver::New - ( - U.name(), - U3Eqnp, - dictionary - ( - IStringStream - ( - "{" - " /*solver SmoothSolver;*/" - " smoother GaussSeidel;" - " solver PBiCCCG;" - " preconditioner none;" - " tolerance (1e-7 1e-7 1);" - " relTol (0 0 0);" - "}" - )() - ) - ); - - //for (int i=0; i<3; i++) + if (momentumPredictor) { - U3EqnpSolver->solve(U).print(Info); - U.correctBoundaryConditions(); + solve(UEqn == -fvc::grad(p)); } - //solve(UEqnp); // --- PISO loop @@ -173,6 +130,7 @@ int main(int argc, char *argv[]) } } + laminarTransport.correct(); turbulence->correct(); runTime.write(); diff --git a/applications/test/PisoFoam/createFields.H b/applications/test/PisoFoam/createFields.H index 7cae304f6f6..d543396a8d5 100644 --- a/applications/test/PisoFoam/createFields.H +++ b/applications/test/PisoFoam/createFields.H @@ -26,7 +26,7 @@ mesh ); -# include "createPhi.H" + #include "createPhi.H" label pRefCell = 0; @@ -36,7 +36,13 @@ singlePhaseTransportModel laminarTransport(U, phi); - autoPtr<incompressible::turbulenceModel> turbulence + autoPtr<IncompressibleTurbulenceModel<transportModel> > + turbulence ( - incompressible::turbulenceModel::New(U, phi, laminarTransport) + IncompressibleTurbulenceModel<transportModel>::New + ( + U, + phi, + laminarTransport + ) ); -- GitLab