From cf06107c8b215b1676e529bc337377736a666f25 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 16 Jul 2023 19:50:57 +0100 Subject: [PATCH] dnsFoam: replaced by the incompressibleFluid solver module with the OUForce fvModel The bin/dnsFoam redirection script is provided to help users update dnsFoam cases. --- .../legacy/incompressible/dnsFoam/Make/files | 3 - .../incompressible/dnsFoam/Make/options | 9 -- .../incompressible/dnsFoam/createFields.H | 35 ----- .../legacy/incompressible/dnsFoam/dnsFoam.C | 147 ------------------ .../incompressible/dnsFoam/globalProperties.H | 10 -- .../dnsFoam/readPhysicalProperties.H | 20 --- .../dnsFoam/readTurbulenceProperties.H | 21 --- bin/dnsFoam | 62 ++++++++ .../incompressible/dnsFoam/boxTurb16/0/U.orig | 50 ------ .../incompressible/dnsFoam/boxTurb16/0/p | 50 ------ .../incompressible/dnsFoam/boxTurb16/Allclean | 10 -- .../incompressible/dnsFoam/boxTurb16/Allrun | 15 -- .../dnsFoam/boxTurb16/constant/boxTurbDict | 22 --- .../boxTurb16/constant/momentumTransport | 22 --- .../boxTurb16/constant/physicalProperties | 20 --- .../dnsFoam/boxTurb16/system/blockMeshDict | 94 ----------- .../dnsFoam/boxTurb16/system/controlDict | 49 ------ .../dnsFoam/boxTurb16/system/fvSchemes | 49 ------ .../dnsFoam/boxTurb16/system/fvSolution | 43 ----- 19 files changed, 62 insertions(+), 669 deletions(-) delete mode 100644 applications/legacy/incompressible/dnsFoam/Make/files delete mode 100644 applications/legacy/incompressible/dnsFoam/Make/options delete mode 100644 applications/legacy/incompressible/dnsFoam/createFields.H delete mode 100644 applications/legacy/incompressible/dnsFoam/dnsFoam.C delete mode 100644 applications/legacy/incompressible/dnsFoam/globalProperties.H delete mode 100644 applications/legacy/incompressible/dnsFoam/readPhysicalProperties.H delete mode 100644 applications/legacy/incompressible/dnsFoam/readTurbulenceProperties.H create mode 100755 bin/dnsFoam delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/0/U.orig delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/0/p delete mode 100755 tutorials/legacy/incompressible/dnsFoam/boxTurb16/Allclean delete mode 100755 tutorials/legacy/incompressible/dnsFoam/boxTurb16/Allrun delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/constant/boxTurbDict delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/constant/momentumTransport delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/constant/physicalProperties delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/system/blockMeshDict delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/system/controlDict delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/system/fvSchemes delete mode 100644 tutorials/legacy/incompressible/dnsFoam/boxTurb16/system/fvSolution diff --git a/applications/legacy/incompressible/dnsFoam/Make/files b/applications/legacy/incompressible/dnsFoam/Make/files deleted file mode 100644 index fcb329718d..0000000000 --- a/applications/legacy/incompressible/dnsFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -dnsFoam.C - -EXE = $(FOAM_APPBIN)/dnsFoam diff --git a/applications/legacy/incompressible/dnsFoam/Make/options b/applications/legacy/incompressible/dnsFoam/Make/options deleted file mode 100644 index ca6ebb8c80..0000000000 --- a/applications/legacy/incompressible/dnsFoam/Make/options +++ /dev/null @@ -1,9 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/randomProcesses/lnInclude \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lrandomProcesses \ - -lfiniteVolume \ - -lmeshTools diff --git a/applications/legacy/incompressible/dnsFoam/createFields.H b/applications/legacy/incompressible/dnsFoam/createFields.H deleted file mode 100644 index 13c3ce9081..0000000000 --- a/applications/legacy/incompressible/dnsFoam/createFields.H +++ /dev/null @@ -1,35 +0,0 @@ -#include "readPhysicalProperties.H" - -Info<< "Reading field p\n" << endl; -volScalarField p -( - IOobject - ( - "p", - runTime.name(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -Info<< "Reading field U\n" << endl; -volVectorField U -( - IOobject - ( - "U", - runTime.name(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh -); - -#include "createPhi.H" - -mesh.schemes().setFluxRequired(p.name()); - -#include "readTurbulenceProperties.H" diff --git a/applications/legacy/incompressible/dnsFoam/dnsFoam.C b/applications/legacy/incompressible/dnsFoam/dnsFoam.C deleted file mode 100644 index 52d02e7c22..0000000000 --- a/applications/legacy/incompressible/dnsFoam/dnsFoam.C +++ /dev/null @@ -1,147 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2023 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 . - -Application - dnsFoam - -Description - Direct numerical simulation solver for boxes of isotropic turbulence. - -\*---------------------------------------------------------------------------*/ - -#include "argList.H" -#include "timeSelector.H" -#include "Kmesh.H" -#include "OUprocess.H" -#include "fft.H" -#include "writeEk.H" -#include "writeFile.H" - -#include "pisoControl.H" -#include "constrainPressure.H" -#include "constrainHbyA.H" - -#include "fvcDdt.H" -#include "fvcGrad.H" -#include "fvcFlux.H" - -#include "fvmDdt.H" -#include "fvmDiv.H" -#include "fvmLaplacian.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "postProcess.H" - - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "createControl.H" - #include "createFields.H" - #include "initContinuityErrs.H" - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - - Info<< nl << "Starting time loop" << endl; - - while (runTime.loop()) - { - Info<< "Time = " << runTime.userTimeName() << nl << endl; - - force.primitiveFieldRef() = ReImSum - ( - fft::reverseTransform - ( - (K/(mag(K) + 1.0e-6)) - ^ forceGen.newField(runTime.deltaTValue()), K.nn() - ) - ); - - #include "globalProperties.H" - - fvVectorMatrix UEqn - ( - fvm::ddt(U) - + fvm::div(phi, U) - - fvm::laplacian(nu, U) - == - force - ); - - solve(UEqn == -fvc::grad(p)); - - - // --- PISO loop - while (piso.correct()) - { - volScalarField rAU(1.0/UEqn.A()); - surfaceScalarField rAUf("rAUf", fvc::interpolate(rAU)); - volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); - surfaceScalarField phiHbyA - ( - "phiHbyA", - fvc::flux(HbyA) - + rAUf*fvc::ddtCorr(U, phi) - ); - - // Update the pressure BCs to ensure flux consistency - constrainPressure(p, U, phiHbyA, rAUf); - - fvScalarMatrix pEqn - ( - fvm::laplacian(rAUf, p) == fvc::div(phiHbyA) - ); - - pEqn.solve(); - - phi = phiHbyA - pEqn.flux(); - - #include "continuityErrs.H" - - U = HbyA - rAU*fvc::grad(p); - U.correctBoundaryConditions(); - } - - runTime.write(); - - if (runTime.writeTime()) - { - writeEk(U, K); - } - - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } - - Info<< "End\n" << endl; - - return 0; -} - - -// ************************************************************************* // diff --git a/applications/legacy/incompressible/dnsFoam/globalProperties.H b/applications/legacy/incompressible/dnsFoam/globalProperties.H deleted file mode 100644 index 0f19c68f50..0000000000 --- a/applications/legacy/incompressible/dnsFoam/globalProperties.H +++ /dev/null @@ -1,10 +0,0 @@ -{ - Info<< "k(" << runTime.name() << ") = " - << 3.0/2.0*average(magSqr(U)).value() << endl; - - Info<< "epsilon(" << runTime.name() << ") = " - << (0.5*nu*average(magSqr(twoSymm(fvc::grad(U))))).value() << endl; - - Info<< "U.f(" << runTime.name() << ") = " - << 181.0*average(U & force).value() << endl; -} diff --git a/applications/legacy/incompressible/dnsFoam/readPhysicalProperties.H b/applications/legacy/incompressible/dnsFoam/readPhysicalProperties.H deleted file mode 100644 index 64d8cc1432..0000000000 --- a/applications/legacy/incompressible/dnsFoam/readPhysicalProperties.H +++ /dev/null @@ -1,20 +0,0 @@ - Info<< "Reading physicalProperties\n" << endl; - - IOdictionary physicalProperties - ( - IOobject - ( - "physicalProperties", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - dimensionedScalar nu - ( - "nu", - dimViscosity, - physicalProperties - ); diff --git a/applications/legacy/incompressible/dnsFoam/readTurbulenceProperties.H b/applications/legacy/incompressible/dnsFoam/readTurbulenceProperties.H deleted file mode 100644 index df493c7667..0000000000 --- a/applications/legacy/incompressible/dnsFoam/readTurbulenceProperties.H +++ /dev/null @@ -1,21 +0,0 @@ - Info<< "Reading momentumTransport\n" << endl; - - IOdictionary momentumTransport - ( - IOobject - ( - "momentumTransport", - runTime.constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ); - - volVectorField force - ( - U/dimensionedScalar("dt", dimTime, runTime.deltaTValue()) - ); - - Kmesh K(mesh); - OUprocess forceGen(K, runTime.deltaTValue(), momentumTransport); diff --git a/bin/dnsFoam b/bin/dnsFoam new file mode 100755 index 0000000000..2fa9607d35 --- /dev/null +++ b/bin/dnsFoam @@ -0,0 +1,62 @@ +#!/bin/sh +#------------------------------------------------------------------------------ +# ========= | +# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox +# \\ / O peration | Website: https://openfoam.org +# \\ / A nd | Copyright (C) 2023 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 . +# +# Script +# dnsFoam +# +# Description +# Script to inform the user that dnsFoam has been superseded +# and replaced by the more general incompressibleFluid solver module +# with the OUForce fvModel executed by the foamRun application. +# +#------------------------------------------------------------------------------ + +cat <