diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C index 2d2e1f6551..179903b082 100644 --- a/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C +++ b/applications/solvers/multiphase/twoPhaseEulerFoam/phaseIncompressibleTurbulenceModels/kineticTheoryModels/conductivityModel/HrenyaSinclair/HrenyaSinclairConductivity.C @@ -91,7 +91,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa return da*sqrt(Theta)* ( 2.0*sqr(alpha1)*g0*(1.0 + e)/sqrtPi - + (9.0/8.0)*sqrtPi*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha1) + + (9.0/8.0)*sqrtPi*g0*0.25*sqr(1.0 + e)*(2.0*e - 1.0)*sqr(alpha1) /(49.0/16.0 - 33.0*e/16.0) + (15.0/16.0)*sqrtPi*alpha1*(0.5*sqr(e) + 0.25*e - 0.75 + lamda) /((49.0/16.0 - 33.0*e/16.0)*lamda) diff --git a/applications/utilities/mesh/advanced/combinePatchFaces/Make/options b/applications/utilities/mesh/advanced/combinePatchFaces/Make/options index 4f26f666de..3da3443a27 100644 --- a/applications/utilities/mesh/advanced/combinePatchFaces/Make/options +++ b/applications/utilities/mesh/advanced/combinePatchFaces/Make/options @@ -1,9 +1,9 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \ EXE_LIBS = \ - -lmeshTools \ - -lsampling \ + -lfiniteVolume \ -ldynamicMesh diff --git a/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C b/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C index fcb38fb9a5..05c27a15df 100644 --- a/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C +++ b/applications/utilities/mesh/conversion/foamMeshToFluent/fluentFvMesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,6 +33,7 @@ using std::ios; #include "fluentFvMesh.H" #include "primitiveMesh.H" #include "wallFvPatch.H" +#include "symmetryPlaneFvPatch.H" #include "symmetryFvPatch.H" #include "cellModeller.H" @@ -177,7 +178,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const { fluentMeshFile << 3; } - else if (isA(boundary()[patchI])) + else if + ( + isA(boundary()[patchI]) + || isA(boundary()[patchI]) + ) { fluentMeshFile << 7; } @@ -280,7 +285,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const { fluentMeshFile << "wall "; } - else if (isA(boundary()[patchI])) + else if + ( + isA(boundary()[patchI]) + || isA(boundary()[patchI]) + ) { fluentMeshFile << "symmetry "; } diff --git a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict index 507891d356..87922d974d 100644 --- a/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict +++ b/applications/utilities/mesh/generation/snappyHexMesh/snappyHexMeshDict @@ -401,7 +401,7 @@ addLayersControls // Angle used to pick up medial axis points // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 // in 17x. - minMedianAxisAngle 90; + minMedialAxisAngle 90; // Reduce layer growth where ratio thickness to medial // distance is large @@ -414,6 +414,9 @@ addLayersControls // default is 0. nSmoothDisplacement 90; + // Optional: limit the number of steps walking away from the surface + nMedialAxisIter 10; + // Mesh shrinking diff --git a/applications/utilities/mesh/manipulation/checkMesh/Make/options b/applications/utilities/mesh/manipulation/checkMesh/Make/options index 70c838b774..2ff5dbabfe 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/Make/options +++ b/applications/utilities/mesh/manipulation/checkMesh/Make/options @@ -1,5 +1,6 @@ EXE_INC = \ -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude EXE_LIBS = \ diff --git a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C index bc0e78a67f..cdbe770d1a 100644 --- a/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C +++ b/applications/utilities/mesh/manipulation/createBaffles/createBaffles.C @@ -619,19 +619,41 @@ int main(int argc, char *argv[]) const word masterName = groupName + "_master"; const word slaveName = groupName + "_slave"; - dictionary patchDict = patchSource; - patchDict.set("nFaces", 0); - patchDict.set("startFace", 0); - patchDict.set("coupleGroup", groupName); + word groupNameMaster = groupName; + word groupNameSlave = groupName; - addPatch(mesh, masterName, groupName, patchDict); - addPatch(mesh, slaveName, groupName, patchDict); + + dictionary patchDictMaster(patchSource); + patchDictMaster.set("nFaces", 0); + patchDictMaster.set("startFace", 0); + patchDictMaster.set("coupleGroup", groupName); + + dictionary patchDictSlave(patchDictMaster); + + // Note: This is added for the particular case where we want + // master and slave in different groupNames + // (ie 3D thermal baffles) + bool groupBase = false; + if (patchSource.found("groupBase")) + { + groupBase = readBool(patchSource.lookup("groupBase")); + + if (groupBase) + { + groupNameMaster = groupName + "Group_master"; + groupNameSlave = groupName + "Group_slave"; + patchDictMaster.set("coupleGroup", groupNameMaster); + patchDictSlave.set("coupleGroup", groupNameSlave); + } + } + + addPatch(mesh, masterName, groupNameMaster, patchDictMaster); + addPatch(mesh, slaveName, groupNameSlave, patchDictSlave); } } } - // Make sure patches and zoneFaces are synchronised across couples mesh.boundaryMesh().checkParallelSync(true); mesh.faceZones().checkParallelSync(true); @@ -793,6 +815,12 @@ int main(int argc, char *argv[]) else { const dictionary& patchSource = dict.subDict("patchPairs"); + bool groupBase = false; + if (patchSource.found("groupBase")) + { + groupBase = readBool(patchSource.lookup("groupBase")); + } + const word& groupName = selectors[selectorI].name(); if (patchSource.found("patchFields")) @@ -801,23 +829,51 @@ int main(int argc, char *argv[]) ( "patchFields" ); - // Add coupleGroup to all entries - forAllIter(dictionary, patchFieldsDict, iter) + + if (!groupBase) { - if (iter().isDict()) + // Add coupleGroup to all entries + forAllIter(dictionary, patchFieldsDict, iter) { - dictionary& dict = iter().dict(); - dict.set("coupleGroup", groupName); + if (iter().isDict()) + { + dictionary& dict = iter().dict(); + dict.set("coupleGroup", groupName); + } + } + + const labelList& patchIDs = + pbm.groupPatchIDs()[groupName]; + + forAll(patchIDs, i) + { + fvMeshTools::setPatchFields + ( + mesh, + patchIDs[i], + patchFieldsDict + ); } } - - const labelList& patchIDs = pbm.groupPatchIDs()[groupName]; - forAll(patchIDs, i) + else { + const word masterPatchName(groupName + "_master"); + const word slavePatchName(groupName + "_slave"); + + label patchIMaster = pbm.findPatchID(masterPatchName); + label patchISlave = pbm.findPatchID(slavePatchName); + fvMeshTools::setPatchFields ( mesh, - patchIDs[i], + patchIMaster, + patchFieldsDict + ); + + fvMeshTools::setPatchFields + ( + mesh, + patchISlave, patchFieldsDict ); } diff --git a/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C b/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C index 375e38961b..ebaf8737b8 100644 --- a/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C +++ b/applications/utilities/mesh/manipulation/objToVTK/objToVTK.C @@ -210,6 +210,14 @@ int main(int argc, char *argv[]) outFile << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; } + outFile + << "VERTICES " << points.size() << ' ' << (2 * points.size()) << nl; + + forAll(points, i) + { + outFile << 1 << ' ' << i << nl; + } + label nItems = 0; forAll(polyLines, polyI) { diff --git a/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C b/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C index de9af38b87..11874fe2ea 100644 --- a/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C +++ b/applications/utilities/postProcessing/velocityField/streamFunction/streamFunction.C @@ -33,6 +33,7 @@ Description #include "fvCFD.H" #include "pointFields.H" #include "emptyPolyPatch.H" +#include "symmetryPlanePolyPatch.H" #include "symmetryPolyPatch.H" #include "wedgePolyPatch.H" #include "OSspecific.H" @@ -286,6 +287,8 @@ int main(int argc, char *argv[]) ( !isType (patches[patchNo]) + && !isType + (patches[patchNo]) && !isType (patches[patchNo]) && !isType diff --git a/bin/foamJob b/bin/foamJob index 4eda40490e..20793c3d52 100755 --- a/bin/foamJob +++ b/bin/foamJob @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -50,6 +50,28 @@ USAGE exit 1 } +#for being able to echo strings that have single quotes +echoArgs() { + addSpace="" + + for stringItem in "$@"; do + + echo -n "${addSpace}" + + if [ "${stringItem##* }" = "$stringItem" ] + then + echo -n "$stringItem" + addSpace=" " + else + echo -n "'$stringItem'" + addSpace=" " + fi + + done + + unset stringItem addSpace +} + unset version # replacement for possibly buggy 'which' @@ -217,11 +239,11 @@ then # if [ "$screenOpt" = true ] then - echo "Executing: $mpirun $mpiopts $APPLICATION $@ -parallel | tee log" - $mpirun $mpiopts $APPLICATION $@ -parallel | tee log + echo "Executing: $mpirun $mpiopts $APPLICATION $(echoArgs "$@") -parallel | tee log" + $mpirun $mpiopts $APPLICATION "$@" -parallel | tee log else - echo "Executing: $mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1" - $mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1 & + echo "Executing: $mpirun $mpiopts $APPLICATION $(echoArgs "$@") -parallel > log 2>&1" + $mpirun $mpiopts $APPLICATION "$@" -parallel > log 2>&1 & fi else @@ -230,12 +252,12 @@ else # if [ "$screenOpt" = true ] then - echo "Executing: $APPLICATION $@ | tee log &" - $APPLICATION $@ | tee log & + echo "Executing: $APPLICATION $(echoArgs "$@") | tee log &" + $APPLICATION "$@" | tee log & wait $! else - echo "Executing: $APPLICATION $@ > log 2>&1 &" - $APPLICATION $@ > log 2>&1 & + echo "Executing: $APPLICATION $(echoArgs "$@") > log 2>&1 &" + $APPLICATION "$@" > log 2>&1 & fi fi diff --git a/etc/caseDicts/setConstraintTypes b/etc/caseDicts/setConstraintTypes index 1678e2a147..6b075c7382 100644 --- a/etc/caseDicts/setConstraintTypes +++ b/etc/caseDicts/setConstraintTypes @@ -51,6 +51,11 @@ symmetryPlane type symmetryPlane; } +symmetry +{ + type symmetry; +} + wedge { type wedge; diff --git a/etc/controlDict b/etc/controlDict index 8f811534dc..68d8f86a44 100644 --- a/etc/controlDict +++ b/etc/controlDict @@ -813,6 +813,7 @@ DebugSwitches symmTensorAverageField 0; symmTensorField 0; symmetryPlane 0; + symmetry 0; syringePressure 0; tensorAverageField 0; tensorField 0; diff --git a/src/Allwmake b/src/Allwmake index bafcd93df7..fa091ed845 100755 --- a/src/Allwmake +++ b/src/Allwmake @@ -81,4 +81,6 @@ wmake $makeType regionCoupled postProcessing/Allwmake $* +wmake $makeType sixDoFRigidBodyMotion + # ----------------------------------------------------------------- end-of-file diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files index 0e1224505b..42be066ee2 100644 --- a/src/OpenFOAM/Make/files +++ b/src/OpenFOAM/Make/files @@ -411,6 +411,7 @@ $(constraintPolyPatches)/empty/emptyPolyPatch.C $(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C $(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C $(constraintPolyPatches)/processor/processorPolyPatch.C +$(constraintPolyPatches)/symmetryPlane/symmetryPlanePolyPatch.C $(constraintPolyPatches)/symmetry/symmetryPolyPatch.C $(constraintPolyPatches)/wedge/wedgePolyPatch.C @@ -530,6 +531,7 @@ $(constraintPointPatches)/empty/emptyPointPatch.C $(constraintPointPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C $(constraintPointPatches)/processor/processorPointPatch.C $(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C +$(constraintPointPatches)/symmetryPlane/symmetryPlanePointPatch.C $(constraintPointPatches)/symmetry/symmetryPointPatch.C $(constraintPointPatches)/wedge/wedgePointPatch.C @@ -599,6 +601,7 @@ $(constraintPointPatchFields)/empty/emptyPointPatchFields.C $(constraintPointPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchFields.C $(constraintPointPatchFields)/processor/processorPointPatchFields.C $(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.C +$(constraintPointPatchFields)/symmetryPlane/symmetryPlanePointPatchFields.C $(constraintPointPatchFields)/symmetry/symmetryPointPatchFields.C $(constraintPointPatchFields)/wedge/wedgePointPatchFields.C diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.C b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.C new file mode 100644 index 0000000000..b91c965e92 --- /dev/null +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.C @@ -0,0 +1,149 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlanePointPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +symmetryPlanePointPatchField::symmetryPlanePointPatchField +( + const pointPatch& p, + const DimensionedField& iF +) +: + basicSymmetryPointPatchField(p, iF), + symmetryPlanePatch_(refCast(p)) +{} + + +template +symmetryPlanePointPatchField::symmetryPlanePointPatchField +( + const pointPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + basicSymmetryPointPatchField(p, iF, dict), + symmetryPlanePatch_(refCast(p)) +{ + if (!isType(p)) + { + FatalIOErrorIn + ( + "symmetryPlanePointPatchField::symmetryPlanePointPatchField\n" + "(\n" + " const pointPatch& p,\n" + " const Field& field,\n" + " const dictionary& dict\n" + ")\n", + dict + ) << "patch " << this->patch().index() << " not symmetry type. " + << "Patch type = " << p.type() + << exit(FatalIOError); + } +} + + +template +symmetryPlanePointPatchField::symmetryPlanePointPatchField +( + const symmetryPlanePointPatchField& ptf, + const pointPatch& p, + const DimensionedField& iF, + const pointPatchFieldMapper& mapper +) +: + basicSymmetryPointPatchField(ptf, p, iF, mapper), + symmetryPlanePatch_(refCast(p)) +{ + if (!isType(this->patch())) + { + FatalErrorIn + ( + "symmetryPlanePointPatchField::symmetryPlanePointPatchField\n" + "(\n" + " const symmetryPlanePointPatchField& ptf,\n" + " const pointPatch& p,\n" + " const DimensionedField& iF,\n" + " const pointPatchFieldMapper& mapper\n" + ")\n" + ) << "Field type does not correspond to patch type for patch " + << this->patch().index() << "." << endl + << "Field type: " << typeName << endl + << "Patch type: " << this->patch().type() + << exit(FatalError); + } +} + + +template +symmetryPlanePointPatchField::symmetryPlanePointPatchField +( + const symmetryPlanePointPatchField& ptf, + const DimensionedField& iF +) +: + basicSymmetryPointPatchField(ptf, iF), + symmetryPlanePatch_(ptf.symmetryPlanePatch_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::symmetryPlanePointPatchField::evaluate +( + const Pstream::commsTypes +) +{ + vector nHat = symmetryPlanePatch_.n(); + + tmp > tvalues = + ( + ( + this->patchInternalField() + + transform(I - 2.0*sqr(nHat), this->patchInternalField()) + )/2.0 + ); + + // Get internal field to insert values into + Field& iF = const_cast&>(this->internalField()); + + this->setInInternalField(iF, tvalues()); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.H new file mode 100644 index 0000000000..c3774789d8 --- /dev/null +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchField.H @@ -0,0 +1,161 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::symmetryPlanePointPatchField + +Description + A symmetry-plane boundary condition for pointField + +SourceFiles + symmetryPlanePointPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlanePointPatchField_H +#define symmetryPlanePointPatchField_H + +#include "basicSymmetryPointPatchField.H" +#include "symmetryPlanePointPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class symmetryPlanePointPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class symmetryPlanePointPatchField +: + public basicSymmetryPointPatchField +{ + // Private data + + //- Local reference cast into the symmetryPlane patch + const symmetryPlanePointPatch& symmetryPlanePatch_; + + +public: + + //- Runtime type information + TypeName(symmetryPlanePointPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + symmetryPlanePointPatchField + ( + const pointPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + symmetryPlanePointPatchField + ( + const pointPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given patchField onto a new patch + symmetryPlanePointPatchField + ( + const symmetryPlanePointPatchField&, + const pointPatch&, + const DimensionedField&, + const pointPatchFieldMapper& + ); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new symmetryPlanePointPatchField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + symmetryPlanePointPatchField + ( + const symmetryPlanePointPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual autoPtr > clone + ( + const DimensionedField& iF + ) const + { + return autoPtr > + ( + new symmetryPlanePointPatchField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Return the constraint type this pointPatchField implements + virtual const word& constraintType() const + { + return symmetryPlanePointPatch::typeName; + } + + // Evaluation functions + + //- Update the patch field + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "symmetryPlanePointPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchFields.C b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchFields.C new file mode 100644 index 0000000000..2317f09735 --- /dev/null +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlanePointPatchFields.H" +#include "pointPatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePointPatchFields(symmetryPlane); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchFields.H b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchFields.H new file mode 100644 index 0000000000..61e35ee4fe --- /dev/null +++ b/src/OpenFOAM/fields/pointPatchFields/constraint/symmetryPlane/symmetryPlanePointPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlanePointPatchFields_H +#define symmetryPlanePointPatchFields_H + +#include "symmetryPlanePointPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePointPatchFieldTypedefs(symmetryPlane); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.H b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.H index d39ecb10a8..0bc3fb389e 100644 --- a/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.H +++ b/src/OpenFOAM/matrices/LduMatrix/LduMatrix/SolverPerformance.H @@ -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) 2012-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,9 +25,8 @@ Class Foam::SolverPerformance Description - SolverPerformance is a general matrix class in which the coefficients are - stored as three arrays, one for the upper triangle, one for the - lower triangle and a third for the diagonal. + SolverPerformance is the class returned by the LduMatrix solver + containing performance statistics. SourceFiles SolverPerformance.C @@ -72,13 +71,10 @@ Ostream& operator<< ); - /*---------------------------------------------------------------------------*\ Class SolverPerformance Declaration \*---------------------------------------------------------------------------*/ -//- Class returned by the solver -// containing performance statistics template class SolverPerformance { diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.C b/src/OpenFOAM/meshes/pointMesh/pointMesh.C index de6f88d16c..c00c67cdb0 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.C +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.C @@ -88,6 +88,20 @@ Foam::pointMesh::pointMesh(const polyMesh& pMesh) } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::pointMesh::~pointMesh() +{ + if (debug) + { + Pout<< "~pointMesh::pointMesh()" + << endl; + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + bool Foam::pointMesh::movePoints() { if (debug) diff --git a/src/OpenFOAM/meshes/pointMesh/pointMesh.H b/src/OpenFOAM/meshes/pointMesh/pointMesh.H index e6ac279761..28180b1252 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointMesh.H +++ b/src/OpenFOAM/meshes/pointMesh/pointMesh.H @@ -85,6 +85,10 @@ public: explicit pointMesh(const polyMesh& pMesh); + //- Destructor + ~pointMesh(); + + // Member Functions //- Return number of points diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetry/symmetryPointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetry/symmetryPointPatch.H index 9904119521..35cf991cb9 100644 --- a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetry/symmetryPointPatch.H +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetry/symmetryPointPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,11 +25,14 @@ Class Foam::symmetryPointPatch Description - Symmetry-plane patch. + Symmetry patch for non-planar or multi-plane patches. SourceFiles symmetryPointPatch.C +SeeAlso + symmetryPlanePointPatch + \*---------------------------------------------------------------------------*/ #ifndef symmetryPointPatch_H diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetryPlane/symmetryPlanePointPatch.C b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetryPlane/symmetryPlanePointPatch.C new file mode 100644 index 0000000000..f8f70537e9 --- /dev/null +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetryPlane/symmetryPlanePointPatch.C @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlanePointPatch.H" +#include "pointConstraint.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(symmetryPlanePointPatch, 0); + + // Add the patch constructor functions to the hash tables + addToRunTimeSelectionTable + ( + facePointPatch, + symmetryPlanePointPatch, + polyPatch + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::symmetryPlanePointPatch::symmetryPlanePointPatch +( + const polyPatch& patch, + const pointBoundaryMesh& bm +) +: + facePointPatch(patch, bm), + symmetryPlanePolyPatch_(refCast(patch)) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::symmetryPlanePointPatch::applyConstraint +( + const label, + pointConstraint& pc +) const +{ + pc.applyConstraint(symmetryPlanePolyPatch_.n()); +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetryPlane/symmetryPlanePointPatch.H b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetryPlane/symmetryPlanePointPatch.H new file mode 100644 index 0000000000..a791d3828f --- /dev/null +++ b/src/OpenFOAM/meshes/pointMesh/pointPatches/constraint/symmetryPlane/symmetryPlanePointPatch.H @@ -0,0 +1,107 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::symmetryPlanePointPatch + +Description + Symmetry-plane patch. + +SourceFiles + symmetryPlanePointPatch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlanePointPatch_H +#define symmetryPlanePointPatch_H + +#include "facePointPatch.H" +#include "symmetryPlanePolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class symmetryPlanePointPatch Declaration +\*---------------------------------------------------------------------------*/ + +class symmetryPlanePointPatch +: + public facePointPatch +{ + // Private data + + //- Local reference cast into the symmetryPlane patch + const symmetryPlanePolyPatch& symmetryPlanePolyPatch_; + + +public: + + //- Runtime type information + TypeName(symmetryPlanePolyPatch::typeName_()); + + + // Constructors + + //- Construct from polyPatch + symmetryPlanePointPatch + ( + const polyPatch& patch, + const pointBoundaryMesh& bm + ); + + + // Member Functions + + //- Return the constraint type this pointPatch implements. + virtual const word& constraintType() const + { + return type(); + } + + //- Accumulate the effect of constraint direction of this patch + virtual void applyConstraint + ( + const label pointi, + pointConstraint& + ) const; + + //- Return symmetry plane normal + const vector& n() const + { + return symmetryPlanePolyPatch_.n(); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.H index 9df659518f..c07f46eb69 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetry/symmetryPolyPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,11 +25,14 @@ Class Foam::symmetryPolyPatch Description - Symmetry-plane patch. + Symmetry patch for non-planar or multi-plane patches. SourceFiles symmetryPolyPatch.C +SeeAlso + symmetryPlanePolyPatch + \*---------------------------------------------------------------------------*/ #ifndef symmetryPolyPatch_H @@ -53,7 +56,7 @@ class symmetryPolyPatch public: //- Runtime type information - TypeName("symmetryPlane"); + TypeName("symmetry"); // Constructors diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.C new file mode 100644 index 0000000000..49b48f8df7 --- /dev/null +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.C @@ -0,0 +1,136 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlanePolyPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(symmetryPlanePolyPatch, 0); + + addToRunTimeSelectionTable(polyPatch, symmetryPlanePolyPatch, word); + addToRunTimeSelectionTable(polyPatch, symmetryPlanePolyPatch, dictionary); +} + +// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * // + +Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch +( + const word& name, + const label size, + const label start, + const label index, + const polyBoundaryMesh& bm, + const word& patchType +) +: + polyPatch(name, size, start, index, bm, patchType), + n_(vector::zero) +{} + + +Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch +( + const word& name, + const dictionary& dict, + const label index, + const polyBoundaryMesh& bm, + const word& patchType +) +: + polyPatch(name, dict, index, bm, patchType), + n_(vector::zero) +{} + + +Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch +( + const symmetryPlanePolyPatch& pp, + const polyBoundaryMesh& bm +) +: + polyPatch(pp, bm), + n_(vector::zero) +{} + + +Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch +( + const symmetryPlanePolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const label newSize, + const label newStart +) +: + polyPatch(pp, bm, index, newSize, newStart), + n_(vector::zero) +{} + + +Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch +( + const symmetryPlanePolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const labelUList& mapAddressing, + const label newStart +) +: + polyPatch(pp, bm, index, mapAddressing, newStart), + n_(vector::zero) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::vector& Foam::symmetryPlanePolyPatch::n() const +{ + // If the symmetry normal is not set calculate it + // as the average face-normal + if (magSqr(n_) < 0.5) + { + const vectorField& nf(faceNormals()); + n_ = gAverage(nf); + + // Check the symmetry plane is planar + forAll(nf, facei) + { + if (magSqr(n_ - nf[facei]) > SMALL) + { + FatalErrorIn("symmetryPlanePolyPatch::n()") + << "Symmetry plane '" << name() << "' is not planar" + << exit(FatalError); + } + } + } + + return n_; +} + + +// ************************************************************************* // diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.H new file mode 100644 index 0000000000..81b8afcd72 --- /dev/null +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/symmetryPlane/symmetryPlanePolyPatch.H @@ -0,0 +1,177 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::symmetryPlanePolyPatch + +Description + Symmetry-plane patch. + +SourceFiles + symmetryPlanePolyPatch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlanePolyPatch_H +#define symmetryPlanePolyPatch_H + +#include "polyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class symmetryPlanePolyPatch Declaration +\*---------------------------------------------------------------------------*/ + +class symmetryPlanePolyPatch +: + public polyPatch +{ + // Private data + + //- Symmetry plane normal (calculated on demand) + mutable vector n_; + + +public: + + //- Runtime type information + TypeName("symmetryPlane"); + + + // Constructors + + //- Construct from components + symmetryPlanePolyPatch + ( + const word& name, + const label size, + const label start, + const label index, + const polyBoundaryMesh& bm, + const word& patchType + ); + + //- Construct from dictionary + symmetryPlanePolyPatch + ( + const word& name, + const dictionary& dict, + const label index, + const polyBoundaryMesh& bm, + const word& patchType + ); + + //- Construct as copy, resetting the boundary mesh + symmetryPlanePolyPatch + ( + const symmetryPlanePolyPatch&, + const polyBoundaryMesh& + ); + + //- Construct given the original patch and resetting the + // face list and boundary mesh information + symmetryPlanePolyPatch + ( + const symmetryPlanePolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const label newSize, + const label newStart + ); + + //- Construct given the original patch and a map + symmetryPlanePolyPatch + ( + const symmetryPlanePolyPatch& pp, + const polyBoundaryMesh& bm, + const label index, + const labelUList& mapAddressing, + const label newStart + ); + + //- Construct and return a clone, resetting the boundary mesh + virtual autoPtr clone(const polyBoundaryMesh& bm) const + { + return autoPtr(new symmetryPlanePolyPatch(*this, bm)); + } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr clone + ( + const polyBoundaryMesh& bm, + const label index, + const label newSize, + const label newStart + ) const + { + return autoPtr + ( + new symmetryPlanePolyPatch(*this, bm, index, newSize, newStart) + ); + } + + //- Construct and return a clone, resetting the face list + // and boundary mesh + virtual autoPtr clone + ( + const polyBoundaryMesh& bm, + const label index, + const labelUList& mapAddressing, + const label newStart + ) const + { + return autoPtr + ( + new symmetryPlanePolyPatch + ( + *this, + bm, + index, + mapAddressing, + newStart + ) + ); + } + + + // Member Functions + + //- Return symmetry plane normal + const vector& n() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/OpenFOAM/primitives/septernion/septernion.C b/src/OpenFOAM/primitives/septernion/septernion.C index ffac2bd609..67cae051fd 100644 --- a/src/OpenFOAM/primitives/septernion/septernion.C +++ b/src/OpenFOAM/primitives/septernion/septernion.C @@ -59,6 +59,17 @@ Foam::word Foam::name(const septernion& s) } +Foam::septernion Foam::slerp +( + const septernion& qa, + const septernion& qb, + const scalar t +) +{ + return septernion((1.0-t)*qa.t()+t*qb.t(), slerp(qa.r(), qb.r(), t)); +} + + // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // Foam::Istream& Foam::operator>>(Istream& is, septernion& s) diff --git a/src/OpenFOAM/primitives/septernion/septernion.H b/src/OpenFOAM/primitives/septernion/septernion.H index 03253ed7b9..b6a672f3ec 100644 --- a/src/OpenFOAM/primitives/septernion/septernion.H +++ b/src/OpenFOAM/primitives/septernion/septernion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -157,6 +157,13 @@ inline septernion inv(const septernion& tr); //- Return a string representation of a septernion word name(const septernion&); +//- Spherical linear interpolation of septernions. 0 for qa, 1 for qb +septernion slerp +( + const septernion& qa, + const septernion& qb, + const scalar t +); //- Data associated with septernion type are contiguous template<> diff --git a/src/TurbulenceModels/Allwmake b/src/TurbulenceModels/Allwmake index 561610c0ce..84deb51c93 100755 --- a/src/TurbulenceModels/Allwmake +++ b/src/TurbulenceModels/Allwmake @@ -3,9 +3,9 @@ cd ${0%/*} || exit 1 # run from this directory makeType=${1:-libso} set -x -wmake libso turbulenceModels -wmake libso incompressible -wmake libso compressible +wmake $makeType turbulenceModels +wmake $makeType incompressible +wmake $makeType compressible wmakeLnInclude phaseIncompressible wmakeLnInclude phaseCompressible diff --git a/src/dynamicFvMesh/Make/files b/src/dynamicFvMesh/Make/files index 42105a9a60..0403ea42ed 100644 --- a/src/dynamicFvMesh/Make/files +++ b/src/dynamicFvMesh/Make/files @@ -18,5 +18,6 @@ $(solidBodyMotionFunctions)/axisRotationMotion/axisRotationMotion.C $(solidBodyMotionFunctions)/multiMotion/multiMotion.C $(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C $(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C +solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C LIB = $(FOAM_LIBBIN)/libdynamicFvMesh diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C new file mode 100644 index 0000000000..f925d3a20b --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C @@ -0,0 +1,197 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "solidBodyMotionDisplacementPointPatchVectorField.H" +#include "transformField.H" +#include "addToRunTimeSelectionTable.H" +#include "pointPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const pointPatch& p, + const DimensionedField& iF +) +: + fixedValuePointPatchVectorField(p, iF), + SBMFPtr_() +{} + + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const pointPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedValuePointPatchVectorField(p, iF, dict, false), + SBMFPtr_(solidBodyMotionFunction::New(dict, this->db().time())) +{ + if (!dict.found("value")) + { + // Determine current local points and offset + fixedValuePointPatchVectorField::operator== + ( + transform(SBMFPtr_().transformation(), localPoints0()) + -localPoints0() + ); + } +} + + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const solidBodyMotionDisplacementPointPatchVectorField& ptf, + const pointPatch& p, + const DimensionedField& iF, + const pointPatchFieldMapper& mapper +) +: + fixedValuePointPatchVectorField(ptf, p, iF, mapper), + SBMFPtr_(ptf.SBMFPtr_().clone().ptr()) +{ + // For safety re-evaluate + + fixedValuePointPatchVectorField::operator== + ( + transform(SBMFPtr_().transformation(), localPoints0()) + -localPoints0() + ); +} + + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const solidBodyMotionDisplacementPointPatchVectorField& ptf +) +: + fixedValuePointPatchVectorField(ptf), + SBMFPtr_(ptf.SBMFPtr_().clone().ptr()) +{} + + +solidBodyMotionDisplacementPointPatchVectorField:: +solidBodyMotionDisplacementPointPatchVectorField +( + const solidBodyMotionDisplacementPointPatchVectorField& ptf, + const DimensionedField& iF +) +: + fixedValuePointPatchVectorField(ptf, iF), + SBMFPtr_(ptf.SBMFPtr_().clone().ptr()) +{ + // For safety re-evaluate + + fixedValuePointPatchVectorField::operator== + ( + transform(SBMFPtr_().transformation(), localPoints0()) + -localPoints0() + ); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const pointField& +solidBodyMotionDisplacementPointPatchVectorField::localPoints0() const +{ + if (!localPoints0Ptr_.valid()) + { + pointIOField points0 + ( + IOobject + ( + "points", + this->db().time().constant(), + polyMesh::meshSubDir, + this->db(), + IOobject::MUST_READ, + IOobject::NO_WRITE, + false + ) + ); + + localPoints0Ptr_.reset(new pointField(points0, patch().meshPoints())); + } + return localPoints0Ptr_(); +} + + +void solidBodyMotionDisplacementPointPatchVectorField::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + // Determine current local points and offset + fixedValuePointPatchVectorField::operator== + ( + transform(SBMFPtr_().transformation(), localPoints0()) + -localPoints0() + ); + + fixedValuePointPatchVectorField::updateCoeffs(); +} + + +void solidBodyMotionDisplacementPointPatchVectorField:: +write(Ostream& os) const +{ + // Note: write value + fixedValuePointPatchVectorField::write(os); + + os.writeKeyword(solidBodyMotionFunction::typeName) << SBMFPtr_->type() + << token::END_STATEMENT << nl; + os << indent << word(SBMFPtr_->type() + "Coeffs"); + SBMFPtr_->writeData(os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePointPatchTypeField +( + pointPatchVectorField, + solidBodyMotionDisplacementPointPatchVectorField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H new file mode 100644 index 0000000000..c8319cd95f --- /dev/null +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.H @@ -0,0 +1,169 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::solidBodyMotionDisplacementPointPatchVectorField + +Description + Enables the specification of a fixed value boundary condition using the + solid body motion functions. + +SourceFiles + solidBodyMotionDisplacementPointPatchVectorField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef solidBodyMotionDisplacementPointPatchVectorField_H +#define solidBodyMotionDisplacementPointPatchVectorField_H + +#include "solidBodyMotionFunction.H" +#include "fixedValuePointPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class solidBodyMotionDisplacementPointPatchVectorField Declaration +\*---------------------------------------------------------------------------*/ + +class solidBodyMotionDisplacementPointPatchVectorField +: + public fixedValuePointPatchVectorField +{ + // Private data + + //- The motion control function + autoPtr SBMFPtr_; + + mutable autoPtr localPoints0Ptr_; + + +public: + + //- Runtime type information + TypeName("solidBodyMotionDisplacement"); + + + // Constructors + + //- Construct from patch and internal field + solidBodyMotionDisplacementPointPatchVectorField + ( + const pointPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + solidBodyMotionDisplacementPointPatchVectorField + ( + const pointPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given patchField onto a new patch + solidBodyMotionDisplacementPointPatchVectorField + ( + const solidBodyMotionDisplacementPointPatchVectorField&, + const pointPatch&, + const DimensionedField&, + const pointPatchFieldMapper& + ); + + //- Construct as copy + solidBodyMotionDisplacementPointPatchVectorField + ( + const solidBodyMotionDisplacementPointPatchVectorField& + ); + + //- Construct and return a clone + virtual autoPtr > clone() const + { + return autoPtr > + ( + new solidBodyMotionDisplacementPointPatchVectorField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + solidBodyMotionDisplacementPointPatchVectorField + ( + const solidBodyMotionDisplacementPointPatchVectorField&, + const DimensionedField& + ); + + + //- Construct and return a clone setting internal field reference + virtual autoPtr > clone + ( + const DimensionedField& iF + ) const + { + return autoPtr > + ( + new solidBodyMotionDisplacementPointPatchVectorField + ( + *this, + iF + ) + ); + } + + + // Member functions + + // Access + + //- Return the fluctuation scale + const solidBodyMotionFunction& motion() const + { + return SBMFPtr_(); + } + + const pointField& localPoints0() const; + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H index f24afc9dc6..67bef0f9ed 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,6 +118,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr + ( + new SDA + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~SDA(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H index bc6b679365..9f78e72d1b 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H @@ -88,6 +88,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr + ( + new axisRotationMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~axisRotationMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H index cd79131d77..036ed957b6 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,6 +84,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr + ( + new linearMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~linearMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H index 9bbf045efa..93eb8dd8e5 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,6 +84,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr + ( + new multiMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~multiMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H index a3251b80c9..d080f486ef 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -87,6 +87,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr + ( + new oscillatingLinearMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~oscillatingLinearMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H index cbe10a95ec..60692b98f2 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H @@ -90,6 +90,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr + ( + new oscillatingRotatingMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~oscillatingRotatingMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H index 87ec08746f..169d5d17aa 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H @@ -95,6 +95,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr + ( + new rotatingMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~rotatingMotion(); diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C index 10a3bb0799..214ac972a1 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -70,4 +70,10 @@ bool Foam::solidBodyMotionFunction::read(const dictionary& SBMFCoeffs) } +void Foam::solidBodyMotionFunction::writeData(Ostream& os) const +{ + os << SBMFCoeffs_; +} + + // ************************************************************************* // diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H index 77a8920a22..075e746297 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -106,6 +106,9 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const = 0; + // Selectors @@ -128,6 +131,9 @@ public: //- Update properties from given dictionary virtual bool read(const dictionary& SBMFCoeffs) = 0; + + //- Write in dictionary format + virtual void writeData(Ostream&) const; }; diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H index 763d7105cf..0a5bfc736f 100644 --- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H +++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,6 +100,19 @@ public: const Time& runTime ); + //- Construct and return a clone + virtual autoPtr clone() const + { + return autoPtr + ( + new tabulated6DoFMotion + ( + SBMFCoeffs_, + time_ + ) + ); + } + //- Destructor virtual ~tabulated6DoFMotion(); diff --git a/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C b/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C index 970e0dac47..ca87555627 100644 --- a/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C +++ b/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.C @@ -43,6 +43,39 @@ defineTypeNameAndDebug(extrudePatchMesh, 0); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // +extrudePatchMesh::extrudePatchMesh +( + const fvMesh& mesh, + const fvPatch& patch, + const dictionary& dict, + const word regionName, + const List& regionPatches +) +: + fvMesh + ( + IOobject + ( + regionName, + mesh.facesInstance(), + mesh, + IOobject::READ_IF_PRESENT, + IOobject::NO_WRITE, + true + ), + xferCopy(pointField()), + xferCopy(faceList()), + xferCopy(labelList()), + xferCopy(labelList()), + false + ), + extrudedPatch_(patch.patch()), + dict_(dict) +{ + extrudeMesh(regionPatches); +} + + extrudePatchMesh::extrudePatchMesh ( const fvMesh& mesh, @@ -68,11 +101,59 @@ extrudePatchMesh::extrudePatchMesh xferCopy(labelList()), false ), - extrudedPatch_(patch.patch()) + extrudedPatch_(patch.patch()), + dict_(dict) +{ + + List regionPatches(3); + List patchNames(regionPatches.size()); + List patchTypes(regionPatches.size()); + PtrList dicts(regionPatches.size()); + + forAll (dicts, patchI) + { + if (!dicts.set(patchI)) + { + dicts.set(patchI, new dictionary()); + } + } + + dicts[bottomPatchID] = dict_.subDict("bottomCoeffs"); + dicts[sidePatchID] = dict_.subDict("sideCoeffs"); + dicts[topPatchID] = dict_.subDict("topCoeffs"); + + forAll (dicts, patchI) + { + dicts[patchI].lookup("name") >> patchNames[patchI]; + dicts[patchI].lookup("type") >> patchTypes[patchI]; + } + + forAll (regionPatches, patchI) + { + dictionary& patchDict = dicts[patchI]; + patchDict.set("nFaces", 0); + patchDict.set("startFace", 0); + + regionPatches[patchI] = polyPatch::New + ( + patchNames[patchI], + patchDict, + patchI, + mesh.boundaryMesh() + ).ptr(); + + } + + extrudeMesh(regionPatches); + +} + + +void extrudePatchMesh::extrudeMesh(const List& regionPatches) { if (this->boundaryMesh().size() == 0) { - bool columnCells = readBool(dict.lookup("columnCells")); + bool columnCells = readBool(dict_.lookup("columnCells")); PackedBoolList nonManifoldEdge(extrudedPatch_.nEdges()); for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++) @@ -83,7 +164,7 @@ extrudePatchMesh::extrudePatchMesh } } - autoPtr model_(extrudeModel::New(dict)); + autoPtr model_(extrudeModel::New(dict_)); faceList pointGlobalRegions; faceList pointLocalRegions; @@ -180,7 +261,7 @@ extrudePatchMesh::extrudePatchMesh pointLocalRegions, localRegionPoints ); - +/* List regionPatches(3); List patchNames(regionPatches.size()); List patchTypes(regionPatches.size()); @@ -194,9 +275,9 @@ extrudePatchMesh::extrudePatchMesh } } - dicts[bottomPatchID] = dict.subDict("bottomCoeffs"); - dicts[sidePatchID] = dict.subDict("sideCoeffs"); - dicts[topPatchID] = dict.subDict("topCoeffs"); + dicts[bottomPatchID] = dict_.subDict("bottomCoeffs"); + dicts[sidePatchID] = dict_.subDict("sideCoeffs"); + dicts[topPatchID] = dict_.subDict("topCoeffs"); forAll (dicts, patchI) { @@ -219,7 +300,7 @@ extrudePatchMesh::extrudePatchMesh ).ptr(); } - +*/ this->clearOut(); this->removeFvBoundary(); this->addFvPatches(regionPatches, true); diff --git a/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H b/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H index 0ced75eec6..6fc480b1bd 100644 --- a/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H +++ b/src/dynamicMesh/extrudePatchMesh/extrudePatchMesh.H @@ -105,6 +105,15 @@ private: //- Const reference to the patch from which this mesh is extruded const polyPatch& extrudedPatch_; + //- Model dictionary + dictionary dict_; + + + // Private member functions + + //- Extrude mesh using polyPatches + void extrudeMesh(const List& regionPatches); + public: @@ -123,6 +132,17 @@ public: const word ); + //- Construct from mesh, patch, dictionary and new mesh + // polyPatch information + extrudePatchMesh + ( + const fvMesh&, + const fvPatch&, + const dictionary&, + const word, + const List& polyPatches + ); + //- Destructor virtual ~extrudePatchMesh(); diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C index b6c1bd183c..a953c66ea6 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C @@ -169,7 +169,7 @@ void Foam::motionSmootherAlgo::minSmooth } // Single and multi-patch constraints - pointConstraints::New(newFld.mesh()).constrain(newFld, false); + pointConstraints::New(mesh()).constrain(newFld, false); } @@ -202,7 +202,7 @@ void Foam::motionSmootherAlgo::minSmooth } // Single and multi-patch constraints - pointConstraints::New(newFld.mesh()).constrain(newFld, false); + pointConstraints::New(mesh()).constrain(newFld, false); } @@ -224,7 +224,7 @@ void Foam::motionSmootherAlgo::scaleField } // Single and multi-patch constraints - pointConstraints::New(fld.mesh()).constrain(fld, false); + pointConstraints::New(mesh()).constrain(fld, false); } @@ -266,7 +266,7 @@ void Foam::motionSmootherAlgo::subtractField } // Single and multi-patch constraints - pointConstraints::New(fld.mesh()).constrain(fld); + pointConstraints::New(mesh()).constrain(fld); } @@ -476,7 +476,7 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields } // Multi-patch constraints - pointConstraints::New(displacement.mesh()).constrainCorners(displacement); + pointConstraints::New(displacement.mesh()()).constrainCorners(displacement); // Adapt the fixedValue bc's (i.e. copy internal point data to // boundaryField for all affected patches) to take the changes caused @@ -622,7 +622,7 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions } // Multi-patch constraints - pointConstraints::New(displacement.mesh()).constrainCorners(displacement); + pointConstraints::New(displacement.mesh()()).constrainCorners(displacement); // Correct for problems introduced by corner constraints syncTools::syncPointList diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgoTemplates.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgoTemplates.C index fa847ff328..f78a11a9a3 100644 --- a/src/dynamicMesh/motionSmoother/motionSmootherAlgoTemplates.C +++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgoTemplates.C @@ -229,7 +229,7 @@ Foam::motionSmootherAlgo::avg } // Single and multi-patch constraints - pointConstraints::New(res.mesh()).constrain(res, false); + pointConstraints::New(mesh).constrain(res, false); return tres; } @@ -256,7 +256,7 @@ void Foam::motionSmootherAlgo::smooth } // Single and multi-patch constraints - pointConstraints::New(newFld.mesh()).constrain(newFld, false); + pointConstraints::New(mesh_).constrain(newFld, false); } diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 67deac5810..0bcfcf48a5 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -24,6 +24,7 @@ $(constraintFvPatches)/empty/emptyFvPatch.C $(constraintFvPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C $(constraintFvPatches)/processor/processorFvPatch.C $(constraintFvPatches)/processorCyclic/processorCyclicFvPatch.C +$(constraintFvPatches)/symmetryPlane/symmetryPlaneFvPatch.C $(constraintFvPatches)/symmetry/symmetryFvPatch.C $(constraintFvPatches)/wedge/wedgeFvPatch.C @@ -119,6 +120,8 @@ $(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFv $(constraintFvPatchFields)/processor/processorFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchScalarField.C $(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchFields.C +$(constraintFvPatchFields)/symmetryPlane/symmetryPlaneFvPatchFields.C +$(constraintFvPatchFields)/symmetryPlane/symmetryPlaneFvPatchScalarField.C $(constraintFvPatchFields)/symmetry/symmetryFvPatchFields.C $(constraintFvPatchFields)/wedge/wedgeFvPatchFields.C $(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C @@ -213,6 +216,7 @@ $(constraintFvsPatchFields)/empty/emptyFvsPatchFields.C $(constraintFvsPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.C $(constraintFvsPatchFields)/processor/processorFvsPatchFields.C $(constraintFvsPatchFields)/processorCyclic/processorCyclicFvsPatchFields.C +$(constraintFvsPatchFields)/symmetryPlane/symmetryPlaneFvsPatchFields.C $(constraintFvsPatchFields)/symmetry/symmetryFvsPatchFields.C $(constraintFvsPatchFields)/wedge/wedgeFvsPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchScalarField.C index 32ab1deb1f..40f3f5467f 100644 --- a/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/basic/basicSymmetry/basicSymmetryFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,22 +26,21 @@ License #include "basicSymmetryFvPatchField.H" #include "volFields.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<> -tmp basicSymmetryFvPatchField::snGrad() const +Foam::tmp +Foam::basicSymmetryFvPatchField::snGrad() const { return tmp(new scalarField(size(), 0.0)); } template<> -void basicSymmetryFvPatchField::evaluate(const Pstream::commsTypes) +void Foam::basicSymmetryFvPatchField::evaluate +( + const Pstream::commsTypes +) { if (!updated()) { @@ -53,8 +52,4 @@ void basicSymmetryFvPatchField::evaluate(const Pstream::commsTypes) } -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - // ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H index a5812c09b4..191bd597d1 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetry/symmetryFvPatchField.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -36,7 +36,7 @@ Description \verbatim myPatch { - type symmetryPlane; + type symmetry; } \endverbatim diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.C new file mode 100644 index 0000000000..053a56689b --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.C @@ -0,0 +1,201 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlaneFvPatchField.H" + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::symmetryPlaneFvPatchField::symmetryPlaneFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + basicSymmetryFvPatchField(p, iF), + symmetryPlanePatch_(refCast(p)) +{} + + +template +Foam::symmetryPlaneFvPatchField::symmetryPlaneFvPatchField +( + const symmetryPlaneFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + basicSymmetryFvPatchField(ptf, p, iF, mapper), + symmetryPlanePatch_(refCast(p)) +{ + if (!isType(this->patch())) + { + FatalErrorIn + ( + "symmetryPlaneFvPatchField::symmetryPlaneFvPatchField\n" + "(\n" + " const symmetryPlaneFvPatchField& ptf,\n" + " const fvPatch& p,\n" + " const DimensionedField& iF,\n" + " const fvPatchFieldMapper& mapper\n" + ")\n" + ) << "\n patch type '" << p.type() + << "' not constraint type '" << typeName << "'" + << "\n for patch " << p.name() + << " of field " << this->dimensionedInternalField().name() + << " in file " << this->dimensionedInternalField().objectPath() + << exit(FatalIOError); + } +} + + +template +Foam::symmetryPlaneFvPatchField::symmetryPlaneFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + basicSymmetryFvPatchField(p, iF, dict), + symmetryPlanePatch_(refCast(p)) +{ + if (!isType(p)) + { + FatalIOErrorIn + ( + "symmetryPlaneFvPatchField::symmetryPlaneFvPatchField\n" + "(\n" + " const fvPatch& p,\n" + " const Field& field,\n" + " const dictionary& dict\n" + ")\n", + dict + ) << "\n patch type '" << p.type() + << "' not constraint type '" << typeName << "'" + << "\n for patch " << p.name() + << " of field " << this->dimensionedInternalField().name() + << " in file " << this->dimensionedInternalField().objectPath() + << exit(FatalIOError); + } +} + + +template +Foam::symmetryPlaneFvPatchField::symmetryPlaneFvPatchField +( + const symmetryPlaneFvPatchField& ptf +) +: + basicSymmetryFvPatchField(ptf), + symmetryPlanePatch_(ptf.symmetryPlanePatch_) +{} + + +template +Foam::symmetryPlaneFvPatchField::symmetryPlaneFvPatchField +( + const symmetryPlaneFvPatchField& ptf, + const DimensionedField& iF +) +: + basicSymmetryFvPatchField(ptf, iF), + symmetryPlanePatch_(ptf.symmetryPlanePatch_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::tmp > +Foam::symmetryPlaneFvPatchField::snGrad() const +{ + vector nHat(symmetryPlanePatch_.n()); + + const Field iF(this->patchInternalField()); + + return + (transform(I - 2.0*sqr(nHat), iF) - iF) + *(this->patch().deltaCoeffs()/2.0); +} + + +template +void Foam::symmetryPlaneFvPatchField::evaluate(const Pstream::commsTypes) +{ + if (!this->updated()) + { + this->updateCoeffs(); + } + + vector nHat(symmetryPlanePatch_.n()); + + const Field iF(this->patchInternalField()); + + Field::operator= + ( + (iF + transform(I - 2.0*sqr(nHat), iF))/2.0 + ); + + transformFvPatchField::evaluate(); +} + + +template +Foam::tmp > +Foam::symmetryPlaneFvPatchField::snGradTransformDiag() const +{ + vector nHat(symmetryPlanePatch_.n()); + + const vector diag + ( + mag(nHat.component(vector::X)), + mag(nHat.component(vector::Y)), + mag(nHat.component(vector::Z)) + ); + + return tmp > + ( + new Field + ( + this->size(), + transformMask + ( + //pow::rank>(diag) + pow + ( + diag, + pTraits::rank> + ::type>::zero + ) + ) + ) + ); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.H new file mode 100644 index 0000000000..5f17938aa4 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchField.H @@ -0,0 +1,189 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::symmetryPlaneFvPatchField + +Group + grpConstraintBoundaryConditions + +Description + This boundary condition enforces a symmetryPlane constraint + + \heading Patch usage + + Example of the boundary condition specification: + \verbatim + myPatch + { + type symmetryPlane; + } + \endverbatim + +SourceFiles + symmetryPlaneFvPatchField.C + symmetryPlaneFvPatchFields.C + symmetryPlaneFvPatchFields.H + symmetryPlaneFvPatchFieldsFwd.H + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlaneFvPatchField_H +#define symmetryPlaneFvPatchField_H + +#include "basicSymmetryFvPatchField.H" +#include "symmetryPlaneFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class symmetryPlaneFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class symmetryPlaneFvPatchField +: + public basicSymmetryFvPatchField +{ + // Private data + + //- Local reference cast into the symmetryPlane patch + const symmetryPlaneFvPatch& symmetryPlanePatch_; + + +public: + + //- Runtime type information + TypeName(symmetryPlaneFvPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + symmetryPlaneFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + symmetryPlaneFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given symmetryPlaneFvPatchField + // onto a new patch + symmetryPlaneFvPatchField + ( + const symmetryPlaneFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + symmetryPlaneFvPatchField + ( + const symmetryPlaneFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new symmetryPlaneFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + symmetryPlaneFvPatchField + ( + const symmetryPlaneFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new symmetryPlaneFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Return gradient at boundary + virtual tmp > snGrad() const; + + //- Evaluate the patch field + virtual void evaluate + ( + const Pstream::commsTypes commsType=Pstream::blocking + ); + + //- Return face-gradient transform diagonal + virtual tmp > snGradTransformDiag() const; +}; + + +// * * * * * * * * * * * Template Specialisations * * * * * * * * * * * * * // + +template<> +tmp symmetryPlaneFvPatchField::snGrad() const; + +template<> +void symmetryPlaneFvPatchField::evaluate +( + const Pstream::commsTypes commsType +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "symmetryPlaneFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFields.C new file mode 100644 index 0000000000..5430190f01 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlaneFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(symmetryPlane); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFields.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFields.H new file mode 100644 index 0000000000..8b32421c21 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlaneFvPatchFields_H +#define symmetryPlaneFvPatchFields_H + +#include "symmetryPlaneFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(symmetryPlane); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFieldsFwd.H b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFieldsFwd.H new file mode 100644 index 0000000000..ef8a3946a3 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlaneFvPatchFieldsFwd_H +#define symmetryPlaneFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class symmetryPlaneFvPatchField; + +makePatchTypeFieldTypedefs(symmetryPlane); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchScalarField.C new file mode 100644 index 0000000000..4f43940626 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/constraint/symmetryPlane/symmetryPlaneFvPatchScalarField.C @@ -0,0 +1,55 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlaneFvPatchField.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<> +Foam::tmp +Foam::symmetryPlaneFvPatchField::snGrad() const +{ + return tmp(new scalarField(size(), 0.0)); +} + + +template<> +void Foam::symmetryPlaneFvPatchField::evaluate +( + const Pstream::commsTypes +) +{ + if (!updated()) + { + updateCoeffs(); + } + + scalarField::operator=(patchInternalField()); + transformFvPatchField::evaluate(); +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C index a7205577f3..f93817c3c7 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingMappedFixedValue/timeVaryingMappedFixedValueFvPatchField.C @@ -536,7 +536,8 @@ void timeVaryingMappedFixedValueFvPatchField::updateCoeffs() if (debug) { Pout<< "updateCoeffs : set fixedValue to min:" << gMin(*this) - << " max:" << gMax(*this) << endl; + << " max:" << gMax(*this) + << " avg:" << gAverage(*this) << endl; } fixedValueFvPatchField::updateCoeffs(); @@ -548,7 +549,10 @@ void timeVaryingMappedFixedValueFvPatchField::write(Ostream& os) const { fvPatchField::write(os); os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl; - os.writeKeyword("perturb") << perturb_ << token::END_STATEMENT << nl; + if (perturb_ != 1e-5) + { + os.writeKeyword("perturb") << perturb_ << token::END_STATEMENT << nl; + } if (fieldTableName_ != this->dimensionedInternalField().name()) { diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.C b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.C new file mode 100644 index 0000000000..9e3477d586 --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.C @@ -0,0 +1,130 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlaneFvsPatchField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +symmetryPlaneFvsPatchField::symmetryPlaneFvsPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fvsPatchField(p, iF) +{} + + +template +symmetryPlaneFvsPatchField::symmetryPlaneFvsPatchField +( + const symmetryPlaneFvsPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fvsPatchField(ptf, p, iF, mapper) +{ + if (!isType(this->patch())) + { + FatalErrorIn + ( + "symmetryPlaneFvsPatchField::symmetryPlaneFvsPatchField\n" + "(\n" + " const symmetryPlaneFvsPatchField& ptf,\n" + " const fvPatch& p,\n" + " const DimensionedField& iF,\n" + " const fvPatchFieldMapper& mapper\n" + ")\n" + ) << "Field type does not correspond to patch type for patch " + << this->patch().index() << "." << endl + << "Field type: " << typeName << endl + << "Patch type: " << this->patch().type() + << exit(FatalError); + } +} + + +template +symmetryPlaneFvsPatchField::symmetryPlaneFvsPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fvsPatchField(p, iF, dict) +{ + if (!isType(p)) + { + FatalIOErrorIn + ( + "symmetryPlaneFvsPatchField::symmetryPlaneFvsPatchField\n" + "(\n" + " const fvPatch& p,\n" + " const Field& field,\n" + " const dictionary& dict\n" + ")\n", + dict + ) << "patch " << this->patch().index() << " not symmetryPlane type. " + << "Patch type = " << p.type() + << exit(FatalIOError); + } +} + + +template +symmetryPlaneFvsPatchField::symmetryPlaneFvsPatchField +( + const symmetryPlaneFvsPatchField& ptf +) +: + fvsPatchField(ptf) +{} + + +template +symmetryPlaneFvsPatchField::symmetryPlaneFvsPatchField +( + const symmetryPlaneFvsPatchField& ptf, + const DimensionedField& iF +) +: + fvsPatchField(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H new file mode 100644 index 0000000000..8dd2035610 --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchField.H @@ -0,0 +1,139 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::symmetryPlaneFvsPatchField + +Description + Foam::symmetryPlaneFvsPatchField + +SourceFiles + symmetryPlaneFvsPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlaneFvsPatchField_H +#define symmetryPlaneFvsPatchField_H + +#include "fvsPatchField.H" +#include "symmetryPlaneFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class symmetryPlaneFvsPatch Declaration +\*---------------------------------------------------------------------------*/ + +template +class symmetryPlaneFvsPatchField +: + public fvsPatchField +{ + +public: + + //- Runtime type information + TypeName(symmetryPlaneFvPatch::typeName_()); + + + // Constructors + + //- Construct from patch and internal field + symmetryPlaneFvsPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + symmetryPlaneFvsPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given symmetryPlaneFvsPatchField + // onto a new patch + symmetryPlaneFvsPatchField + ( + const symmetryPlaneFvsPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + symmetryPlaneFvsPatchField + ( + const symmetryPlaneFvsPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new symmetryPlaneFvsPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + symmetryPlaneFvsPatchField + ( + const symmetryPlaneFvsPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new symmetryPlaneFvsPatchField(*this, iF) + ); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "symmetryPlaneFvsPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFields.C b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFields.C new file mode 100644 index 0000000000..0d881f615c --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlaneFvsPatchFields.H" +#include "fvsPatchFields.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makeFvsPatchFields(symmetryPlane); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFields.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFields.H new file mode 100644 index 0000000000..b7d5e2cab8 --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlaneFvsPatchFields_H +#define symmetryPlaneFvsPatchFields_H + +#include "symmetryPlaneFvsPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makeFvsPatchTypeFieldTypedefs(symmetryPlane); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFieldsFwd.H b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFieldsFwd.H new file mode 100644 index 0000000000..c041cbf295 --- /dev/null +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/symmetryPlane/symmetryPlaneFvsPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlaneFvsPatchFieldsFwd_H +#define symmetryPlaneFvsPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class symmetryPlaneFvsPatchField; + +makeFvsPatchTypeFieldTypedefs(symmetryPlane); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/symmetry/symmetryFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/constraint/symmetry/symmetryFvPatch.H index 11ca298ec4..ba10021d51 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/symmetry/symmetryFvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/symmetry/symmetryFvPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,7 @@ Class Foam::symmetryFvPatch Description - Symmetry-plane patch. + Symmetry patch for non-planar or multi-plane patches. SourceFiles symmetryFvPatch.C diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/symmetryPlane/symmetryPlaneFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/symmetryPlane/symmetryPlaneFvPatch.C new file mode 100644 index 0000000000..cabfd123c6 --- /dev/null +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/symmetryPlane/symmetryPlaneFvPatch.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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 "symmetryPlaneFvPatch.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +defineTypeNameAndDebug(symmetryPlaneFvPatch, 0); +addToRunTimeSelectionTable(fvPatch, symmetryPlaneFvPatch, polyPatch); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/symmetryPlane/symmetryPlaneFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/constraint/symmetryPlane/symmetryPlaneFvPatch.H new file mode 100644 index 0000000000..069b37b6bc --- /dev/null +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/symmetryPlane/symmetryPlaneFvPatch.H @@ -0,0 +1,97 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2013 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::symmetryPlaneFvPatch + +Description + Symmetry-plane patch. + +SourceFiles + symmetryPlaneFvPatch.C + +\*---------------------------------------------------------------------------*/ + +#ifndef symmetryPlaneFvPatch_H +#define symmetryPlaneFvPatch_H + +#include "fvPatch.H" +#include "symmetryPlanePolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class symmetryPlaneFvPatch Declaration +\*---------------------------------------------------------------------------*/ + +class symmetryPlaneFvPatch +: + public fvPatch +{ + // Private data + + //- Local reference cast into the symmetryPlane patch + const symmetryPlanePolyPatch& symmetryPlanePolyPatch_; + + +public: + + //- Runtime type information + TypeName(symmetryPlanePolyPatch::typeName_()); + + + // Constructors + + //- Construct from polyPatch + symmetryPlaneFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm) + : + fvPatch(patch, bm), + symmetryPlanePolyPatch_ + ( + refCast(patch) + ) + {} + + + // Member Functions + + //- Return symmetry plane normal + const vector& n() const + { + return symmetryPlanePolyPatch_.n(); + } +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C index bb370fffb8..5bc4d56e94 100644 --- a/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C +++ b/src/finiteVolume/interpolation/volPointInterpolation/pointConstraints.C @@ -51,11 +51,11 @@ void pointConstraints::makePatchPatchAddressing() << endl; } - const pointMesh& pMesh = mesh(); - const polyMesh& mesh = pMesh(); + //const polyMesh& mesh = mesh(); + const pointMesh& pMesh = pointMesh::New(mesh()); const pointBoundaryMesh& pbm = pMesh.boundary(); - const polyBoundaryMesh& bm = mesh.boundaryMesh(); + const polyBoundaryMesh& bm = mesh().boundaryMesh(); // first count the total number of patch-patch points @@ -146,7 +146,7 @@ void pointConstraints::makePatchPatchAddressing() // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ { - const globalMeshData& gd = mesh.globalData(); + const globalMeshData& gd = mesh().globalData(); const labelListList& globalPointSlaves = gd.globalPointSlaves(); const mapDistribute& globalPointSlavesMap = gd.globalPointSlavesMap(); const Map