diff --git a/applications/test/FixedList/FixedListTest.C b/applications/test/FixedList/FixedListTest.C index e46e910d3a266ad2359c272ab6d7ce250a13e7e5..97292f13636d07570f9aaef5f4170b4d924467a6 100644 --- a/applications/test/FixedList/FixedListTest.C +++ b/applications/test/FixedList/FixedListTest.C @@ -78,10 +78,7 @@ int main(int argc, char *argv[]) Serr<< "slave sending to master " << Pstream::masterNo() << endl; - OPstream toMaster - ( - Pstream::blocking, Pstream::masterNo(), IOstream::ASCII - ); + OPstream toMaster(Pstream::blocking, Pstream::masterNo()); FixedList<label, 2> list3; list3[0] = 0; @@ -98,10 +95,7 @@ int main(int argc, char *argv[]) ) { Serr << "master receiving from slave " << slave << endl; - IPstream fromSlave - ( - Pstream::blocking, slave, IOstream::ASCII - ); + IPstream fromSlave(Pstream::blocking, slave); FixedList<label, 2> list3(fromSlave); Serr<< list3 << endl; diff --git a/src/dynamicFvMesh/Make/files b/src/dynamicFvMesh/Make/files index 9e0a498750ba10ad0dc6324bb791cf8fc974cd1e..cf619024625aab50fd879899478586fd545ce184 100644 --- a/src/dynamicFvMesh/Make/files +++ b/src/dynamicFvMesh/Make/files @@ -11,5 +11,8 @@ $(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C $(solidBodyMotionFunctions)/solidBodyMotionFunction/newSolidBodyMotionFunction.C $(solidBodyMotionFunctions)/SDA/SDA.C $(solidBodyMotionFunctions)/SKA/SKA.C +$(solidBodyMotionFunctions)/linearMotion/linearMotion.C +$(solidBodyMotionFunctions)/rotationMotion/rotationMotion.C +$(solidBodyMotionFunctions)/multiMotion/multiMotion.C LIB = $(FOAM_LIBBIN)/libdynamicFvMesh diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C new file mode 100644 index 0000000000000000000000000000000000000000..8fbe323cf551094c0196cbf91e728c6c0462efa0 --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C @@ -0,0 +1,99 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "linearMotion.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace solidBodyMotionFunctions +{ + defineTypeNameAndDebug(linearMotion, 0); + addToRunTimeSelectionTable + ( + solidBodyMotionFunction, + linearMotion, + dictionary + ); +}; +}; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solidBodyMotionFunctions::linearMotion::linearMotion +( + const dictionary& SBMFCoeffs, + const Time& runTime +) +: + solidBodyMotionFunction(SBMFCoeffs, runTime) +{ + read(SBMFCoeffs); +} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // + +Foam::solidBodyMotionFunctions::linearMotion::~linearMotion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::septernion +Foam::solidBodyMotionFunctions::linearMotion::transformation() const +{ + scalar t = time_.value(); + + // Translation of centre of gravity with constant velocity + const vector displacement = velocity_*t; + + quaternion R(0, 0, 0); + septernion TR(septernion(displacement)*R); + + Info<< "solidBodyMotionFunctions::linearMotion::transformation(): " + << "Time = " << t << " transformation: " << TR << endl; + + return TR; +} + + +bool Foam::solidBodyMotionFunctions::linearMotion::read +( + const dictionary& SBMFCoeffs +) +{ + solidBodyMotionFunction::read(SBMFCoeffs); + + SBMFCoeffs_.lookup("velocity") >> velocity_; + + return true; +} + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H new file mode 100644 index 0000000000000000000000000000000000000000..08668af0e33c05f410fbbb3a9a6eb789d183511a --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::solidBodyMotionFunctions::linearMotion + +Description + SolidBodyMotionFvMesh 6DoF motion function. Constant velocity displacement. + +SourceFiles + linearMotion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef linearMotion_H +#define linearMotion_H + +#include "solidBodyMotionFunction.H" +#include "primitiveFields.H" +#include "point.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace solidBodyMotionFunctions +{ + +/*---------------------------------------------------------------------------*\ + Class linearMotion Declaration +\*---------------------------------------------------------------------------*/ + +class linearMotion +: + public solidBodyMotionFunction +{ + // Private data + + //- Linear velocity + vector velocity_; + + + // Private Member Functions + + //- Disallow copy construct + linearMotion(const linearMotion&); + + //- Disallow default bitwise assignment + void operator=(const linearMotion&); + + +public: + + //- Runtime type information + TypeName("linearMotion"); + + + // Constructors + + //- Construct from components + linearMotion + ( + const dictionary& SBMFCoeffs, + const Time& runTime + ); + + + // Destructor + + virtual ~linearMotion(); + + + // Member Functions + + //- Return the solid-body motion transformation septernion + virtual septernion transformation() const; + + //- Update properties from given dictionary + virtual bool read(const dictionary& SBMFCoeffs); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace solidBodyMotionFunctions +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C new file mode 100644 index 0000000000000000000000000000000000000000..028c95ecf7ddb6872c3ccb7215394bc7c0091037 --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "multiMotion.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace solidBodyMotionFunctions +{ + defineTypeNameAndDebug(multiMotion, 0); + addToRunTimeSelectionTable + ( + solidBodyMotionFunction, + multiMotion, + dictionary + ); +}; +}; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solidBodyMotionFunctions::multiMotion::multiMotion +( + const dictionary& SBMFCoeffs, + const Time& runTime +) +: + solidBodyMotionFunction(SBMFCoeffs, runTime) +{ + read(SBMFCoeffs); +} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // + +Foam::solidBodyMotionFunctions::multiMotion::~multiMotion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::septernion +Foam::solidBodyMotionFunctions::multiMotion::transformation() const +{ + scalar t = time_.value(); + + septernion TR = SBMFs_[0].transformation(); + + for (label i = 1; i < SBMFs_.size(); i++) + { + TR *= SBMFs_[i].transformation(); + } + + Info<< "solidBodyMotionFunctions::multiMotion::transformation(): " + << "Time = " << t << " transformation: " << TR << endl; + + return TR; +} + + +bool Foam::solidBodyMotionFunctions::multiMotion::read +( + const dictionary& SBMFCoeffs +) +{ + solidBodyMotionFunction::read(SBMFCoeffs); + + label i = 0; + SBMFs_.setSize(SBMFCoeffs_.size()); + + forAllConstIter(IDLList<entry>, SBMFCoeffs_, iter) + { + if (iter().isDict()) + { + SBMFs_.set + ( + i, + solidBodyMotionFunction::New(iter().dict(), time_) + ); + + Info<< "Constructed SBMF " << i << " : " + << iter().keyword() << " of type " + << SBMFs_[i].type() << endl; + + i++; + } + } + SBMFs_.setSize(i); + + return true; +} + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H new file mode 100644 index 0000000000000000000000000000000000000000..fea4a1de701554fc64955fa082fb0cf52028fe79 --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H @@ -0,0 +1,113 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::solidBodyMotionFunctions::multiMotion + +Description + Combination of SolidBodyMotionFvMesh 6DoF motion functions. + +SourceFiles + multiMotion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef multiMotion_H +#define multiMotion_H + +#include "solidBodyMotionFunction.H" +#include "primitiveFields.H" +#include "point.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace solidBodyMotionFunctions +{ + +/*---------------------------------------------------------------------------*\ + Class multiMotion Declaration +\*---------------------------------------------------------------------------*/ + +class multiMotion +: + public solidBodyMotionFunction +{ + // Private data + + //- Motions to combine + PtrList<solidBodyMotionFunction> SBMFs_; + + + // Private Member Functions + + //- Disallow copy construct + multiMotion(const multiMotion&); + + //- Disallow default bitwise assignment + void operator=(const multiMotion&); + + +public: + + //- Runtime type information + TypeName("multiMotion"); + + + // Constructors + + //- Construct from components + multiMotion + ( + const dictionary& SBMFCoeffs, + const Time& runTime + ); + + + // Destructor + + virtual ~multiMotion(); + + + // Member Functions + + //- Return the solid-body motion transformation septernion + virtual septernion transformation() const; + + //- Update properties from given dictionary + virtual bool read(const dictionary& SBMFCoeffs); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace solidBodyMotionFunctions +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotationMotion/rotationMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotationMotion/rotationMotion.C new file mode 100644 index 0000000000000000000000000000000000000000..d6a2131f0c1df15ebae94e964460d4377ba22557 --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotationMotion/rotationMotion.C @@ -0,0 +1,108 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "rotationMotion.H" +#include "addToRunTimeSelectionTable.H" +#include "mathConstants.H" + +using namespace Foam::constant::math; + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ +namespace solidBodyMotionFunctions +{ + defineTypeNameAndDebug(rotationMotion, 0); + addToRunTimeSelectionTable + ( + solidBodyMotionFunction, + rotationMotion, + dictionary + ); +}; +}; + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::solidBodyMotionFunctions::rotationMotion::rotationMotion +( + const dictionary& SBMFCoeffs, + const Time& runTime +) +: + solidBodyMotionFunction(SBMFCoeffs, runTime) +{ + read(SBMFCoeffs); +} + + +// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * // + +Foam::solidBodyMotionFunctions::rotationMotion::~rotationMotion() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +Foam::septernion +Foam::solidBodyMotionFunctions::rotationMotion::transformation() const +{ + scalar t = time_.value(); + + // Motion around a centre of gravity + + // Rotation around centre of gravity (in degrees) + vector eulerAngles = radialVelocity_*t; + + // Convert the rotational motion from deg to rad + eulerAngles *= pi/180.0; + + quaternion R(eulerAngles.x(), eulerAngles.y(), eulerAngles.z()); + septernion TR(septernion(CofG_)*R*septernion(-CofG_)); + + Info<< "solidBodyMotionFunctions::rotationMotion::transformation(): " + << "Time = " << t << " transformation: " << TR << endl; + + return TR; +} + + +bool Foam::solidBodyMotionFunctions::rotationMotion::read +( + const dictionary& SBMFCoeffs +) +{ + solidBodyMotionFunction::read(SBMFCoeffs); + + SBMFCoeffs_.lookup("CofG") >> CofG_; + SBMFCoeffs_.lookup("radialVelocity") >> radialVelocity_; + + return true; +} + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotationMotion/rotationMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotationMotion/rotationMotion.H new file mode 100644 index 0000000000000000000000000000000000000000..27ea7a6d18d78f23ed95b0d7e93900380032d70a --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotationMotion/rotationMotion.H @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::solidBodyMotionFunctions::rotationMotion + +Description + SolidBodyMotionFvMesh 6DoF motion function. Constant + velocity rotation around CoG. + +SourceFiles + rotationMotion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef rotationMotion_H +#define rotationMotion_H + +#include "solidBodyMotionFunction.H" +#include "primitiveFields.H" +#include "point.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace solidBodyMotionFunctions +{ + +/*---------------------------------------------------------------------------*\ + Class rotationMotion Declaration +\*---------------------------------------------------------------------------*/ + +class rotationMotion +: + public solidBodyMotionFunction +{ + // Private data + + //- Centre of gravity + point CofG_; + + //- Rotational velocity (deg/s) + vector radialVelocity_; + + + // Private Member Functions + + //- Disallow copy construct + rotationMotion(const rotationMotion&); + + //- Disallow default bitwise assignment + void operator=(const rotationMotion&); + + +public: + + //- Runtime type information + TypeName("rotationMotion"); + + + // Constructors + + //- Construct from components + rotationMotion + ( + const dictionary& SBMFCoeffs, + const Time& runTime + ); + + + // Destructor + + virtual ~rotationMotion(); + + + // Member Functions + + //- Return the solid-body motion transformation septernion + virtual septernion transformation() const; + + //- Update properties from given dictionary + virtual bool read(const dictionary& SBMFCoeffs); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace solidBodyMotionFunctions +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C index 7329c1dd905b3f7cc51d6fcdb6b347f1721bb26c..5420ba316453922b395fdf6518c35f00fd6bf6cc 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFvMesh.C @@ -83,14 +83,27 @@ Foam::solidBodyMotionFvMesh::~solidBodyMotionFvMesh() bool Foam::solidBodyMotionFvMesh::update() { + static bool hasWarned = false; + fvMesh::movePoints ( transform(SBMFPtr_().transformation(), undisplacedPoints_) ); - const_cast<volVectorField&>(lookupObject<volVectorField>("U")) - .correctBoundaryConditions(); + if (foundObject<volVectorField>("U")) + { + const_cast<volVectorField&>(lookupObject<volVectorField>("U")) + .correctBoundaryConditions(); + } + else if (!hasWarned) + { + hasWarned = true; + + WarningIn("solidBodyMotionFvMesh::update()") + << "Did not find volVectorField U." + << " Not updating U boundary conditions." << endl; + } return true; } diff --git a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C index 0e955075eb6c953943692015d5d27ac163980e6c..f6d778b3a6f68b8762725a8c798bc3c0f926bc56 100644 --- a/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C +++ b/src/turbulenceModels/incompressible/RAS/NonlinearKEShih/NonlinearKEShih.C @@ -195,7 +195,7 @@ NonlinearKEShih::NonlinearKEShih Cmu_(2.0/(3.0*(A1_ + eta_ + alphaKsi_*ksi_))), fEta_(A2_ + pow(eta_, 3.0)), - nut_(Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_)), + nut_("nut", Cmu_*sqr(k_)/(epsilon_ + epsilonSmall_)), nonlinearStress_ ( @@ -318,9 +318,12 @@ void NonlinearKEShih::correct() // generation term volScalarField S2 = symm(gradU_) && gradU_; - volScalarField G = + volScalarField G + ( + "RASModel::G", Cmu_*sqr(k_)/epsilon_*S2 - - (nonlinearStress_ && gradU_); + - (nonlinearStress_ && gradU_) + ); #include "nonLinearWallFunctionsI.H" diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/U b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/U new file mode 100644 index 0000000000000000000000000000000000000000..a1abb4874af6b1f8edd6e8ecd5344cd643f3cf5e --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/U @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volVectorField; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + walls + { + type movingWallVelocity; + value uniform (0 0 0); + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/alpha1.org b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/alpha1.org new file mode 100644 index 0000000000000000000000000000000000000000..fbbc61ac18ab37928e7755f25d050e956bf28f39 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/alpha1.org @@ -0,0 +1,29 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object alpha1; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type zeroGradient; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p new file mode 100644 index 0000000000000000000000000000000000000000..dd16aa2b670d12ba08f55fbf4b8e1ced78409351 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/p @@ -0,0 +1,30 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object p; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + walls + { + type buoyantPressure; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean new file mode 100755 index 0000000000000000000000000000000000000000..069278e17c3f8291ab35612a969daf394bd41af5 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean @@ -0,0 +1,4 @@ +#!/bin/sh + +foamCleanTutorials cases +rm -rf 0/alpha1.gz diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allrun b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allrun new file mode 100755 index 0000000000000000000000000000000000000000..aaf67a1250f3004b76290d95eaf7f5a2bc272dc8 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allrun @@ -0,0 +1,8 @@ +#!/bin/sh +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions + +runApplication blockMesh +cp 0/alpha1.org 0/alpha1 +runApplication setFields +runApplication interDyMFoam diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/RASProperties b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/RASProperties new file mode 100644 index 0000000000000000000000000000000000000000..daec182999be86b671bedf5742629f973ceefb51 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/RASProperties @@ -0,0 +1,25 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object RASProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +RASModel laminar; + +turbulence off; + +printCoeffs on; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/dynamicMeshDict b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/dynamicMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..17ea97ec1fb5ce8e6ef5899e375a7d7bd35f99c9 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/dynamicMeshDict @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object dynamicMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dynamicFvMesh solidBodyMotionFvMesh; + +solidBodyMotionFvMeshCoeffs +{ + solidBodyMotionFunction multiMotion; + + multiMotionCoeffs + { + // Table rotating in z axis + rotatingTable + { + solidBodyMotionFunction rotationMotion; + rotationMotionCoeffs + { + CofG (0 0.1 0); + radialVelocity (0 0 360); // degrees/s + } + } + + // Box rotates on rotating table + rotatingBox + { + solidBodyMotionFunction rotationMotion; + rotationMotionCoeffs + { + CofG (0 0 0); + radialVelocity (720 0 0); // degrees/s + } + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/g b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/g new file mode 100644 index 0000000000000000000000000000000000000000..317bdd50defb2d1a2717ce5c7b4467cf9fd14264 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/g @@ -0,0 +1,22 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class uniformDimensionedVectorField; + location "constant"; + object g; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -2 0 0 0 0]; +value ( 0 0 -9.81 ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/polyMesh/blockMeshDict new file mode 100644 index 0000000000000000000000000000000000000000..ed9075c3ac5c9b96088110e814a61e8b83a2fd06 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/polyMesh/blockMeshDict @@ -0,0 +1,54 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + object blockMeshDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +convertToMeters 0.01; + +vertices +( + (-0.5 -5 -0.5) + ( 0.5 -5 -0.5) + ( 0.5 5 -0.5) + (-0.5 5 -0.5) + (-0.5 -5 0.5) + ( 0.5 -5 0.5) + ( 0.5 5 0.5) + (-0.5 5 0.5) +); + +blocks +( + hex (0 1 2 3 4 5 6 7) (5 50 5) simpleGrading (1 1 1) +); + +edges +( +); + +patches +( + wall walls + ( + (3 7 6 2) + (0 4 7 3) + (2 6 5 1) + (1 5 4 0) + (0 3 2 1) + (4 5 6 7) + ) +); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/transportProperties b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/transportProperties new file mode 100644 index 0000000000000000000000000000000000000000..6a2e70e1c4280ebd53d4ada91293b41d817271f6 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/transportProperties @@ -0,0 +1,35 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object transportProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +phase1 +{ + transportModel Newtonian; + nu nu [ 0 2 -1 0 0 0 0 ] 1e-06; + rho rho [ 1 -3 0 0 0 0 0 ] 998.2; +} + +phase2 +{ + transportModel Newtonian; + nu nu [ 0 2 -1 0 0 0 0 ] 1.48e-05; + rho rho [ 1 -3 0 0 0 0 0 ] 1; +} + +sigma sigma [ 1 0 -2 0 0 0 0 ] 0; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/turbulenceProperties b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/turbulenceProperties new file mode 100644 index 0000000000000000000000000000000000000000..9cfc50a3d927937cf2ce96c64d3c9d6bd3144e2c --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/constant/turbulenceProperties @@ -0,0 +1,21 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object turbulenceProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +simulationType laminar; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/controlDict b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/controlDict new file mode 100644 index 0000000000000000000000000000000000000000..a36fa8f84890ec89143e2b7af7bbdf761e066f65 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/controlDict @@ -0,0 +1,57 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object controlDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +libs ("libOpenFOAM.so" "libmySolidBodyMotionFunctions.so"); + +application interDyMFoam; + +startFrom startTime; + +startTime 0; + +stopAt endTime; + +endTime 1; + +deltaT 0.0001; + +writeControl adjustableRunTime; + +writeInterval 0.01; + +purgeWrite 0; + +writeFormat ascii; + +writePrecision 6; + +writeCompression compressed; + +timeFormat general; + +timePrecision 6; + +runTimeModifiable yes; + +adjustTimeStep yes; + +maxCo 0.5; + +maxDeltaT 1; + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/decomposeParDict b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/decomposeParDict new file mode 100644 index 0000000000000000000000000000000000000000..9cbe72150147e49c283d8042b5924dc143772efd --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/decomposeParDict @@ -0,0 +1,50 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object decomposeParDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +numberOfSubdomains 16; + +method hierarchical; + +simpleCoeffs +{ + n ( 2 2 1 ); + delta 0.001; +} + +hierarchicalCoeffs +{ + n ( 4 2 2 ); + delta 0.001; + order xyz; +} + +metisCoeffs +{ + processorWeights ( 1 1 1 1 ); +} + +manualCoeffs +{ + dataFile ""; +} + +distributed no; + +roots ( ); + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes new file mode 100644 index 0000000000000000000000000000000000000000..7c651353ff5bd2258bf2350fa720c3bb622eab32 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSchemes @@ -0,0 +1,59 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSchemes; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +ddtSchemes +{ + default Euler; +} + +gradSchemes +{ + default Gauss linear; +} + +divSchemes +{ + div(rho*phi,U) Gauss vanLeerV; + div(phi,alpha) Gauss vanLeer; + div(phirb,alpha) Gauss vanLeer; +} + +laplacianSchemes +{ + default Gauss linear corrected; +} + +interpolationSchemes +{ + default linear; +} + +snGradSchemes +{ + default corrected; +} + +fluxRequired +{ + default no; + p; + pcorr; + alpha; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSolution b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSolution new file mode 100644 index 0000000000000000000000000000000000000000..ee41a9bc7361aab5d200decd7e87d442cd543a61 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/fvSolution @@ -0,0 +1,112 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object fvSolution; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +solvers +{ + pcorr + { + solver PCG; + preconditioner + { + preconditioner GAMG; + tolerance 1e-05; + relTol 0; + smoother DICGaussSeidel; + nPreSweeps 0; + nPostSweeps 2; + nBottomSweeps 2; + cacheAgglomeration false; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + tolerance 1e-05; + relTol 0; + maxIter 100; + } + + p + { + solver GAMG; + tolerance 1e-08; + relTol 0.01; + smoother DIC; + nPreSweeps 0; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + pFinal + { + solver PCG; + preconditioner + { + preconditioner GAMG; + tolerance 2e-09; + relTol 0; + nVcycles 2; + smoother DICGaussSeidel; + nPreSweeps 2; + nPostSweeps 2; + nFinestSweeps 2; + cacheAgglomeration true; + nCellsInCoarsestLevel 10; + agglomerator faceAreaPair; + mergeLevels 1; + } + + tolerance 2e-09; + relTol 0; + maxIter 20; + } + + U + { + solver smoothSolver; + smoother GaussSeidel; + tolerance 1e-06; + relTol 0; + nSweeps 1; + } +} + +PISO +{ + momentumPredictor no; + nCorrectors 2; + nNonOrthogonalCorrectors 0; + nAlphaCorr 1; + nAlphaSubCycles 3; + cAlpha 1.5; + correctPhi no; + + pRefPoint (0.0013 0.0017 0.0017); + pRefValue 1e5; +} + +relaxationFactors +{ + U 1; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/setFieldsDict b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/setFieldsDict new file mode 100644 index 0000000000000000000000000000000000000000..000870b80b28747eb26de2f1aa1df9df36884851 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/system/setFieldsDict @@ -0,0 +1,33 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "system"; + object setFieldsDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defaultFieldValues +( + volScalarFieldValue alpha1 0 +); + +regions +( + boxToCell + { + box ( -100 -100 -100 ) ( 100 -0.02 100); + fieldValues ( volScalarFieldValue alpha1 1 ); + } +); + + +// ************************************************************************* //