diff --git a/applications/legacy/incompressible/dnsFoam/dnsFoam.C b/applications/legacy/incompressible/dnsFoam/dnsFoam.C index a05674078a..52d02e7c22 100644 --- a/applications/legacy/incompressible/dnsFoam/dnsFoam.C +++ b/applications/legacy/incompressible/dnsFoam/dnsFoam.C @@ -32,7 +32,7 @@ Description #include "argList.H" #include "timeSelector.H" #include "Kmesh.H" -#include "UOprocess.H" +#include "OUprocess.H" #include "fft.H" #include "writeEk.H" #include "writeFile.H" @@ -76,7 +76,8 @@ int main(int argc, char *argv[]) ( fft::reverseTransform ( - K/(mag(K) + 1.0e-6) ^ forceGen.newField(), K.nn() + (K/(mag(K) + 1.0e-6)) + ^ forceGen.newField(runTime.deltaTValue()), K.nn() ) ); diff --git a/applications/legacy/incompressible/dnsFoam/readTurbulenceProperties.H b/applications/legacy/incompressible/dnsFoam/readTurbulenceProperties.H index d02b602731..df493c7667 100644 --- a/applications/legacy/incompressible/dnsFoam/readTurbulenceProperties.H +++ b/applications/legacy/incompressible/dnsFoam/readTurbulenceProperties.H @@ -18,4 +18,4 @@ ); Kmesh K(mesh); - UOprocess forceGen(K, runTime.deltaTValue(), momentumTransport); + OUprocess forceGen(K, runTime.deltaTValue(), momentumTransport); diff --git a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.C b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.C index 73147aaf61..3877e9afba 100644 --- a/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.C +++ b/src/finiteVolume/cfdTools/general/fvConstraints/fvConstraints.C @@ -301,7 +301,7 @@ bool Foam::fvConstraints::writeData(Ostream& os) const bool Foam::fvConstraints::read() { - if (IOdictionary::regIOobject::read()) + if (regIOobject::read()) { checkTimeIndex_ = mesh().time().timeIndex() + 1; diff --git a/src/finiteVolume/cfdTools/general/fvModels/fvModels.C b/src/finiteVolume/cfdTools/general/fvModels/fvModels.C index 3b8704d522..4839b2fe1d 100644 --- a/src/finiteVolume/cfdTools/general/fvModels/fvModels.C +++ b/src/finiteVolume/cfdTools/general/fvModels/fvModels.C @@ -332,7 +332,7 @@ bool Foam::fvModels::writeData(Ostream& os) const bool Foam::fvModels::read() { - if (IOdictionary::regIOobject::read()) + if (regIOobject::read()) { checkTimeIndex_ = mesh().time().timeIndex() + 1; diff --git a/src/randomProcesses/Make/files b/src/randomProcesses/Make/files index 86811b9c87..8fbefdbc0b 100644 --- a/src/randomProcesses/Make/files +++ b/src/randomProcesses/Make/files @@ -5,7 +5,9 @@ fft/fftRenumber.C fft/writeEk.C fft/kShellIntegration.C -processes/UOprocess/UOprocess.C +processes/OUprocess/OUprocess.C + +OUForce/OUForce.C turbulence/turbGen.C diff --git a/src/randomProcesses/OUForce/OUForce.C b/src/randomProcesses/OUForce/OUForce.C new file mode 100644 index 0000000000..c7aa04831a --- /dev/null +++ b/src/randomProcesses/OUForce/OUForce.C @@ -0,0 +1,150 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +\*---------------------------------------------------------------------------*/ + +#include "OUForce.H" +#include "fvMatrices.H" +#include "fft.H" +#include "writeEk.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +namespace Foam +{ +namespace fv +{ + defineTypeNameAndDebug(OUForce, 0); + + addToRunTimeSelectionTable + ( + fvModel, + OUForce, + dictionary + ); +} +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::fv::OUForce::readCoeffs() +{ + UName_ = coeffs().lookupOrDefault("U", "U"); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::fv::OUForce::OUForce +( + const word& name, + const word& modelType, + const fvMesh& mesh, + const dictionary& dict +) +: + fvModel(name, modelType, mesh, dict), + UName_(word::null), + K_(mesh), + forceGen_(K_, mesh.time().deltaTValue(), dict) +{ + readCoeffs(); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +Foam::wordList Foam::fv::OUForce::addSupFields() const +{ + return wordList(1, UName_); +} + + +void Foam::fv::OUForce::addSup +( + fvMatrix& eqn, + const word& fieldName +) const +{ + if (mesh().time().writeTime()) + { + writeEk(eqn.psi(), K_); + } + + eqn += volVectorField::Internal + ( + IOobject + ( + "OUForce", + mesh().time().name(), + mesh() + ), + mesh(), + dimAcceleration, + ReImSum + ( + fft::reverseTransform + ( + (K_/(mag(K_) + 1.0e-6)) + ^ forceGen_.newField(mesh().time().deltaTValue()), K_.nn() + ) + ) + ); +} + + +bool Foam::fv::OUForce::movePoints() +{ + return true; +} + + +void Foam::fv::OUForce::topoChange(const polyTopoChangeMap&) +{} + + +void Foam::fv::OUForce::mapMesh(const polyMeshMap& map) +{} + + +void Foam::fv::OUForce::distribute(const polyDistributionMap&) +{} + + +bool Foam::fv::OUForce::read(const dictionary& dict) +{ + if (fvModel::read(dict)) + { + readCoeffs(); + return true; + } + else + { + return false; + } +} + + +// ************************************************************************* // diff --git a/src/randomProcesses/OUForce/OUForce.H b/src/randomProcesses/OUForce/OUForce.H new file mode 100644 index 0000000000..7aa51abc97 --- /dev/null +++ b/src/randomProcesses/OUForce/OUForce.H @@ -0,0 +1,178 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 . + +Class + Foam::fv::OUForce + +Description + Calculates and applies the random OU (Ornstein-Uhlenbeck) process force to + the momentum equation for direct numerical simulation of boxes of isotropic + turbulence. + + The energy spectrum is calculated and written at write-times which is + particularly useful to test and compare LES SGS models. + +Note + This random OU process force uses a FFT to generate the force field which + is not currently parallelised. Also the mesh the FFT is applied to must + be isotropic and have a power of 2 cells in each direction. + +Usage + Example usage: + \verbatim + OUForce + { + type OUForce; + + libs ("librandomProcesses.so"); + + sigma 0.090295; + alpha 0.81532; + kUpper 10; + kLower 7; + } + \endverbatim + +SourceFiles + OUForce.C + +\*---------------------------------------------------------------------------*/ + +#ifndef OUForce_H +#define OUForce_H + +#include "fvModel.H" +#include "Kmesh.H" +#include "OUprocess.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace fv +{ + +/*---------------------------------------------------------------------------*\ + Class OUForce Declaration +\*---------------------------------------------------------------------------*/ + +class OUForce +: + public fvModel +{ + // Private Data + + //- Name of the velocity field + word UName_; + + //- The wavenumber mesh used for the random OU process + Kmesh K_; + + //- The random OU process force generator + OUprocess forceGen_; + + + // Private Member Functions + + //- Non-virtual read + void readCoeffs(); + + +public: + + //- Runtime type information + TypeName("OUForce"); + + + // Constructors + + //- Construct from explicit source name and mesh + OUForce + ( + const word& name, + const word& modelType, + const fvMesh& mesh, + const dictionary& dict + ); + + //- Disallow default bitwise copy construction + OUForce(const OUForce&) = delete; + + + // Member Functions + + // Checks + + //- Return the list of fields for which the fvModel adds source term + // to the transport equation + virtual wordList addSupFields() const; + + + // Evaluate + + //- Add explicit contribution to incompressible momentum equation + virtual void addSup + ( + fvMatrix& eqn, + const word& fieldName + ) const; + + + // Mesh changes + + //- Update for mesh motion + virtual bool movePoints(); + + //- Update topology using the given map + virtual void topoChange(const polyTopoChangeMap&); + + //- Update from another mesh using the given map + virtual void mapMesh(const polyMeshMap&); + + //- Redistribute or update using the given distribution map + virtual void distribute(const polyDistributionMap&); + + + // IO + + //- Read source dictionary + virtual bool read(const dictionary& dict); + + + // Member Operators + + //- Disallow default bitwise assignment + void operator=(const OUForce&) = delete; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace fv +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/randomProcesses/processes/UOprocess/UOprocess.C b/src/randomProcesses/processes/OUprocess/OUprocess.C similarity index 56% rename from src/randomProcesses/processes/UOprocess/UOprocess.C rename to src/randomProcesses/processes/OUprocess/OUprocess.C index 9ef3959168..81ea0a059a 100644 --- a/src/randomProcesses/processes/UOprocess/UOprocess.C +++ b/src/randomProcesses/processes/OUprocess/OUprocess.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -23,11 +23,8 @@ License \*---------------------------------------------------------------------------*/ -#include "error.H" - -#include "UOprocess.H" +#include "OUprocess.H" #include "Kmesh.H" -#include "dictionary.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -36,54 +33,51 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -complexVector UOprocess::WeinerProcess() +complexVector OUprocess::WeinerProcess(const scalar deltaT) const { - return RootDeltaT*complexVector + return sqrt(deltaT)*complexVector ( - complex(GaussGen.scalarNormal(), GaussGen.scalarNormal()), - complex(GaussGen.scalarNormal(), GaussGen.scalarNormal()), - complex(GaussGen.scalarNormal(), GaussGen.scalarNormal()) + complex(GaussGen_.scalarNormal(), GaussGen_.scalarNormal()), + complex(GaussGen_.scalarNormal(), GaussGen_.scalarNormal()), + complex(GaussGen_.scalarNormal(), GaussGen_.scalarNormal()) ); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// from components -UOprocess::UOprocess +OUprocess::OUprocess ( const Kmesh& kmesh, const scalar deltaT, - const dictionary& UOdict + const dictionary& OUdict ) : - GaussGen(label(0)), - Mesh(kmesh), - DeltaT(deltaT), - RootDeltaT(sqrt(DeltaT)), - UOfield(Mesh.size()), + GaussGen_(label(0)), + Kmesh_(kmesh), + OUfield_(Kmesh_.size()), - Alpha(UOdict.lookup("UOalpha")), - Sigma(UOdict.lookup("UOsigma")), - Kupper(UOdict.lookup("UOKupper")), - Klower(UOdict.lookup("UOKlower")), - Scale((Kupper - Klower)*pow(scalar(Mesh.size()), 1.0/vector::dim)) + alpha_(OUdict.lookup("alpha")), + sigma_(OUdict.lookup("sigma")), + kUpper_(OUdict.lookup("kUpper")), + kLower_(OUdict.lookup("kLower")), + scale_((kUpper_ - kLower_)*pow(scalar(Kmesh_.size()), 1.0/vector::dim)) { - const vectorField& K = Mesh; + const vectorField& K = Kmesh_; - scalar sqrKupper = sqr(Kupper); - scalar sqrKlower = sqr(Klower) + small; + scalar sqrkUpper_ = sqr(kUpper_); + scalar sqrkLower_ = sqr(kLower_) + small; scalar sqrK; - forAll(UOfield, i) + forAll(OUfield_, i) { - if ((sqrK = magSqr(K[i])) < sqrKupper && sqrK > sqrKlower) + if ((sqrK = magSqr(K[i])) < sqrkUpper_ && sqrK > sqrkLower_) { - UOfield[i] = Scale*Sigma*WeinerProcess(); + OUfield_[i] = scale_*sigma_*WeinerProcess(deltaT); } else { - UOfield[i] = complexVector + OUfield_[i] = complexVector ( complex(0, 0), complex(0, 0), @@ -96,29 +90,27 @@ UOprocess::UOprocess // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const complexVectorField& UOprocess::newField() +const complexVectorField& OUprocess::newField(const scalar deltaT) const { - const vectorField& K = Mesh; + const vectorField& K = Kmesh_; label count = 0; - scalar sqrKupper = sqr(Kupper); - scalar sqrKlower = sqr(Klower) + small; + scalar sqrkUpper_ = sqr(kUpper_); + scalar sqrkLower_ = sqr(kLower_) + small; scalar sqrK; - forAll(UOfield, i) + forAll(OUfield_, i) { - if ((sqrK = magSqr(K[i])) < sqrKupper && sqrK > sqrKlower) + if ((sqrK = magSqr(K[i])) < sqrkUpper_ && sqrK > sqrkLower_) { count++; - UOfield[i] = - (1.0 - Alpha*DeltaT)*UOfield[i] - + Scale*Sigma*WeinerProcess(); + OUfield_[i] = + (1.0 - alpha_*deltaT)*OUfield_[i] + + scale_*sigma_*WeinerProcess(deltaT); } } - Info<< " Number of forced K = " << count << nl; - - return UOfield; + return OUfield_; } diff --git a/src/randomProcesses/processes/UOprocess/UOprocess.H b/src/randomProcesses/processes/OUprocess/OUprocess.H similarity index 69% rename from src/randomProcesses/processes/UOprocess/UOprocess.H rename to src/randomProcesses/processes/OUprocess/OUprocess.H index 05102887ef..590f8e06e6 100644 --- a/src/randomProcesses/processes/UOprocess/UOprocess.H +++ b/src/randomProcesses/processes/OUprocess/OUprocess.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -22,18 +22,18 @@ License along with OpenFOAM. If not, see . Class - Foam::UOprocess + Foam::OUprocess Description - Random UO process. + Random Ornstein-Uhlenbeck process SourceFiles - UOprocess.C + OUprocess.C \*---------------------------------------------------------------------------*/ -#ifndef UOprocess_H -#define UOprocess_H +#ifndef OUprocess_H +#define OUprocess_H #include "complexFields.H" #include "scalar.H" @@ -45,40 +45,40 @@ namespace Foam { class Kmesh; -class dictionary; /*---------------------------------------------------------------------------*\ - Class UOprocess Declaration + Class OUprocess Declaration \*---------------------------------------------------------------------------*/ -class UOprocess +class OUprocess { // Private Data - Random GaussGen; + mutable Random GaussGen_; - const Kmesh& Mesh; - const scalar DeltaT, RootDeltaT; - complexVectorField UOfield; + const Kmesh& Kmesh_; + mutable complexVectorField OUfield_; - scalar Alpha; - scalar Sigma; - scalar Kupper; - scalar Klower; - scalar Scale; + // Ornstein-Uhlenbeck process coefficients + scalar alpha_; + scalar sigma_; + scalar kUpper_; + scalar kLower_; + scalar scale_; // Private Member Functions - complexVector WeinerProcess(); + //- Return the Weiner process field + complexVector WeinerProcess(const scalar deltaT) const; public: // Constructors - //- Construct from wavenumber mesh and timestep - UOprocess + //- Construct from wavenumber mesh, timestep and coefficients dict + OUprocess ( const Kmesh& kmesh, const scalar deltaT, @@ -88,7 +88,8 @@ public: // Member Functions - const complexVectorField& newField(); + //- Return the current random Ornstein-Uhlenbeck process field + const complexVectorField& newField(const scalar deltaT) const; }; diff --git a/tutorials/incompressibleFluid/boxTurb16/0/U.orig b/tutorials/incompressibleFluid/boxTurb16/0/U.orig new file mode 100644 index 0000000000..e814064876 --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/0/U.orig @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volVectorField; + location "0"; + object U.orig; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + patch0_half0 + { + type cyclic; + } + patch0_half1 + { + type cyclic; + } + patch1_half0 + { + type cyclic; + } + patch1_half1 + { + type cyclic; + } + patch2_half0 + { + type cyclic; + } + patch2_half1 + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/0/p b/tutorials/incompressibleFluid/boxTurb16/0/p new file mode 100644 index 0000000000..afd28404d4 --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/0/p @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class volScalarField; + location "1"; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + patch0_half0 + { + type cyclic; + } + patch1_half0 + { + type cyclic; + } + patch2_half0 + { + type cyclic; + } + patch2_half1 + { + type cyclic; + } + patch1_half1 + { + type cyclic; + } + patch0_half1 + { + type cyclic; + } +} + + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/Allclean b/tutorials/incompressibleFluid/boxTurb16/Allclean new file mode 100755 index 0000000000..14375ff1df --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/Allclean @@ -0,0 +1,10 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial clean functions +. $WM_PROJECT_DIR/bin/tools/CleanFunctions + +cleanCase +rm -rf 0/enstrophy + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressibleFluid/boxTurb16/Allrun b/tutorials/incompressibleFluid/boxTurb16/Allrun new file mode 100755 index 0000000000..96b02e6a6a --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/Allrun @@ -0,0 +1,15 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +# Get application name +application=$(getApplication) + +runApplication blockMesh +runApplication boxTurb +runApplication $application +runApplication -s enstrophy foamPostProcess -func enstrophy + +#------------------------------------------------------------------------------ diff --git a/tutorials/incompressibleFluid/boxTurb16/constant/boxTurbDict b/tutorials/incompressibleFluid/boxTurb16/constant/boxTurbDict new file mode 100644 index 0000000000..15154eb47a --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/constant/boxTurbDict @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object boxTurbDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Ea 10; + +k0 5; + + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/constant/fvModels b/tutorials/incompressibleFluid/boxTurb16/constant/fvModels new file mode 100644 index 0000000000..b0d71baf29 --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/constant/fvModels @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object fvModels; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +OUForce +{ + type OUForce; + + libs ("librandomProcesses.so"); + + sigma 0.090295; + alpha 0.81532; + kUpper 10; + kLower 7; +} + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/constant/momentumTransport b/tutorials/incompressibleFluid/boxTurb16/constant/momentumTransport new file mode 100644 index 0000000000..7c2dc8837b --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/constant/momentumTransport @@ -0,0 +1,19 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object momentumTransport; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/constant/physicalProperties b/tutorials/incompressibleFluid/boxTurb16/constant/physicalProperties new file mode 100644 index 0000000000..d1e2e084cc --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/constant/physicalProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "constant"; + object physicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +viscosityModel constant; + +nu 0.025; + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/system/blockMeshDict b/tutorials/incompressibleFluid/boxTurb16/system/blockMeshDict new file mode 100644 index 0000000000..7347179756 --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/system/blockMeshDict @@ -0,0 +1,94 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 1; + +vertices +( + (0 0 0) + (1 0 0) + (1 1 0) + (0 1 0) + (0 0 1) + (1 0 1) + (1 1 1) + (0 1 1) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (16 16 16) simpleGrading (1 1 1) +); + +boundary +( + patch0_half0 + { + type cyclic; + neighbourPatch patch0_half1; + faces + ( + (0 3 2 1) + ); + } + patch0_half1 + { + type cyclic; + neighbourPatch patch0_half0; + faces + ( + (4 5 6 7) + ); + } + patch1_half0 + { + type cyclic; + neighbourPatch patch1_half1; + faces + ( + (0 4 7 3) + ); + } + patch1_half1 + { + type cyclic; + neighbourPatch patch1_half0; + faces + ( + (2 6 5 1) + ); + } + patch2_half0 + { + type cyclic; + neighbourPatch patch2_half1; + faces + ( + (3 7 6 2) + ); + } + patch2_half1 + { + type cyclic; + neighbourPatch patch2_half0; + faces + ( + (1 5 4 0) + ); + } +); + + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/system/controlDict b/tutorials/incompressibleFluid/boxTurb16/system/controlDict new file mode 100644 index 0000000000..74788bd83d --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/system/controlDict @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +application foamRun; + +solver incompressibleFluid; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 10; + +deltaT 0.025; + +writeControl runTime; + +writeInterval 0.25; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression off; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable true; + +graphFormat raw; + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/system/fvSchemes b/tutorials/incompressibleFluid/boxTurb16/system/fvSchemes new file mode 100644 index 0000000000..2bdefd10fb --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/system/fvSchemes @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + default none; + div(phi,U) Gauss cubic; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + + +// ************************************************************************* // diff --git a/tutorials/incompressibleFluid/boxTurb16/system/fvSolution b/tutorials/incompressibleFluid/boxTurb16/system/fvSolution new file mode 100644 index 0000000000..05286b1cc8 --- /dev/null +++ b/tutorials/incompressibleFluid/boxTurb16/system/fvSolution @@ -0,0 +1,45 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + "p.*" + { + solver PCG; + preconditioner DIC; + tolerance 1e-06; + relTol 0; + } + + "U.*" + { + solver smoothSolver; + smoother symGaussSeidel; + tolerance 1e-05; + relTol 0; + } +} + +PIMPLE +{ + nCorrectors 2; + nNonOrthogonalCorrectors 0; + pRefCell 0; + pRefValue 0; +} + + +// ************************************************************************* // diff --git a/tutorials/legacy/incompressible/dnsFoam/boxTurb16/constant/momentumTransport b/tutorials/legacy/incompressible/dnsFoam/boxTurb16/constant/momentumTransport index 9d7ced82f5..f8dbe4f694 100644 --- a/tutorials/legacy/incompressible/dnsFoam/boxTurb16/constant/momentumTransport +++ b/tutorials/legacy/incompressible/dnsFoam/boxTurb16/constant/momentumTransport @@ -14,13 +14,9 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -UOsigma 0.090295; - -UOalpha 0.81532; - -UOKupper 10; - -UOKlower 7; - +sigma 0.090295; +alpha 0.81532; +kUpper 10; +kLower 7; // ************************************************************************* //