Merge branch 'master' of /home/dm4/OpenFOAM/repositories/OpenFOAM-dev

This commit is contained in:
andy
2013-12-09 10:33:07 +00:00
240 changed files with 4899 additions and 512 deletions

View File

@ -91,7 +91,7 @@ Foam::kineticTheoryModels::conductivityModels::HrenyaSinclair::kappa
return da*sqrt(Theta)* return da*sqrt(Theta)*
( (
2.0*sqr(alpha1)*g0*(1.0 + e)/sqrtPi 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) /(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) + (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) /((49.0/16.0 - 33.0*e/16.0)*lamda)

View File

@ -1,9 +1,9 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \ -I$(LIB_SRC)/dynamicMesh/lnInclude \
EXE_LIBS = \ EXE_LIBS = \
-lmeshTools \ -lfiniteVolume \
-lsampling \
-ldynamicMesh -ldynamicMesh

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,6 +33,7 @@ using std::ios;
#include "fluentFvMesh.H" #include "fluentFvMesh.H"
#include "primitiveMesh.H" #include "primitiveMesh.H"
#include "wallFvPatch.H" #include "wallFvPatch.H"
#include "symmetryPlaneFvPatch.H"
#include "symmetryFvPatch.H" #include "symmetryFvPatch.H"
#include "cellModeller.H" #include "cellModeller.H"
@ -177,7 +178,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
{ {
fluentMeshFile << 3; fluentMeshFile << 3;
} }
else if (isA<symmetryFvPatch>(boundary()[patchI])) else if
(
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|| isA<symmetryFvPatch>(boundary()[patchI])
)
{ {
fluentMeshFile << 7; fluentMeshFile << 7;
} }
@ -280,7 +285,11 @@ void Foam::fluentFvMesh::writeFluentMesh() const
{ {
fluentMeshFile << "wall "; fluentMeshFile << "wall ";
} }
else if (isA<symmetryFvPatch>(boundary()[patchI])) else if
(
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|| isA<symmetryFvPatch>(boundary()[patchI])
)
{ {
fluentMeshFile << "symmetry "; fluentMeshFile << "symmetry ";
} }

View File

@ -401,7 +401,7 @@ addLayersControls
// Angle used to pick up medial axis points // Angle used to pick up medial axis points
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130
// in 17x. // in 17x.
minMedianAxisAngle 90; minMedialAxisAngle 90;
// Reduce layer growth where ratio thickness to medial // Reduce layer growth where ratio thickness to medial
// distance is large // distance is large
@ -414,6 +414,9 @@ addLayersControls
// default is 0. // default is 0.
nSmoothDisplacement 90; nSmoothDisplacement 90;
// Optional: limit the number of steps walking away from the surface
nMedialAxisIter 10;
// Mesh shrinking // Mesh shrinking

View File

@ -1,5 +1,6 @@
EXE_INC = \ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude -I$(LIB_SRC)/dynamicMesh/lnInclude
EXE_LIBS = \ EXE_LIBS = \

View File

@ -619,17 +619,39 @@ int main(int argc, char *argv[])
const word masterName = groupName + "_master"; const word masterName = groupName + "_master";
const word slaveName = groupName + "_slave"; const word slaveName = groupName + "_slave";
dictionary patchDict = patchSource; word groupNameMaster = groupName;
patchDict.set("nFaces", 0); word groupNameSlave = groupName;
patchDict.set("startFace", 0);
patchDict.set("coupleGroup", 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 // Make sure patches and zoneFaces are synchronised across couples
@ -793,6 +815,12 @@ int main(int argc, char *argv[])
else else
{ {
const dictionary& patchSource = dict.subDict("patchPairs"); const dictionary& patchSource = dict.subDict("patchPairs");
bool groupBase = false;
if (patchSource.found("groupBase"))
{
groupBase = readBool(patchSource.lookup("groupBase"));
}
const word& groupName = selectors[selectorI].name(); const word& groupName = selectors[selectorI].name();
if (patchSource.found("patchFields")) if (patchSource.found("patchFields"))
@ -801,6 +829,9 @@ int main(int argc, char *argv[])
( (
"patchFields" "patchFields"
); );
if (!groupBase)
{
// Add coupleGroup to all entries // Add coupleGroup to all entries
forAllIter(dictionary, patchFieldsDict, iter) forAllIter(dictionary, patchFieldsDict, iter)
{ {
@ -811,7 +842,9 @@ int main(int argc, char *argv[])
} }
} }
const labelList& patchIDs = pbm.groupPatchIDs()[groupName]; const labelList& patchIDs =
pbm.groupPatchIDs()[groupName];
forAll(patchIDs, i) forAll(patchIDs, i)
{ {
fvMeshTools::setPatchFields fvMeshTools::setPatchFields
@ -822,6 +855,29 @@ int main(int argc, char *argv[])
); );
} }
} }
else
{
const word masterPatchName(groupName + "_master");
const word slavePatchName(groupName + "_slave");
label patchIMaster = pbm.findPatchID(masterPatchName);
label patchISlave = pbm.findPatchID(slavePatchName);
fvMeshTools::setPatchFields
(
mesh,
patchIMaster,
patchFieldsDict
);
fvMeshTools::setPatchFields
(
mesh,
patchISlave,
patchFieldsDict
);
}
}
} }
} }
} }

View File

@ -210,6 +210,14 @@ int main(int argc, char *argv[])
outFile << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; 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; label nItems = 0;
forAll(polyLines, polyI) forAll(polyLines, polyI)
{ {

View File

@ -33,6 +33,7 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "pointFields.H" #include "pointFields.H"
#include "emptyPolyPatch.H" #include "emptyPolyPatch.H"
#include "symmetryPlanePolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "wedgePolyPatch.H" #include "wedgePolyPatch.H"
#include "OSspecific.H" #include "OSspecific.H"
@ -286,6 +287,8 @@ int main(int argc, char *argv[])
( (
!isType<emptyPolyPatch> !isType<emptyPolyPatch>
(patches[patchNo]) (patches[patchNo])
&& !isType<symmetryPlanePolyPatch>
(patches[patchNo])
&& !isType<symmetryPolyPatch> && !isType<symmetryPolyPatch>
(patches[patchNo]) (patches[patchNo])
&& !isType<wedgePolyPatch> && !isType<wedgePolyPatch>

View File

@ -3,7 +3,7 @@
# ========= | # ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration | # \\ / O peration |
# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation # \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
# \\/ M anipulation | # \\/ M anipulation |
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# License # License
@ -50,6 +50,28 @@ USAGE
exit 1 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 unset version
# replacement for possibly buggy 'which' # replacement for possibly buggy 'which'
@ -217,11 +239,11 @@ then
# #
if [ "$screenOpt" = true ] if [ "$screenOpt" = true ]
then then
echo "Executing: $mpirun $mpiopts $APPLICATION $@ -parallel | tee log" echo "Executing: $mpirun $mpiopts $APPLICATION $(echoArgs "$@") -parallel | tee log"
$mpirun $mpiopts $APPLICATION $@ -parallel | tee log $mpirun $mpiopts $APPLICATION "$@" -parallel | tee log
else else
echo "Executing: $mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1" echo "Executing: $mpirun $mpiopts $APPLICATION $(echoArgs "$@") -parallel > log 2>&1"
$mpirun $mpiopts $APPLICATION $@ -parallel > log 2>&1 & $mpirun $mpiopts $APPLICATION "$@" -parallel > log 2>&1 &
fi fi
else else
@ -230,12 +252,12 @@ else
# #
if [ "$screenOpt" = true ] if [ "$screenOpt" = true ]
then then
echo "Executing: $APPLICATION $@ | tee log &" echo "Executing: $APPLICATION $(echoArgs "$@") | tee log &"
$APPLICATION $@ | tee log & $APPLICATION "$@" | tee log &
wait $! wait $!
else else
echo "Executing: $APPLICATION $@ > log 2>&1 &" echo "Executing: $APPLICATION $(echoArgs "$@") > log 2>&1 &"
$APPLICATION $@ > log 2>&1 & $APPLICATION "$@" > log 2>&1 &
fi fi
fi fi

View File

@ -51,6 +51,11 @@ symmetryPlane
type symmetryPlane; type symmetryPlane;
} }
symmetry
{
type symmetry;
}
wedge wedge
{ {
type wedge; type wedge;

View File

@ -813,6 +813,7 @@ DebugSwitches
symmTensorAverageField 0; symmTensorAverageField 0;
symmTensorField 0; symmTensorField 0;
symmetryPlane 0; symmetryPlane 0;
symmetry 0;
syringePressure 0; syringePressure 0;
tensorAverageField 0; tensorAverageField 0;
tensorField 0; tensorField 0;

View File

@ -81,4 +81,6 @@ wmake $makeType regionCoupled
postProcessing/Allwmake $* postProcessing/Allwmake $*
wmake $makeType sixDoFRigidBodyMotion
# ----------------------------------------------------------------- end-of-file # ----------------------------------------------------------------- end-of-file

View File

@ -411,6 +411,7 @@ $(constraintPolyPatches)/empty/emptyPolyPatch.C
$(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C $(constraintPolyPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPolyPatch.C
$(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C $(constraintPolyPatches)/processorCyclic/processorCyclicPolyPatch.C
$(constraintPolyPatches)/processor/processorPolyPatch.C $(constraintPolyPatches)/processor/processorPolyPatch.C
$(constraintPolyPatches)/symmetryPlane/symmetryPlanePolyPatch.C
$(constraintPolyPatches)/symmetry/symmetryPolyPatch.C $(constraintPolyPatches)/symmetry/symmetryPolyPatch.C
$(constraintPolyPatches)/wedge/wedgePolyPatch.C $(constraintPolyPatches)/wedge/wedgePolyPatch.C
@ -530,6 +531,7 @@ $(constraintPointPatches)/empty/emptyPointPatch.C
$(constraintPointPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C $(constraintPointPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatch.C
$(constraintPointPatches)/processor/processorPointPatch.C $(constraintPointPatches)/processor/processorPointPatch.C
$(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C $(constraintPointPatches)/processorCyclic/processorCyclicPointPatch.C
$(constraintPointPatches)/symmetryPlane/symmetryPlanePointPatch.C
$(constraintPointPatches)/symmetry/symmetryPointPatch.C $(constraintPointPatches)/symmetry/symmetryPointPatch.C
$(constraintPointPatches)/wedge/wedgePointPatch.C $(constraintPointPatches)/wedge/wedgePointPatch.C
@ -599,6 +601,7 @@ $(constraintPointPatchFields)/empty/emptyPointPatchFields.C
$(constraintPointPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchFields.C $(constraintPointPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicPointPatchFields.C
$(constraintPointPatchFields)/processor/processorPointPatchFields.C $(constraintPointPatchFields)/processor/processorPointPatchFields.C
$(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.C $(constraintPointPatchFields)/processorCyclic/processorCyclicPointPatchFields.C
$(constraintPointPatchFields)/symmetryPlane/symmetryPlanePointPatchFields.C
$(constraintPointPatchFields)/symmetry/symmetryPointPatchFields.C $(constraintPointPatchFields)/symmetry/symmetryPointPatchFields.C
$(constraintPointPatchFields)/wedge/wedgePointPatchFields.C $(constraintPointPatchFields)/wedge/wedgePointPatchFields.C

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlanePointPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF
)
:
basicSymmetryPointPatchField<Type>(p, iF),
symmetryPlanePatch_(refCast<const symmetryPlanePointPatch>(p))
{}
template<class Type>
symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField
(
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const dictionary& dict
)
:
basicSymmetryPointPatchField<Type>(p, iF, dict),
symmetryPlanePatch_(refCast<const symmetryPlanePointPatch>(p))
{
if (!isType<symmetryPlanePointPatch>(p))
{
FatalIOErrorIn
(
"symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField\n"
"(\n"
" const pointPatch& p,\n"
" const Field<Type>& field,\n"
" const dictionary& dict\n"
")\n",
dict
) << "patch " << this->patch().index() << " not symmetry type. "
<< "Patch type = " << p.type()
<< exit(FatalIOError);
}
}
template<class Type>
symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField
(
const symmetryPlanePointPatchField<Type>& ptf,
const pointPatch& p,
const DimensionedField<Type, pointMesh>& iF,
const pointPatchFieldMapper& mapper
)
:
basicSymmetryPointPatchField<Type>(ptf, p, iF, mapper),
symmetryPlanePatch_(refCast<const symmetryPlanePointPatch>(p))
{
if (!isType<symmetryPlanePointPatch>(this->patch()))
{
FatalErrorIn
(
"symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField\n"
"(\n"
" const symmetryPlanePointPatchField<Type>& ptf,\n"
" const pointPatch& p,\n"
" const DimensionedField<Type, pointMesh>& 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<class Type>
symmetryPlanePointPatchField<Type>::symmetryPlanePointPatchField
(
const symmetryPlanePointPatchField<Type>& ptf,
const DimensionedField<Type, pointMesh>& iF
)
:
basicSymmetryPointPatchField<Type>(ptf, iF),
symmetryPlanePatch_(ptf.symmetryPlanePatch_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
void Foam::symmetryPlanePointPatchField<Type>::evaluate
(
const Pstream::commsTypes
)
{
vector nHat = symmetryPlanePatch_.n();
tmp<Field<Type> > tvalues =
(
(
this->patchInternalField()
+ transform(I - 2.0*sqr(nHat), this->patchInternalField())
)/2.0
);
// Get internal field to insert values into
Field<Type>& iF = const_cast<Field<Type>&>(this->internalField());
this->setInInternalField(iF, tvalues());
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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 Type>
class symmetryPlanePointPatchField
:
public basicSymmetryPointPatchField<Type>
{
// 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<Type, pointMesh>&
);
//- Construct from patch, internal field and dictionary
symmetryPlanePointPatchField
(
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<Type> onto a new patch
symmetryPlanePointPatchField
(
const symmetryPlanePointPatchField<Type>&,
const pointPatch&,
const DimensionedField<Type, pointMesh>&,
const pointPatchFieldMapper&
);
//- Construct and return a clone
virtual autoPtr<pointPatchField<Type> > clone() const
{
return autoPtr<pointPatchField<Type> >
(
new symmetryPlanePointPatchField<Type>
(
*this
)
);
}
//- Construct as copy setting internal field reference
symmetryPlanePointPatchField
(
const symmetryPlanePointPatchField<Type>&,
const DimensionedField<Type, pointMesh>&
);
//- Construct and return a clone setting internal field reference
virtual autoPtr<pointPatchField<Type> > clone
(
const DimensionedField<Type, pointMesh>& iF
) const
{
return autoPtr<pointPatchField<Type> >
(
new symmetryPlanePointPatchField<Type>
(
*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
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlanePointPatchFields.H"
#include "pointPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePointPatchFields(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef symmetryPlanePointPatchFields_H
#define symmetryPlanePointPatchFields_H
#include "symmetryPlanePointPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePointPatchFieldTypedefs(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,9 +25,8 @@ Class
Foam::SolverPerformance Foam::SolverPerformance
Description Description
SolverPerformance is a general matrix class in which the coefficients are SolverPerformance is the class returned by the LduMatrix solver
stored as three arrays, one for the upper triangle, one for the containing performance statistics.
lower triangle and a third for the diagonal.
SourceFiles SourceFiles
SolverPerformance.C SolverPerformance.C
@ -72,13 +71,10 @@ Ostream& operator<<
); );
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class SolverPerformance Declaration Class SolverPerformance Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
//- Class returned by the solver
// containing performance statistics
template<class Type> template<class Type>
class SolverPerformance class SolverPerformance
{ {

View File

@ -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() bool Foam::pointMesh::movePoints()
{ {
if (debug) if (debug)

View File

@ -85,6 +85,10 @@ public:
explicit pointMesh(const polyMesh& pMesh); explicit pointMesh(const polyMesh& pMesh);
//- Destructor
~pointMesh();
// Member Functions // Member Functions
//- Return number of points //- Return number of points

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,11 +25,14 @@ Class
Foam::symmetryPointPatch Foam::symmetryPointPatch
Description Description
Symmetry-plane patch. Symmetry patch for non-planar or multi-plane patches.
SourceFiles SourceFiles
symmetryPointPatch.C symmetryPointPatch.C
SeeAlso
symmetryPlanePointPatch
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef symmetryPointPatch_H #ifndef symmetryPointPatch_H

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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<const symmetryPlanePolyPatch>(patch))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::symmetryPlanePointPatch::applyConstraint
(
const label,
pointConstraint& pc
) const
{
pc.applyConstraint(symmetryPlanePolyPatch_.n());
}
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,11 +25,14 @@ Class
Foam::symmetryPolyPatch Foam::symmetryPolyPatch
Description Description
Symmetry-plane patch. Symmetry patch for non-planar or multi-plane patches.
SourceFiles SourceFiles
symmetryPolyPatch.C symmetryPolyPatch.C
SeeAlso
symmetryPlanePolyPatch
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef symmetryPolyPatch_H #ifndef symmetryPolyPatch_H
@ -53,7 +56,7 @@ class symmetryPolyPatch
public: public:
//- Runtime type information //- Runtime type information
TypeName("symmetryPlane"); TypeName("symmetry");
// Constructors // Constructors

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#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_;
}
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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<polyPatch> clone(const polyBoundaryMesh& bm) const
{
return autoPtr<polyPatch>(new symmetryPlanePolyPatch(*this, bm));
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const label newSize,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new symmetryPlanePolyPatch(*this, bm, index, newSize, newStart)
);
}
//- Construct and return a clone, resetting the face list
// and boundary mesh
virtual autoPtr<polyPatch> clone
(
const polyBoundaryMesh& bm,
const label index,
const labelUList& mapAddressing,
const label newStart
) const
{
return autoPtr<polyPatch>
(
new symmetryPlanePolyPatch
(
*this,
bm,
index,
mapAddressing,
newStart
)
);
}
// Member Functions
//- Return symmetry plane normal
const vector& n() const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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 * * * * * * * * * * * * // // * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam::Istream& Foam::operator>>(Istream& is, septernion& s) Foam::Istream& Foam::operator>>(Istream& is, septernion& s)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -157,6 +157,13 @@ inline septernion inv(const septernion& tr);
//- Return a string representation of a septernion //- Return a string representation of a septernion
word name(const 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 //- Data associated with septernion type are contiguous
template<> template<>

View File

@ -3,9 +3,9 @@ cd ${0%/*} || exit 1 # run from this directory
makeType=${1:-libso} makeType=${1:-libso}
set -x set -x
wmake libso turbulenceModels wmake $makeType turbulenceModels
wmake libso incompressible wmake $makeType incompressible
wmake libso compressible wmake $makeType compressible
wmakeLnInclude phaseIncompressible wmakeLnInclude phaseIncompressible
wmakeLnInclude phaseCompressible wmakeLnInclude phaseCompressible

View File

@ -18,5 +18,6 @@ $(solidBodyMotionFunctions)/axisRotationMotion/axisRotationMotion.C
$(solidBodyMotionFunctions)/multiMotion/multiMotion.C $(solidBodyMotionFunctions)/multiMotion/multiMotion.C
$(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C $(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C
$(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C $(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C
solidBodyMotionFvMesh/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C
LIB = $(FOAM_LIBBIN)/libdynamicFvMesh LIB = $(FOAM_LIBBIN)/libdynamicFvMesh

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "solidBodyMotionDisplacementPointPatchVectorField.H"
#include "transformField.H"
#include "addToRunTimeSelectionTable.H"
#include "pointPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
solidBodyMotionDisplacementPointPatchVectorField::
solidBodyMotionDisplacementPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& iF
)
:
fixedValuePointPatchVectorField(p, iF),
SBMFPtr_()
{}
solidBodyMotionDisplacementPointPatchVectorField::
solidBodyMotionDisplacementPointPatchVectorField
(
const pointPatch& p,
const DimensionedField<vector, pointMesh>& 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<vector, pointMesh>& 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<vector, pointMesh>& 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
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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<solidBodyMotionFunction> SBMFPtr_;
mutable autoPtr<pointField> localPoints0Ptr_;
public:
//- Runtime type information
TypeName("solidBodyMotionDisplacement");
// Constructors
//- Construct from patch and internal field
solidBodyMotionDisplacementPointPatchVectorField
(
const pointPatch&,
const DimensionedField<vector, pointMesh>&
);
//- Construct from patch, internal field and dictionary
solidBodyMotionDisplacementPointPatchVectorField
(
const pointPatch&,
const DimensionedField<vector, pointMesh>&,
const dictionary&
);
//- Construct by mapping given patchField<vector> onto a new patch
solidBodyMotionDisplacementPointPatchVectorField
(
const solidBodyMotionDisplacementPointPatchVectorField&,
const pointPatch&,
const DimensionedField<vector, pointMesh>&,
const pointPatchFieldMapper&
);
//- Construct as copy
solidBodyMotionDisplacementPointPatchVectorField
(
const solidBodyMotionDisplacementPointPatchVectorField&
);
//- Construct and return a clone
virtual autoPtr<pointPatchField<vector> > clone() const
{
return autoPtr<pointPatchField<vector> >
(
new solidBodyMotionDisplacementPointPatchVectorField
(
*this
)
);
}
//- Construct as copy setting internal field reference
solidBodyMotionDisplacementPointPatchVectorField
(
const solidBodyMotionDisplacementPointPatchVectorField&,
const DimensionedField<vector, pointMesh>&
);
//- Construct and return a clone setting internal field reference
virtual autoPtr<pointPatchField<vector> > clone
(
const DimensionedField<vector, pointMesh>& iF
) const
{
return autoPtr<pointPatchField<vector> >
(
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
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -118,6 +118,19 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const
{
return autoPtr<solidBodyMotionFunction>
(
new SDA
(
SBMFCoeffs_,
time_
)
);
}
//- Destructor //- Destructor
virtual ~SDA(); virtual ~SDA();

View File

@ -88,6 +88,19 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const
{
return autoPtr<solidBodyMotionFunction>
(
new axisRotationMotion
(
SBMFCoeffs_,
time_
)
);
}
//- Destructor //- Destructor
virtual ~axisRotationMotion(); virtual ~axisRotationMotion();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -84,6 +84,19 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const
{
return autoPtr<solidBodyMotionFunction>
(
new linearMotion
(
SBMFCoeffs_,
time_
)
);
}
//- Destructor //- Destructor
virtual ~linearMotion(); virtual ~linearMotion();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -84,6 +84,19 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const
{
return autoPtr<solidBodyMotionFunction>
(
new multiMotion
(
SBMFCoeffs_,
time_
)
);
}
//- Destructor //- Destructor
virtual ~multiMotion(); virtual ~multiMotion();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -87,6 +87,19 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const
{
return autoPtr<solidBodyMotionFunction>
(
new oscillatingLinearMotion
(
SBMFCoeffs_,
time_
)
);
}
//- Destructor //- Destructor
virtual ~oscillatingLinearMotion(); virtual ~oscillatingLinearMotion();

View File

@ -90,6 +90,19 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const
{
return autoPtr<solidBodyMotionFunction>
(
new oscillatingRotatingMotion
(
SBMFCoeffs_,
time_
)
);
}
//- Destructor //- Destructor
virtual ~oscillatingRotatingMotion(); virtual ~oscillatingRotatingMotion();

View File

@ -95,6 +95,19 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const
{
return autoPtr<solidBodyMotionFunction>
(
new rotatingMotion
(
SBMFCoeffs_,
time_
)
);
}
//- Destructor //- Destructor
virtual ~rotatingMotion(); virtual ~rotatingMotion();

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -70,4 +70,10 @@ bool Foam::solidBodyMotionFunction::read(const dictionary& SBMFCoeffs)
} }
void Foam::solidBodyMotionFunction::writeData(Ostream& os) const
{
os << SBMFCoeffs_;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -106,6 +106,9 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const = 0;
// Selectors // Selectors
@ -128,6 +131,9 @@ public:
//- Update properties from given dictionary //- Update properties from given dictionary
virtual bool read(const dictionary& SBMFCoeffs) = 0; virtual bool read(const dictionary& SBMFCoeffs) = 0;
//- Write in dictionary format
virtual void writeData(Ostream&) const;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -100,6 +100,19 @@ public:
const Time& runTime const Time& runTime
); );
//- Construct and return a clone
virtual autoPtr<solidBodyMotionFunction> clone() const
{
return autoPtr<solidBodyMotionFunction>
(
new tabulated6DoFMotion
(
SBMFCoeffs_,
time_
)
);
}
//- Destructor //- Destructor
virtual ~tabulated6DoFMotion(); virtual ~tabulated6DoFMotion();

View File

@ -43,6 +43,39 @@ defineTypeNameAndDebug(extrudePatchMesh, 0);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
extrudePatchMesh::extrudePatchMesh
(
const fvMesh& mesh,
const fvPatch& patch,
const dictionary& dict,
const word regionName,
const List<polyPatch*>& 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 extrudePatchMesh::extrudePatchMesh
( (
const fvMesh& mesh, const fvMesh& mesh,
@ -68,11 +101,59 @@ extrudePatchMesh::extrudePatchMesh
xferCopy(labelList()), xferCopy(labelList()),
false false
), ),
extrudedPatch_(patch.patch()) extrudedPatch_(patch.patch()),
dict_(dict)
{
List<polyPatch*> regionPatches(3);
List<word> patchNames(regionPatches.size());
List<word> patchTypes(regionPatches.size());
PtrList<dictionary> 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<polyPatch*>& regionPatches)
{ {
if (this->boundaryMesh().size() == 0) if (this->boundaryMesh().size() == 0)
{ {
bool columnCells = readBool(dict.lookup("columnCells")); bool columnCells = readBool(dict_.lookup("columnCells"));
PackedBoolList nonManifoldEdge(extrudedPatch_.nEdges()); PackedBoolList nonManifoldEdge(extrudedPatch_.nEdges());
for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++) for (label edgeI = 0; edgeI < extrudedPatch_.nInternalEdges(); edgeI++)
@ -83,7 +164,7 @@ extrudePatchMesh::extrudePatchMesh
} }
} }
autoPtr<extrudeModel> model_(extrudeModel::New(dict)); autoPtr<extrudeModel> model_(extrudeModel::New(dict_));
faceList pointGlobalRegions; faceList pointGlobalRegions;
faceList pointLocalRegions; faceList pointLocalRegions;
@ -180,7 +261,7 @@ extrudePatchMesh::extrudePatchMesh
pointLocalRegions, pointLocalRegions,
localRegionPoints localRegionPoints
); );
/*
List<polyPatch*> regionPatches(3); List<polyPatch*> regionPatches(3);
List<word> patchNames(regionPatches.size()); List<word> patchNames(regionPatches.size());
List<word> patchTypes(regionPatches.size()); List<word> patchTypes(regionPatches.size());
@ -194,9 +275,9 @@ extrudePatchMesh::extrudePatchMesh
} }
} }
dicts[bottomPatchID] = dict.subDict("bottomCoeffs"); dicts[bottomPatchID] = dict_.subDict("bottomCoeffs");
dicts[sidePatchID] = dict.subDict("sideCoeffs"); dicts[sidePatchID] = dict_.subDict("sideCoeffs");
dicts[topPatchID] = dict.subDict("topCoeffs"); dicts[topPatchID] = dict_.subDict("topCoeffs");
forAll (dicts, patchI) forAll (dicts, patchI)
{ {
@ -219,7 +300,7 @@ extrudePatchMesh::extrudePatchMesh
).ptr(); ).ptr();
} }
*/
this->clearOut(); this->clearOut();
this->removeFvBoundary(); this->removeFvBoundary();
this->addFvPatches(regionPatches, true); this->addFvPatches(regionPatches, true);

View File

@ -105,6 +105,15 @@ private:
//- Const reference to the patch from which this mesh is extruded //- Const reference to the patch from which this mesh is extruded
const polyPatch& extrudedPatch_; const polyPatch& extrudedPatch_;
//- Model dictionary
dictionary dict_;
// Private member functions
//- Extrude mesh using polyPatches
void extrudeMesh(const List<polyPatch*>& regionPatches);
public: public:
@ -123,6 +132,17 @@ public:
const word const word
); );
//- Construct from mesh, patch, dictionary and new mesh
// polyPatch information
extrudePatchMesh
(
const fvMesh&,
const fvPatch&,
const dictionary&,
const word,
const List<polyPatch*>& polyPatches
);
//- Destructor //- Destructor
virtual ~extrudePatchMesh(); virtual ~extrudePatchMesh();

View File

@ -169,7 +169,7 @@ void Foam::motionSmootherAlgo::minSmooth
} }
// Single and multi-patch constraints // 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 // 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 // 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 // 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 // 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 // Adapt the fixedValue bc's (i.e. copy internal point data to
// boundaryField for all affected patches) to take the changes caused // boundaryField for all affected patches) to take the changes caused
@ -622,7 +622,7 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
} }
// Multi-patch constraints // Multi-patch constraints
pointConstraints::New(displacement.mesh()).constrainCorners(displacement); pointConstraints::New(displacement.mesh()()).constrainCorners(displacement);
// Correct for problems introduced by corner constraints // Correct for problems introduced by corner constraints
syncTools::syncPointList syncTools::syncPointList

View File

@ -229,7 +229,7 @@ Foam::motionSmootherAlgo::avg
} }
// Single and multi-patch constraints // Single and multi-patch constraints
pointConstraints::New(res.mesh()).constrain(res, false); pointConstraints::New(mesh).constrain(res, false);
return tres; return tres;
} }
@ -256,7 +256,7 @@ void Foam::motionSmootherAlgo::smooth
} }
// Single and multi-patch constraints // Single and multi-patch constraints
pointConstraints::New(newFld.mesh()).constrain(newFld, false); pointConstraints::New(mesh_).constrain(newFld, false);
} }

View File

@ -24,6 +24,7 @@ $(constraintFvPatches)/empty/emptyFvPatch.C
$(constraintFvPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C $(constraintFvPatches)/nonuniformTransformCyclic/nonuniformTransformCyclicFvPatch.C
$(constraintFvPatches)/processor/processorFvPatch.C $(constraintFvPatches)/processor/processorFvPatch.C
$(constraintFvPatches)/processorCyclic/processorCyclicFvPatch.C $(constraintFvPatches)/processorCyclic/processorCyclicFvPatch.C
$(constraintFvPatches)/symmetryPlane/symmetryPlaneFvPatch.C
$(constraintFvPatches)/symmetry/symmetryFvPatch.C $(constraintFvPatches)/symmetry/symmetryFvPatch.C
$(constraintFvPatches)/wedge/wedgeFvPatch.C $(constraintFvPatches)/wedge/wedgeFvPatch.C
@ -119,6 +120,8 @@ $(constraintFvPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFv
$(constraintFvPatchFields)/processor/processorFvPatchFields.C $(constraintFvPatchFields)/processor/processorFvPatchFields.C
$(constraintFvPatchFields)/processor/processorFvPatchScalarField.C $(constraintFvPatchFields)/processor/processorFvPatchScalarField.C
$(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchFields.C $(constraintFvPatchFields)/processorCyclic/processorCyclicFvPatchFields.C
$(constraintFvPatchFields)/symmetryPlane/symmetryPlaneFvPatchFields.C
$(constraintFvPatchFields)/symmetryPlane/symmetryPlaneFvPatchScalarField.C
$(constraintFvPatchFields)/symmetry/symmetryFvPatchFields.C $(constraintFvPatchFields)/symmetry/symmetryFvPatchFields.C
$(constraintFvPatchFields)/wedge/wedgeFvPatchFields.C $(constraintFvPatchFields)/wedge/wedgeFvPatchFields.C
$(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C $(constraintFvPatchFields)/wedge/wedgeFvPatchScalarField.C
@ -213,6 +216,7 @@ $(constraintFvsPatchFields)/empty/emptyFvsPatchFields.C
$(constraintFvsPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.C $(constraintFvsPatchFields)/nonuniformTransformCyclic/nonuniformTransformCyclicFvsPatchFields.C
$(constraintFvsPatchFields)/processor/processorFvsPatchFields.C $(constraintFvsPatchFields)/processor/processorFvsPatchFields.C
$(constraintFvsPatchFields)/processorCyclic/processorCyclicFvsPatchFields.C $(constraintFvsPatchFields)/processorCyclic/processorCyclicFvsPatchFields.C
$(constraintFvsPatchFields)/symmetryPlane/symmetryPlaneFvsPatchFields.C
$(constraintFvsPatchFields)/symmetry/symmetryFvsPatchFields.C $(constraintFvsPatchFields)/symmetry/symmetryFvsPatchFields.C
$(constraintFvsPatchFields)/wedge/wedgeFvsPatchFields.C $(constraintFvsPatchFields)/wedge/wedgeFvsPatchFields.C

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -26,22 +26,21 @@ License
#include "basicSymmetryFvPatchField.H" #include "basicSymmetryFvPatchField.H"
#include "volFields.H" #include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<> template<>
tmp<scalarField > basicSymmetryFvPatchField<scalar>::snGrad() const Foam::tmp<Foam::scalarField>
Foam::basicSymmetryFvPatchField<Foam::scalar>::snGrad() const
{ {
return tmp<scalarField >(new scalarField(size(), 0.0)); return tmp<scalarField >(new scalarField(size(), 0.0));
} }
template<> template<>
void basicSymmetryFvPatchField<scalar>::evaluate(const Pstream::commsTypes) void Foam::basicSymmetryFvPatchField<Foam::scalar>::evaluate
(
const Pstream::commsTypes
)
{ {
if (!updated()) if (!updated())
{ {
@ -53,8 +52,4 @@ void basicSymmetryFvPatchField<scalar>::evaluate(const Pstream::commsTypes)
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,7 +36,7 @@ Description
\verbatim \verbatim
myPatch myPatch
{ {
type symmetryPlane; type symmetry;
} }
\endverbatim \endverbatim

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlaneFvPatchField.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
Foam::symmetryPlaneFvPatchField<Type>::symmetryPlaneFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF
)
:
basicSymmetryFvPatchField<Type>(p, iF),
symmetryPlanePatch_(refCast<const symmetryPlaneFvPatch>(p))
{}
template<class Type>
Foam::symmetryPlaneFvPatchField<Type>::symmetryPlaneFvPatchField
(
const symmetryPlaneFvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
basicSymmetryFvPatchField<Type>(ptf, p, iF, mapper),
symmetryPlanePatch_(refCast<const symmetryPlaneFvPatch>(p))
{
if (!isType<symmetryPlaneFvPatch>(this->patch()))
{
FatalErrorIn
(
"symmetryPlaneFvPatchField<Type>::symmetryPlaneFvPatchField\n"
"(\n"
" const symmetryPlaneFvPatchField<Type>& ptf,\n"
" const fvPatch& p,\n"
" const DimensionedField<Type, volMesh>& 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<class Type>
Foam::symmetryPlaneFvPatchField<Type>::symmetryPlaneFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const dictionary& dict
)
:
basicSymmetryFvPatchField<Type>(p, iF, dict),
symmetryPlanePatch_(refCast<const symmetryPlaneFvPatch>(p))
{
if (!isType<symmetryPlaneFvPatch>(p))
{
FatalIOErrorIn
(
"symmetryPlaneFvPatchField<Type>::symmetryPlaneFvPatchField\n"
"(\n"
" const fvPatch& p,\n"
" const Field<Type>& 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<class Type>
Foam::symmetryPlaneFvPatchField<Type>::symmetryPlaneFvPatchField
(
const symmetryPlaneFvPatchField<Type>& ptf
)
:
basicSymmetryFvPatchField<Type>(ptf),
symmetryPlanePatch_(ptf.symmetryPlanePatch_)
{}
template<class Type>
Foam::symmetryPlaneFvPatchField<Type>::symmetryPlaneFvPatchField
(
const symmetryPlaneFvPatchField<Type>& ptf,
const DimensionedField<Type, volMesh>& iF
)
:
basicSymmetryFvPatchField<Type>(ptf, iF),
symmetryPlanePatch_(ptf.symmetryPlanePatch_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::symmetryPlaneFvPatchField<Type>::snGrad() const
{
vector nHat(symmetryPlanePatch_.n());
const Field<Type> iF(this->patchInternalField());
return
(transform(I - 2.0*sqr(nHat), iF) - iF)
*(this->patch().deltaCoeffs()/2.0);
}
template<class Type>
void Foam::symmetryPlaneFvPatchField<Type>::evaluate(const Pstream::commsTypes)
{
if (!this->updated())
{
this->updateCoeffs();
}
vector nHat(symmetryPlanePatch_.n());
const Field<Type> iF(this->patchInternalField());
Field<Type>::operator=
(
(iF + transform(I - 2.0*sqr(nHat), iF))/2.0
);
transformFvPatchField<Type>::evaluate();
}
template<class Type>
Foam::tmp<Foam::Field<Type> >
Foam::symmetryPlaneFvPatchField<Type>::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<Field<Type> >
(
new Field<Type>
(
this->size(),
transformMask<Type>
(
//pow<vector, pTraits<Type>::rank>(diag)
pow
(
diag,
pTraits<typename powProduct<vector, pTraits<Type>::rank>
::type>::zero
)
)
)
);
}
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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 Type>
class symmetryPlaneFvPatchField
:
public basicSymmetryFvPatchField<Type>
{
// 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<Type, volMesh>&
);
//- Construct from patch, internal field and dictionary
symmetryPlaneFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const dictionary&
);
//- Construct by mapping given symmetryPlaneFvPatchField
// onto a new patch
symmetryPlaneFvPatchField
(
const symmetryPlaneFvPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
symmetryPlaneFvPatchField
(
const symmetryPlaneFvPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvPatchField<Type> > clone() const
{
return tmp<fvPatchField<Type> >
(
new symmetryPlaneFvPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
symmetryPlaneFvPatchField
(
const symmetryPlaneFvPatchField<Type>&,
const DimensionedField<Type, volMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvPatchField<Type> > clone
(
const DimensionedField<Type, volMesh>& iF
) const
{
return tmp<fvPatchField<Type> >
(
new symmetryPlaneFvPatchField<Type>(*this, iF)
);
}
// Member functions
// Evaluation functions
//- Return gradient at boundary
virtual tmp<Field<Type> > snGrad() const;
//- Evaluate the patch field
virtual void evaluate
(
const Pstream::commsTypes commsType=Pstream::blocking
);
//- Return face-gradient transform diagonal
virtual tmp<Field<Type> > snGradTransformDiag() const;
};
// * * * * * * * * * * * Template Specialisations * * * * * * * * * * * * * //
template<>
tmp<scalarField> symmetryPlaneFvPatchField<scalar>::snGrad() const;
template<>
void symmetryPlaneFvPatchField<scalar>::evaluate
(
const Pstream::commsTypes commsType
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "symmetryPlaneFvPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlaneFvPatchFields.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makePatchFields(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef symmetryPlaneFvPatchFields_H
#define symmetryPlaneFvPatchFields_H
#include "symmetryPlaneFvPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makePatchTypeFieldTypedefs(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef symmetryPlaneFvPatchFieldsFwd_H
#define symmetryPlaneFvPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class symmetryPlaneFvPatchField;
makePatchTypeFieldTypedefs(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlaneFvPatchField.H"
#include "volFields.H"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<>
Foam::tmp<Foam::scalarField>
Foam::symmetryPlaneFvPatchField<Foam::scalar>::snGrad() const
{
return tmp<scalarField >(new scalarField(size(), 0.0));
}
template<>
void Foam::symmetryPlaneFvPatchField<Foam::scalar>::evaluate
(
const Pstream::commsTypes
)
{
if (!updated())
{
updateCoeffs();
}
scalarField::operator=(patchInternalField());
transformFvPatchField<scalar>::evaluate();
}
// ************************************************************************* //

View File

@ -536,7 +536,8 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::updateCoeffs()
if (debug) if (debug)
{ {
Pout<< "updateCoeffs : set fixedValue to min:" << gMin(*this) Pout<< "updateCoeffs : set fixedValue to min:" << gMin(*this)
<< " max:" << gMax(*this) << endl; << " max:" << gMax(*this)
<< " avg:" << gAverage(*this) << endl;
} }
fixedValueFvPatchField<Type>::updateCoeffs(); fixedValueFvPatchField<Type>::updateCoeffs();
@ -548,7 +549,10 @@ void timeVaryingMappedFixedValueFvPatchField<Type>::write(Ostream& os) const
{ {
fvPatchField<Type>::write(os); fvPatchField<Type>::write(os);
os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl; os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
if (perturb_ != 1e-5)
{
os.writeKeyword("perturb") << perturb_ << token::END_STATEMENT << nl; os.writeKeyword("perturb") << perturb_ << token::END_STATEMENT << nl;
}
if (fieldTableName_ != this->dimensionedInternalField().name()) if (fieldTableName_ != this->dimensionedInternalField().name())
{ {

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlaneFvsPatchField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class Type>
symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF
)
:
fvsPatchField<Type>(p, iF)
{}
template<class Type>
symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
(
const symmetryPlaneFvsPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fvsPatchField<Type>(ptf, p, iF, mapper)
{
if (!isType<symmetryPlaneFvPatch>(this->patch()))
{
FatalErrorIn
(
"symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField\n"
"(\n"
" const symmetryPlaneFvsPatchField<Type>& ptf,\n"
" const fvPatch& p,\n"
" const DimensionedField<Type, surfaceMesh>& 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<class Type>
symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
(
const fvPatch& p,
const DimensionedField<Type, surfaceMesh>& iF,
const dictionary& dict
)
:
fvsPatchField<Type>(p, iF, dict)
{
if (!isType<symmetryPlaneFvPatch>(p))
{
FatalIOErrorIn
(
"symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField\n"
"(\n"
" const fvPatch& p,\n"
" const Field<Type>& field,\n"
" const dictionary& dict\n"
")\n",
dict
) << "patch " << this->patch().index() << " not symmetryPlane type. "
<< "Patch type = " << p.type()
<< exit(FatalIOError);
}
}
template<class Type>
symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
(
const symmetryPlaneFvsPatchField<Type>& ptf
)
:
fvsPatchField<Type>(ptf)
{}
template<class Type>
symmetryPlaneFvsPatchField<Type>::symmetryPlaneFvsPatchField
(
const symmetryPlaneFvsPatchField<Type>& ptf,
const DimensionedField<Type, surfaceMesh>& iF
)
:
fvsPatchField<Type>(ptf, iF)
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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 Type>
class symmetryPlaneFvsPatchField
:
public fvsPatchField<Type>
{
public:
//- Runtime type information
TypeName(symmetryPlaneFvPatch::typeName_());
// Constructors
//- Construct from patch and internal field
symmetryPlaneFvsPatchField
(
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&
);
//- Construct from patch, internal field and dictionary
symmetryPlaneFvsPatchField
(
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&,
const dictionary&
);
//- Construct by mapping given symmetryPlaneFvsPatchField
// onto a new patch
symmetryPlaneFvsPatchField
(
const symmetryPlaneFvsPatchField<Type>&,
const fvPatch&,
const DimensionedField<Type, surfaceMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
symmetryPlaneFvsPatchField
(
const symmetryPlaneFvsPatchField<Type>&
);
//- Construct and return a clone
virtual tmp<fvsPatchField<Type> > clone() const
{
return tmp<fvsPatchField<Type> >
(
new symmetryPlaneFvsPatchField<Type>(*this)
);
}
//- Construct as copy setting internal field reference
symmetryPlaneFvsPatchField
(
const symmetryPlaneFvsPatchField<Type>&,
const DimensionedField<Type, surfaceMesh>&
);
//- Construct and return a clone setting internal field reference
virtual tmp<fvsPatchField<Type> > clone
(
const DimensionedField<Type, surfaceMesh>& iF
) const
{
return tmp<fvsPatchField<Type> >
(
new symmetryPlaneFvsPatchField<Type>(*this, iF)
);
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#ifdef NoRepository
# include "symmetryPlaneFvsPatchField.C"
#endif
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlaneFvsPatchFields.H"
#include "fvsPatchFields.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
makeFvsPatchFields(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef symmetryPlaneFvsPatchFields_H
#define symmetryPlaneFvsPatchFields_H
#include "symmetryPlaneFvsPatchField.H"
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
makeFvsPatchTypeFieldTypedefs(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#ifndef symmetryPlaneFvsPatchFieldsFwd_H
#define symmetryPlaneFvsPatchFieldsFwd_H
#include "fieldTypes.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type> class symmetryPlaneFvsPatchField;
makeFvsPatchTypeFieldTypedefs(symmetryPlane);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -25,7 +25,7 @@ Class
Foam::symmetryFvPatch Foam::symmetryFvPatch
Description Description
Symmetry-plane patch. Symmetry patch for non-planar or multi-plane patches.
SourceFiles SourceFiles
symmetryFvPatch.C symmetryFvPatch.C

View File

@ -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 <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
#include "symmetryPlaneFvPatch.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
defineTypeNameAndDebug(symmetryPlaneFvPatch, 0);
addToRunTimeSelectionTable(fvPatch, symmetryPlaneFvPatch, polyPatch);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -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 <http://www.gnu.org/licenses/>.
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<const symmetryPlanePolyPatch>(patch)
)
{}
// Member Functions
//- Return symmetry plane normal
const vector& n() const
{
return symmetryPlanePolyPatch_.n();
}
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -51,11 +51,11 @@ void pointConstraints::makePatchPatchAddressing()
<< endl; << endl;
} }
const pointMesh& pMesh = mesh(); //const polyMesh& mesh = mesh();
const polyMesh& mesh = pMesh(); const pointMesh& pMesh = pointMesh::New(mesh());
const pointBoundaryMesh& pbm = pMesh.boundary(); const pointBoundaryMesh& pbm = pMesh.boundary();
const polyBoundaryMesh& bm = mesh.boundaryMesh(); const polyBoundaryMesh& bm = mesh().boundaryMesh();
// first count the total number of patch-patch points // 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 labelListList& globalPointSlaves = gd.globalPointSlaves();
const mapDistribute& globalPointSlavesMap = gd.globalPointSlavesMap(); const mapDistribute& globalPointSlavesMap = gd.globalPointSlavesMap();
const Map<label>& cpPointMap = gd.coupledPatch().meshPointMap(); const Map<label>& cpPointMap = gd.coupledPatch().meshPointMap();
@ -226,7 +226,7 @@ void pointConstraints::makePatchPatchAddressing()
{ {
//Pout<< "on meshpoint:" << meshPointI //Pout<< "on meshpoint:" << meshPointI
// << " coupled:" << coupledPointI // << " coupled:" << coupledPointI
// << " at:" << mesh.points()[meshPointI] // << " at:" << mesh().points()[meshPointI]
// << " have new constraint:" // << " have new constraint:"
// << constraints[coupledPointI] // << constraints[coupledPointI]
// << endl; // << endl;
@ -244,7 +244,7 @@ void pointConstraints::makePatchPatchAddressing()
{ {
//Pout<< "on meshpoint:" << meshPointI //Pout<< "on meshpoint:" << meshPointI
// << " coupled:" << coupledPointI // << " coupled:" << coupledPointI
// << " at:" << mesh.points()[meshPointI] // << " at:" << mesh().points()[meshPointI]
// << " have possibly extended constraint:" // << " have possibly extended constraint:"
// << constraints[coupledPointI] // << constraints[coupledPointI]
// << endl; // << endl;
@ -323,9 +323,10 @@ void pointConstraints::makePatchPatchAddressing()
// * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
pointConstraints::pointConstraints(const pointMesh& pm) //pointConstraints::pointConstraints(const pointMesh& pm)
pointConstraints::pointConstraints(const polyMesh& pm)
: :
MeshObject<pointMesh, Foam::UpdateableMeshObject, pointConstraints>(pm) MeshObject<polyMesh, Foam::UpdateableMeshObject, pointConstraints>(pm)
{ {
makePatchPatchAddressing(); makePatchPatchAddressing();
} }
@ -334,7 +335,12 @@ pointConstraints::pointConstraints(const pointMesh& pm)
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * //
pointConstraints::~pointConstraints() pointConstraints::~pointConstraints()
{} {
if (debug)
{
Pout<< "pointConstraints::~pointConstraints()" << endl;
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -375,9 +381,9 @@ void pointConstraints::constrainDisplacement
// Apply any 2D motion constraints (or should they go before // Apply any 2D motion constraints (or should they go before
// corner constraints?) // corner constraints?)
twoDPointCorrector::New(mesh()()).correctDisplacement twoDPointCorrector::New(mesh()).correctDisplacement
( (
mesh()().points(), mesh().points(),
pf.internalField() pf.internalField()
); );

View File

@ -34,6 +34,11 @@ Description
coupled to points which are not on any constraint patch and we coupled to points which are not on any constraint patch and we
don't want to get inconsistency between the two points. don't want to get inconsistency between the two points.
Note: is currently MeshObject on polyMesh but should really be on
pointMesh. The problem is that pointMesh::updateMesh never
gets called (since currently polyMesh gets reset and destroys
pointMesh)
SourceFiles SourceFiles
pointConstraints.C pointConstraints.C
pointConstraintsTemplates.C pointConstraintsTemplates.C
@ -62,7 +67,8 @@ class polyMesh;
class pointConstraints class pointConstraints
: :
public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints> //See above:public MeshObject<pointMesh, UpdateableMeshObject, pointConstraints>
public MeshObject<polyMesh, UpdateableMeshObject, pointConstraints>
{ {
// Private data // Private data
@ -97,7 +103,8 @@ public:
// Constructors // Constructors
//- Constructor from pointMesh. //- Constructor from pointMesh.
explicit pointConstraints(const pointMesh&); //explicit pointConstraints(const pointMesh&);
explicit pointConstraints(const polyMesh&);
//- Destructor //- Destructor

View File

@ -139,7 +139,12 @@ void pointConstraints::constrain
pf.correctBoundaryConditions(); pf.correctBoundaryConditions();
// Sync any dangling points // Sync any dangling points
syncUntransformedData(mesh()(), pf.internalField(), maxMagSqrEqOp<Type>()); syncUntransformedData
(
pf.mesh()(),
pf.internalField(),
maxMagSqrEqOp<Type>()
);
// Apply multiple constraints on edge/corner points // Apply multiple constraints on edge/corner points
constrainCorners(pf); constrainCorners(pf);

View File

@ -271,7 +271,7 @@ void volPointInterpolation::interpolateBoundaryField
interpolateBoundaryField(vf, pf); interpolateBoundaryField(vf, pf);
// Apply constraints // Apply constraints
const pointConstraints& pcs = pointConstraints::New(pf.mesh()); const pointConstraints& pcs = pointConstraints::New(vf.mesh());
pcs.constrain(pf, overrideFixedValue); pcs.constrain(pf, overrideFixedValue);
} }

View File

@ -390,7 +390,7 @@ void volPointInterpolation::interpolateDisplacement
interpolateBoundaryField(vf, pf); interpolateBoundaryField(vf, pf);
// Apply displacement constraints // Apply displacement constraints
const pointConstraints& pcs = pointConstraints::New(pf.mesh()); const pointConstraints& pcs = pointConstraints::New(vf.mesh());
pcs.constrainDisplacement(pf, false); pcs.constrainDisplacement(pf, false);
} }

View File

@ -48,8 +48,8 @@ timeVaryingMappedFixedValuePointPatchField
startAverage_(pTraits<Type>::zero), startAverage_(pTraits<Type>::zero),
endSampleTime_(-1), endSampleTime_(-1),
endSampledValues_(0), endSampledValues_(0),
endAverage_(pTraits<Type>::zero) endAverage_(pTraits<Type>::zero),
offset_()
{} {}
@ -75,7 +75,13 @@ timeVaryingMappedFixedValuePointPatchField
startAverage_(pTraits<Type>::zero), startAverage_(pTraits<Type>::zero),
endSampleTime_(-1), endSampleTime_(-1),
endSampledValues_(0), endSampledValues_(0),
endAverage_(pTraits<Type>::zero) endAverage_(pTraits<Type>::zero),
offset_
(
ptf.offset_.valid()
? ptf.offset_().clone().ptr()
: NULL
)
{} {}
@ -100,8 +106,14 @@ timeVaryingMappedFixedValuePointPatchField
startAverage_(pTraits<Type>::zero), startAverage_(pTraits<Type>::zero),
endSampleTime_(-1), endSampleTime_(-1),
endSampledValues_(0), endSampledValues_(0),
endAverage_(pTraits<Type>::zero) endAverage_(pTraits<Type>::zero),
offset_()
{ {
if (dict.found("offset"))
{
offset_ = DataEntry<Type>::New("offset", dict);
}
dict.readIfPresent("fieldTableName", fieldTableName_); dict.readIfPresent("fieldTableName", fieldTableName_);
if (dict.found("value")) if (dict.found("value"))
@ -141,7 +153,13 @@ timeVaryingMappedFixedValuePointPatchField
startAverage_(ptf.startAverage_), startAverage_(ptf.startAverage_),
endSampleTime_(ptf.endSampleTime_), endSampleTime_(ptf.endSampleTime_),
endSampledValues_(ptf.endSampledValues_), endSampledValues_(ptf.endSampledValues_),
endAverage_(ptf.endAverage_) endAverage_(ptf.endAverage_),
offset_
(
ptf.offset_.valid()
? ptf.offset_().clone().ptr()
: NULL
)
{} {}
@ -165,7 +183,13 @@ timeVaryingMappedFixedValuePointPatchField
startAverage_(ptf.startAverage_), startAverage_(ptf.startAverage_),
endSampleTime_(ptf.endSampleTime_), endSampleTime_(ptf.endSampleTime_),
endSampledValues_(ptf.endSampledValues_), endSampledValues_(ptf.endSampledValues_),
endAverage_(ptf.endAverage_) endAverage_(ptf.endAverage_),
offset_
(
ptf.offset_.valid()
? ptf.offset_().clone().ptr()
: NULL
)
{} {}
@ -532,10 +556,18 @@ void Foam::timeVaryingMappedFixedValuePointPatchField<Type>::updateCoeffs()
} }
} }
// apply offset to mapped values
if (offset_.valid())
{
const scalar t = this->db().time().timeOutputValue();
this->operator==(*this + offset_->value(t));
}
if (debug) if (debug)
{ {
Pout<< "updateCoeffs : set fixedValue to min:" << gMin(*this) Pout<< "updateCoeffs : set fixedValue to min:" << gMin(*this)
<< " max:" << gMax(*this) << endl; << " max:" << gMax(*this)
<< " avg:" << gAverage(*this) << endl;
} }
fixedValuePointPatchField<Type>::updateCoeffs(); fixedValuePointPatchField<Type>::updateCoeffs();
@ -550,13 +582,21 @@ void Foam::timeVaryingMappedFixedValuePointPatchField<Type>::write
{ {
fixedValuePointPatchField<Type>::write(os); fixedValuePointPatchField<Type>::write(os);
os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl; os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl;
if (perturb_ != 1e-5)
{
os.writeKeyword("perturb") << perturb_ << token::END_STATEMENT << nl; os.writeKeyword("perturb") << perturb_ << token::END_STATEMENT << nl;
}
if (fieldTableName_ != this->dimensionedInternalField().name()) if (fieldTableName_ != this->dimensionedInternalField().name())
{ {
os.writeKeyword("fieldTableName") << fieldTableName_ os.writeKeyword("fieldTableName") << fieldTableName_
<< token::END_STATEMENT << nl; << token::END_STATEMENT << nl;
} }
if (offset_.valid())
{
offset_->writeData(os);
}
} }

View File

@ -41,6 +41,7 @@ SourceFiles
#include "fixedValuePointPatchField.H" #include "fixedValuePointPatchField.H"
#include "instantList.H" #include "instantList.H"
#include "pointToPointPlanarInterpolation.H" #include "pointToPointPlanarInterpolation.H"
#include "DataEntry.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -91,6 +92,9 @@ class timeVaryingMappedFixedValuePointPatchField
//- If setAverage: end average value //- If setAverage: end average value
Type endAverage_; Type endAverage_;
//- Time varying offset values to interpolated data
autoPtr<DataEntry<Type> > offset_;
public: public:

View File

@ -55,6 +55,7 @@ class polyPatch;
class cyclicPolyPatch; class cyclicPolyPatch;
class processorPolyPatch; class processorPolyPatch;
class symmetryPlanePolyPatch;
class symmetryPolyPatch; class symmetryPolyPatch;
class wallPolyPatch; class wallPolyPatch;
class wedgePolyPatch; class wedgePolyPatch;
@ -248,6 +249,15 @@ protected:
template<class TrackData> template<class TrackData>
void hitWedgePatch(const wedgePolyPatch&, TrackData& td); void hitWedgePatch(const wedgePolyPatch&, TrackData& td);
//- Overridable function to handle the particle hitting a
// symmetryPlanePatch
template<class TrackData>
void hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
TrackData& td
);
//- Overridable function to handle the particle hitting a //- Overridable function to handle the particle hitting a
// symmetryPatch // symmetryPatch
template<class TrackData> template<class TrackData>

View File

@ -28,6 +28,7 @@ License
#include "cyclicPolyPatch.H" #include "cyclicPolyPatch.H"
#include "cyclicAMIPolyPatch.H" #include "cyclicAMIPolyPatch.H"
#include "processorPolyPatch.H" #include "processorPolyPatch.H"
#include "symmetryPlanePolyPatch.H"
#include "symmetryPolyPatch.H" #include "symmetryPolyPatch.H"
#include "wallPolyPatch.H" #include "wallPolyPatch.H"
#include "wedgePolyPatch.H" #include "wedgePolyPatch.H"
@ -585,6 +586,13 @@ Foam::scalar Foam::particle::trackToFace
static_cast<const wedgePolyPatch&>(patch), td static_cast<const wedgePolyPatch&>(patch), td
); );
} }
else if (isA<symmetryPlanePolyPatch>(patch))
{
p.hitSymmetryPlanePatch
(
static_cast<const symmetryPlanePolyPatch&>(patch), td
);
}
else if (isA<symmetryPolyPatch>(patch)) else if (isA<symmetryPolyPatch>(patch))
{ {
p.hitSymmetryPatch p.hitSymmetryPatch
@ -958,6 +966,20 @@ void Foam::particle::hitWedgePatch
} }
template<class TrackData>
void Foam::particle::hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch& spp,
TrackData&
)
{
vector nf = normal();
nf /= mag(nf);
transformProperties(I - 2.0*nf*nf);
}
template<class TrackData> template<class TrackData>
void Foam::particle::hitSymmetryPatch void Foam::particle::hitSymmetryPatch
( (

View File

@ -510,7 +510,7 @@ private:
const motionSmoother& meshMover, const motionSmoother& meshMover,
const label nSmoothNormals, const label nSmoothNormals,
const label nSmoothSurfaceNormals, const label nSmoothSurfaceNormals,
const scalar minMedianAxisAngleCos, const scalar minMedialAxisAngleCos,
const scalar featureAngle, const scalar featureAngle,
pointVectorField& dispVec, pointVectorField& dispVec,

View File

@ -864,7 +864,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
const motionSmoother& meshMover, const motionSmoother& meshMover,
const label nSmoothNormals, const label nSmoothNormals,
const label nSmoothSurfaceNormals, const label nSmoothSurfaceNormals,
const scalar minMedianAxisAngleCos, const scalar minMedialAxisAngleCos,
const scalar featureAngle, const scalar featureAngle,
pointVectorField& dispVec, pointVectorField& dispVec,
@ -1049,7 +1049,7 @@ void Foam::autoLayerDriver::medialAxisSmoothingInfo
{ {
// Unvisited point. See above about nUnvisit warning // Unvisited point. See above about nUnvisit warning
} }
else if (isMaxEdge(pointWallDist, edgeI, minMedianAxisAngleCos)) else if (isMaxEdge(pointWallDist, edgeI, minMedialAxisAngleCos))
{ {
// Both end points of edge have very different nearest wall // Both end points of edge have very different nearest wall
// point. Mark both points as medial axis points. // point. Mark both points as medial axis points.

View File

@ -154,10 +154,6 @@ Foam::layerParameters::layerParameters
( (
readScalar(dict.lookup("maxThicknessToMedialRatio")) readScalar(dict.lookup("maxThicknessToMedialRatio"))
), ),
minMedianAxisAngleCos_
(
Foam::cos(degToRad(readScalar(dict.lookup("minMedianAxisAngle"))))
),
nBufferCellsNoExtrude_ nBufferCellsNoExtrude_
( (
readLabel(dict.lookup("nBufferCellsNoExtrude")) readLabel(dict.lookup("nBufferCellsNoExtrude"))
@ -175,6 +171,18 @@ Foam::layerParameters::layerParameters
) )
) )
{ {
word angleKey = "minMedialAxisAngle";
if (!dict.found(angleKey))
{
// Backwards compatibility
angleKey = "minMedianAxisAngle";
}
minMedialAxisAngleCos_ = Foam::cos
(
degToRad(readScalar(dict.lookup(angleKey)))
);
// Detect layer specification mode // Detect layer specification mode
label nSpec = 0; label nSpec = 0;

View File

@ -134,7 +134,7 @@ private:
scalar maxThicknessToMedialRatio_; scalar maxThicknessToMedialRatio_;
scalar minMedianAxisAngleCos_; scalar minMedialAxisAngleCos_;
label nBufferCellsNoExtrude_; label nBufferCellsNoExtrude_;
@ -348,9 +348,9 @@ public:
} }
//- Angle used to pick up medial axis points //- Angle used to pick up medial axis points
scalar minMedianAxisAngleCos() const scalar minMedialAxisAngleCos() const
{ {
return minMedianAxisAngleCos_; return minMedialAxisAngleCos_;
} }
label nSnap() const label nSnap() const

View File

@ -106,7 +106,15 @@ void Foam::displacementMeshMoverMotionSolver::solve()
label nAllowableErrors = 0; label nAllowableErrors = 0;
labelList checkFaces(identity(mesh().nFaces())); labelList checkFaces(identity(mesh().nFaces()));
meshMover().move(coeffDict(), nAllowableErrors, checkFaces); meshMover().move
(
coeffDict().subDict(meshMover().type() + "Coeffs"),
nAllowableErrors,
checkFaces
);
// This will have updated the mesh and implicitly the pointDisplacement
pointDisplacement().correctBoundaryConditions();
} }

View File

@ -402,7 +402,7 @@ bool Foam::medialAxisMeshMover::isMaxEdge
void Foam::medialAxisMeshMover::update(const dictionary& coeffDict) void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
{ {
Info<< typeName Info<< typeName
<< " : Calculate distance to Medial Axis ..." << endl; << " : Calculating distance to Medial Axis ..." << endl;
const pointField& points = mesh().points(); const pointField& points = mesh().points();
@ -420,9 +420,15 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
); );
//- When is medial axis //- When is medial axis
const scalar minMedianAxisAngleCos = Foam::cos word angleKey = "minMedialAxisAngle";
if (!coeffDict.found(angleKey))
{
// Backwards compatibility
angleKey = "minMedianAxisAngle";
}
scalar minMedialAxisAngleCos = Foam::cos
( (
degToRad(readScalar(coeffDict.lookup("minMedianAxisAngle"))) degToRad(readScalar(coeffDict.lookup(angleKey)))
); );
//- Feature angle when to stop adding layers //- Feature angle when to stop adding layers
@ -442,6 +448,13 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
coeffDict.lookup("nSmoothNormals") coeffDict.lookup("nSmoothNormals")
); );
//- Number of edges walking out
const label nMedialAxisIter = coeffDict.lookupOrDefault<label>
(
"nMedialAxisIter",
mesh().globalData().nTotalPoints()
);
// Predetermine mesh edges // Predetermine mesh edges
// ~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~
@ -512,10 +525,10 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
wallInfo, wallInfo,
pointWallDist, pointWallDist,
edgeWallDist, edgeWallDist,
mesh().globalData().nTotalPoints(), // max iterations 0, // max iterations
dummyTrackData dummyTrackData
); );
wallDistCalc.iterate(nMedialAxisIter);
label nUnvisit = returnReduce label nUnvisit = returnReduce
( (
@ -524,6 +537,16 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
); );
if (nUnvisit > 0) if (nUnvisit > 0)
{
if (nMedialAxisIter > 0)
{
Info<< typeName
<< " : Limited walk to " << nMedialAxisIter
<< " steps. Not visited " << nUnvisit
<< " out of " << mesh().globalData().nTotalPoints()
<< " points" << endl;
}
else
{ {
WarningIn WarningIn
( (
@ -537,6 +560,7 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
<< " of the domain." << nl << endl; << " of the domain." << nl << endl;
} }
} }
}
// 2. Find points with max distance and transport information back to // 2. Find points with max distance and transport information back to
@ -564,8 +588,29 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
) )
{ {
// Unvisited point. See above about nUnvisit warning // Unvisited point. See above about nUnvisit warning
forAll(e, ep)
{
label pointI = e[ep];
if (!pointMedialDist[pointI].valid(dummyTrackData))
{
maxPoints.append(pointI);
maxInfo.append
(
pointData
(
points[pointI],
0.0,
pointI, // passive data
vector::zero // passive data
)
);
pointMedialDist[pointI] = maxInfo.last();
} }
else if (isMaxEdge(pointWallDist, edgeI, minMedianAxisAngleCos)) }
}
else if (isMaxEdge(pointWallDist, edgeI, minMedialAxisAngleCos))
{ {
// Both end points of edge have very different nearest wall // Both end points of edge have very different nearest wall
// point. Mark both points as medial axis points. // point. Mark both points as medial axis points.
@ -653,7 +698,8 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
if (pvf.fixesValue()) if (pvf.fixesValue())
{ {
// Disable all movement on fixedValue patchFields // Disable all movement on fixedValue patchFields
Info<< "Inserting all points on patch " << pp.name() Info<< typeName
<< " : Inserting all points on patch " << pp.name()
<< endl; << endl;
forAll(meshPoints, i) forAll(meshPoints, i)
@ -683,7 +729,8 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
// normal as the passive vector. Note that this points // normal as the passive vector. Note that this points
// out of the originating wall so inside of the domain // out of the originating wall so inside of the domain
// on this patch. // on this patch.
Info<< "Inserting points on patch " << pp.name() Info<< typeName
<< " : Inserting points on patch " << pp.name()
<< " if angle to nearest layer patch > " << " if angle to nearest layer patch > "
<< slipFeatureAngle << " degrees." << endl; << slipFeatureAngle << " degrees." << endl;
@ -753,16 +800,30 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
pointMedialDist, pointMedialDist,
edgeMedialDist, edgeMedialDist,
mesh().globalData().nTotalPoints(), // max iterations 0, // max iterations
dummyTrackData dummyTrackData
); );
medialDistCalc.iterate(2*nMedialAxisIter);
// Extract medial axis distance as pointScalarField // Extract medial axis distance as pointScalarField
forAll(pointMedialDist, pointI) forAll(pointMedialDist, pointI)
{ {
medialDist_[pointI] = Foam::sqrt(pointMedialDist[pointI].distSqr()); if (pointMedialDist[pointI].valid(dummyTrackData))
{
medialDist_[pointI] = Foam::sqrt
(
pointMedialDist[pointI].distSqr()
);
medialVec_[pointI] = pointMedialDist[pointI].origin(); medialVec_[pointI] = pointMedialDist[pointI].origin();
} }
else
{
// Unvisited. Do as if on medial axis so unmoving
medialDist_[pointI] = 0.0;
medialVec_[pointI] = point(1, 0, 0);
}
}
} }
// Extract transported surface normals as pointVectorField // Extract transported surface normals as pointVectorField
@ -1380,7 +1441,8 @@ void Foam::medialAxisMeshMover::findIsolatedRegions
} }
reduce(nPointCounter, sumOp<label>()); reduce(nPointCounter, sumOp<label>());
Info<< "Number isolated points extrusion stopped : "<< nPointCounter Info<< typeName
<< " : Number of isolated points extrusion stopped : "<< nPointCounter
<< endl; << endl;
} }
@ -1632,6 +1694,13 @@ void Foam::medialAxisMeshMover::calculateDisplacement
coeffDict.lookup("nSmoothThickness") coeffDict.lookup("nSmoothThickness")
); );
//- Number of edges walking out
const label nMedialAxisIter = coeffDict.lookupOrDefault<label>
(
"nMedialAxisIter",
mesh().globalData().nTotalPoints()
);
// Precalulate master points/edge (only relevant for shared points/edges) // Precalulate master points/edge (only relevant for shared points/edges)
const PackedBoolList isMasterPoint(syncTools::getMasterPoints(mesh())); const PackedBoolList isMasterPoint(syncTools::getMasterPoints(mesh()));
@ -1677,7 +1746,8 @@ void Foam::medialAxisMeshMover::calculateDisplacement
+ ".obj" + ".obj"
) )
); );
Info<< "Writing points with too large an extrusion distance to " Info<< typeName
<< " : Writing points with too large an extrusion distance to "
<< str().name() << endl; << str().name() << endl;
} }
@ -1694,8 +1764,9 @@ void Foam::medialAxisMeshMover::calculateDisplacement
+ ".obj" + ".obj"
) )
); );
Info<< "Writing points with too large an extrusion distance to " Info<< typeName
<< medialVecStr().name() << endl; << " : Writing medial axis vectors on points with too large"
<< " an extrusion distance to " << medialVecStr().name() << endl;
} }
forAll(meshPoints, patchPointI) forAll(meshPoints, patchPointI)
@ -1721,7 +1792,7 @@ void Foam::medialAxisMeshMover::calculateDisplacement
if (thicknessRatio > maxThicknessToMedialRatio) if (thicknessRatio > maxThicknessToMedialRatio)
{ {
// Truncate thickness. // Truncate thickness.
if (debug) if (debug&2)
{ {
Pout<< "truncating displacement at " Pout<< "truncating displacement at "
<< mesh().points()[pointI] << mesh().points()[pointI]
@ -1770,7 +1841,7 @@ void Foam::medialAxisMeshMover::calculateDisplacement
} }
reduce(numThicknessRatioExclude, sumOp<label>()); reduce(numThicknessRatioExclude, sumOp<label>());
Info<< typeName << " : Reduce layer thickness at " Info<< typeName << " : Reducing layer thickness at "
<< numThicknessRatioExclude << numThicknessRatioExclude
<< " nodes where thickness to medial axis distance is large " << endl; << " nodes where thickness to medial axis distance is large " << endl;
@ -1849,9 +1920,10 @@ void Foam::medialAxisMeshMover::calculateDisplacement
wallInfo, wallInfo,
pointWallDist, pointWallDist,
edgeWallDist, edgeWallDist,
mesh().globalData().nTotalPoints(), // max iterations 0, // max iterations
dummyTrackData dummyTrackData
); );
wallDistCalc.iterate(nMedialAxisIter);
} }
@ -1917,10 +1989,13 @@ bool Foam::medialAxisMeshMover::shrinkMesh
for (label iter = 0; iter < 2*nSnap ; iter++) for (label iter = 0; iter < 2*nSnap ; iter++)
{ {
Info<< "Iteration " << iter << endl; Info<< typeName
<< " : Iteration " << iter << endl;
if (iter == nSnap) if (iter == nSnap)
{ {
Info<< "Displacement scaling for error reduction set to 0." << endl; Info<< typeName
<< " : Displacement scaling for error reduction set to 0."
<< endl;
oldErrorReduction = meshMover_.setErrorReduction(0.0); oldErrorReduction = meshMover_.setErrorReduction(0.0);
} }
@ -1937,7 +2012,7 @@ bool Foam::medialAxisMeshMover::shrinkMesh
) )
) )
{ {
Info<< typeName << " :" << " Successfully moved mesh" << endl; Info<< typeName << " : Successfully moved mesh" << endl;
meshOk = true; meshOk = true;
break; break;
} }

View File

@ -141,6 +141,17 @@ void Foam::trackedParticle::hitWedgePatch
} }
void Foam::trackedParticle::hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
trackingData& td
)
{
// Remove particle
td.keepParticle = false;
}
void Foam::trackedParticle::hitSymmetryPatch void Foam::trackedParticle::hitSymmetryPatch
( (
const symmetryPolyPatch&, const symmetryPolyPatch&,

View File

@ -214,7 +214,15 @@ public:
); );
//- Overridable function to handle the particle hitting a //- Overridable function to handle the particle hitting a
// symmetryPlane // symmetry plane
void hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
trackingData& td
);
//- Overridable function to handle the particle hitting a
// symmetry patch
void hitSymmetryPatch void hitSymmetryPatch
( (
const symmetryPolyPatch&, const symmetryPolyPatch&,

View File

@ -210,37 +210,45 @@ void Foam::pointToPointPlanarInterpolation::calcWeights
nearestVertexWeight_ nearestVertexWeight_
); );
//if (debug) if (debug)
//{ {
// forAll(sourcePoints, i) forAll(sourcePoints, i)
// { {
// Pout<< "source:" << i << " at:" << sourcePoints[i] Pout<< "source:" << i << " at:" << sourcePoints[i]
// << " 2d:" << localVertices[i] << " 2d:" << localVertices[i]
// << endl; << endl;
// } }
//
//
// forAll(destPoints, i) forAll(destPoints, i)
// { {
// label v0 = nearestVertex_[i][0]; label v0 = nearestVertex_[i][0];
// label v1 = nearestVertex_[i][1]; label v1 = nearestVertex_[i][1];
// label v2 = nearestVertex_[i][2]; label v2 = nearestVertex_[i][2];
//
// Pout<< "For location " << destPoints[i] Pout<< "For location " << destPoints[i]
// << " 2d:" << localFaceCentres[i] << " 2d:" << localFaceCentres[i]
// << " sampling vertices" << nl << " sampling vertices" << nl
// << " " << v0 << " " << v0
// << " at:" << sourcePoints[v0] << " at:" << sourcePoints[v0]
// << " weight:" << nearestVertexWeight_[i][0] << nl << " weight:" << nearestVertexWeight_[i][0] << nl;
// << " " << v1
// << " at:" << sourcePoints[v1] if (v1 != -1)
// << " weight:" << nearestVertexWeight_[i][1] << nl {
// << " " << v2 Pout<< " " << v1
// << " at:" << sourcePoints[v2] << " at:" << sourcePoints[v1]
// << " weight:" << nearestVertexWeight_[i][2] << nl << " weight:" << nearestVertexWeight_[i][1] << nl;
// << endl; }
// } if (v2 != -1)
//} {
Pout<< " " << v2
<< " at:" << sourcePoints[v2]
<< " weight:" << nearestVertexWeight_[i][2] << nl;
}
Pout<< endl;
}
}
} }

View File

@ -140,6 +140,17 @@ void Foam::findCellParticle::hitWedgePatch
} }
void Foam::findCellParticle::hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
trackingData& td
)
{
// Remove particle
td.keepParticle = false;
}
void Foam::findCellParticle::hitSymmetryPatch void Foam::findCellParticle::hitSymmetryPatch
( (
const symmetryPolyPatch&, const symmetryPolyPatch&,

View File

@ -196,7 +196,15 @@ public:
); );
//- Overridable function to handle the particle hitting a //- Overridable function to handle the particle hitting a
// symmetryPlane // symmetry plane
void hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
trackingData& td
);
//- Overridable function to handle the particle hitting a
// symmetry patch
void hitSymmetryPatch void hitSymmetryPatch
( (
const symmetryPolyPatch&, const symmetryPolyPatch&,

View File

@ -345,6 +345,17 @@ void Foam::streamLineParticle::hitWedgePatch
} }
void Foam::streamLineParticle::hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch& pp,
trackingData& td
)
{
// Remove particle
td.keepParticle = false;
}
void Foam::streamLineParticle::hitSymmetryPatch void Foam::streamLineParticle::hitSymmetryPatch
( (
const symmetryPolyPatch& pp, const symmetryPolyPatch& pp,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -237,7 +237,15 @@ public:
); );
//- Overridable function to handle the particle hitting a //- Overridable function to handle the particle hitting a
// symmetryPlane // symmetry plane
void hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
trackingData& td
);
//- Overridable function to handle the particle hitting a
// symmetry patch
void hitSymmetryPatch void hitSymmetryPatch
( (
const symmetryPolyPatch&, const symmetryPolyPatch&,

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -159,7 +159,16 @@ protected:
); );
//- Overridable function to handle the particle hitting a //- Overridable function to handle the particle hitting a
// symmetryPlane // symmetry plane
template<class TrackData>
void hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch&,
TrackData& td
);
//- Overridable function to handle the particle hitting a
// symmetry patch
template<class TrackData> template<class TrackData>
void hitSymmetryPatch void hitSymmetryPatch
( (

View File

@ -80,6 +80,13 @@ void Foam::wallBoundedParticle::patchInteraction
static_cast<const wedgePolyPatch&>(patch), td static_cast<const wedgePolyPatch&>(patch), td
); );
} }
else if (isA<symmetryPlanePolyPatch>(patch))
{
p.hitSymmetryPlanePatch
(
static_cast<const symmetryPlanePolyPatch&>(patch), td
);
}
else if (isA<symmetryPolyPatch>(patch)) else if (isA<symmetryPolyPatch>(patch))
{ {
p.hitSymmetryPatch p.hitSymmetryPatch
@ -403,6 +410,18 @@ void Foam::wallBoundedParticle::hitWedgePatch
} }
template<class TrackData>
void Foam::wallBoundedParticle::hitSymmetryPlanePatch
(
const symmetryPlanePolyPatch& pp,
TrackData& td
)
{
// Remove particle
td.keepParticle = false;
}
template<class TrackData> template<class TrackData>
void Foam::wallBoundedParticle::hitSymmetryPatch void Foam::wallBoundedParticle::hitSymmetryPatch
( (

View File

@ -4,33 +4,4 @@ forces/forcesFunctionObject.C
forceCoeffs/forceCoeffs.C forceCoeffs/forceCoeffs.C
forceCoeffs/forceCoeffsFunctionObject.C forceCoeffs/forceCoeffsFunctionObject.C
sDoFRBM = pointPatchFields/derived/sixDoFRigidBodyMotion
$(sDoFRBM)/sixDoFRigidBodyMotion.C
$(sDoFRBM)/sixDoFRigidBodyMotionIO.C
$(sDoFRBM)/sixDoFRigidBodyMotionState.C
$(sDoFRBM)/sixDoFRigidBodyMotionStateIO.C
sDoFRBMR = $(sDoFRBM)/sixDoFRigidBodyMotionRestraint
$(sDoFRBMR)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C
$(sDoFRBMR)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C
$(sDoFRBMR)/linearAxialAngularSpring/linearAxialAngularSpring.C
$(sDoFRBMR)/linearSpring/linearSpring.C
$(sDoFRBMR)/sphericalAngularSpring/sphericalAngularSpring.C
$(sDoFRBMR)/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C
sDoFRBMC = $(sDoFRBM)/sixDoFRigidBodyMotionConstraint
$(sDoFRBMC)/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C
$(sDoFRBMC)/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C
$(sDoFRBMC)/fixedAxis/fixedAxis.C
$(sDoFRBMC)/fixedLine/fixedLine.C
$(sDoFRBMC)/fixedOrientation/fixedOrientation.C
$(sDoFRBMC)/fixedPlane/fixedPlane.C
$(sDoFRBMC)/fixedPoint/fixedPoint.C
pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C
pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C
LIB = $(FOAM_LIBBIN)/libforces LIB = $(FOAM_LIBBIN)/libforces

View File

@ -103,7 +103,7 @@ void Foam::regionModels::regionModel::initialise()
forAll(rbm, patchI) forAll(rbm, patchI)
{ {
const polyPatch& regionPatch = rbm[patchI]; const polyPatch& regionPatch = rbm[patchI];
if (isA<mappedWallPolyPatch>(regionPatch)) if (isA<mappedPatchBase>(regionPatch))
{ {
if (debug) if (debug)
{ {
@ -136,7 +136,7 @@ void Foam::regionModels::regionModel::initialise()
primaryPatchIDs_.transfer(primaryPatchIDs); primaryPatchIDs_.transfer(primaryPatchIDs);
intCoupledPatchIDs_.transfer(intCoupledPatchIDs); intCoupledPatchIDs_.transfer(intCoupledPatchIDs);
if (nBoundaryFaces == 0) if (returnReduce(nBoundaryFaces, sumOp<label>()) == 0)
{ {
WarningIn("regionModel::initialise()") WarningIn("regionModel::initialise()")
<< "Region model has no mapped boundary conditions - transfer " << "Region model has no mapped boundary conditions - transfer "

View File

@ -25,6 +25,9 @@ License
#include "thermalBaffleFvPatchScalarField.H" #include "thermalBaffleFvPatchScalarField.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "emptyPolyPatch.H"
#include "polyPatch.H"
#include "mappedWallPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -114,17 +117,6 @@ thermalBaffleFvPatchScalarField
owner_ = true; owner_ = true;
baffle_->rename(baffleName); baffle_->rename(baffleName);
} }
else if //Backwards compatibility (if region exists)
(
thisMesh.time().foundObject<fvMesh>(regionName)
&& baffle_.empty()
&& regionName != "none"
)
{
baffle_.reset(baffle::New(thisMesh, dict).ptr());
owner_ = true;
baffle_->rename(baffleName);
}
} }
} }
@ -168,19 +160,79 @@ void thermalBaffleFvPatchScalarField::rmap
void thermalBaffleFvPatchScalarField::createPatchMesh() void thermalBaffleFvPatchScalarField::createPatchMesh()
{ {
const fvMesh& defaultRegion =
db().time().lookupObject<fvMesh>(fvMesh::defaultRegion); const fvMesh& thisMesh = patch().boundaryMesh().mesh();
word regionName = dict_.lookup("regionName"); word regionName = dict_.lookup("regionName");
List<polyPatch*> regionPatches(3);
List<word> patchNames(regionPatches.size());
List<word> patchTypes(regionPatches.size());
List<dictionary> dicts(regionPatches.size());
patchNames[bottomPatchID] = word("bottom");
patchNames[sidePatchID] = word("side");
patchNames[topPatchID] = word("top");
patchTypes[bottomPatchID] = mappedWallPolyPatch::typeName;
patchTypes[topPatchID] = mappedWallPolyPatch::typeName;
if (readBool(dict_.lookup("columnCells")))
{
patchTypes[sidePatchID] = emptyPolyPatch::typeName;
}
else
{
patchTypes[sidePatchID] = polyPatch::typeName;
}
const mappedPatchBase& mpp =
refCast<const mappedPatchBase>(patch().patch());
const word coupleGroup(mpp.coupleGroup());
wordList inGroups(1);
inGroups[0] = coupleGroup;
dicts[bottomPatchID].add("coupleGroup", coupleGroup);
dicts[bottomPatchID].add("inGroups", inGroups);
dicts[bottomPatchID].add("sampleMode", mpp.sampleModeNames_[mpp.mode()]);
const label sepPos = coupleGroup.find('_');
const word coupleGroupSlave = coupleGroup(0, sepPos) + "_slave";
inGroups[0] = coupleGroupSlave;
dicts[topPatchID].add("coupleGroup", coupleGroupSlave);
dicts[topPatchID].add("inGroups", inGroups);
dicts[topPatchID].add("sampleMode", mpp.sampleModeNames_[mpp.mode()]);
forAll (regionPatches, patchI)
{
dictionary& patchDict = dicts[patchI];
patchDict.set("nFaces", 0);
patchDict.set("startFace", 0);
regionPatches[patchI] = polyPatch::New
(
patchTypes[patchI],
patchNames[patchI],
dicts[patchI],
patchI,
thisMesh.boundaryMesh()
).ptr();
}
extrudeMeshPtr_.reset extrudeMeshPtr_.reset
( (
new extrudePatchMesh new extrudePatchMesh
( (
defaultRegion, thisMesh,
patch(), patch(),
dict_, dict_,
regionName regionName,
regionPatches
) )
); );

View File

@ -182,6 +182,14 @@ class thermalBaffleFvPatchScalarField
{ {
// Private data // Private data
//- Enumeration of patch IDs
enum patchID
{
bottomPatchID,
topPatchID,
sidePatchID
};
//- Is the baffle owner //- Is the baffle owner
bool owner_; bool owner_;

View File

@ -0,0 +1,30 @@
sixDoFRigidBodyMotion/sixDoFRigidBodyMotion.C
sixDoFRigidBodyMotion/sixDoFRigidBodyMotionIO.C
sixDoFRigidBodyMotion/sixDoFRigidBodyMotionState.C
sixDoFRigidBodyMotion/sixDoFRigidBodyMotionStateIO.C
restraints = sixDoFRigidBodyMotion/sixDoFRigidBodyMotionRestraint
$(restraints)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraint.C
$(restraints)/sixDoFRigidBodyMotionRestraint/sixDoFRigidBodyMotionRestraintNew.C
$(restraints)/linearAxialAngularSpring/linearAxialAngularSpring.C
$(restraints)/linearSpring/linearSpring.C
$(restraints)/sphericalAngularSpring/sphericalAngularSpring.C
$(restraints)/tabulatedAxialAngularSpring/tabulatedAxialAngularSpring.C
constraints = sixDoFRigidBodyMotion/sixDoFRigidBodyMotionConstraint
$(constraints)/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraint.C
$(constraints)/sixDoFRigidBodyMotionConstraint/sixDoFRigidBodyMotionConstraintNew.C
$(constraints)/fixedAxis/fixedAxis.C
$(constraints)/fixedLine/fixedLine.C
$(constraints)/fixedOrientation/fixedOrientation.C
$(constraints)/fixedPlane/fixedPlane.C
$(constraints)/fixedPoint/fixedPoint.C
pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C
pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C
sixDoFRigidBodyMotionSolver/sixDoFRigidBodyMotionSolver.C
LIB = $(FOAM_LIBBIN)/libsixDoFRigidBodyMotion

View File

@ -0,0 +1,12 @@
EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/postProcessing/functionObjects/forces/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude
LIB_LIBS = \
-lforces \
-lmeshTools \
-lfileFormats \
-ldynamicMesh

View File

@ -238,10 +238,13 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::updateCoeffs()
g_ = g.value(); g_ = g.value();
} }
// scalar ramp = min(max((this->db().time().value() - 5)/10, 0), 1);
scalar ramp = 1.0;
motion_.updateAcceleration motion_.updateAcceleration
( (
f.forceEff() + g_*motion_.mass(), ramp*(f.forceEff() + g_*motion_.mass()),
f.momentEff(), ramp*(f.momentEff()),
t.deltaTValue() t.deltaTValue()
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "sixDoFRigidBodyMotion.H" #include "sixDoFRigidBodyMotion.H"
#include "septernion.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -175,6 +176,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion()
momentOfInertia_(diagTensor::one*VSMALL), momentOfInertia_(diagTensor::one*VSMALL),
mass_(VSMALL), mass_(VSMALL),
aRelax_(1.0), aRelax_(1.0),
aDamp_(1.0),
report_(false) report_(false)
{} {}
@ -192,6 +194,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
const tensor& initialQ, const tensor& initialQ,
const diagTensor& momentOfInertia, const diagTensor& momentOfInertia,
scalar aRelax, scalar aRelax,
scalar aDamp,
bool report bool report
) )
: :
@ -215,6 +218,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
momentOfInertia_(momentOfInertia), momentOfInertia_(momentOfInertia),
mass_(mass), mass_(mass),
aRelax_(aRelax), aRelax_(aRelax),
aDamp_(aDamp),
report_(report) report_(report)
{} {}
@ -239,6 +243,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion(const dictionary& dict)
momentOfInertia_(dict.lookup("momentOfInertia")), momentOfInertia_(dict.lookup("momentOfInertia")),
mass_(readScalar(dict.lookup("mass"))), mass_(readScalar(dict.lookup("mass"))),
aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)), aRelax_(dict.lookupOrDefault<scalar>("accelerationRelaxation", 1.0)),
aDamp_(dict.lookupOrDefault<scalar>("accelerationDamping", 1.0)),
report_(dict.lookupOrDefault<Switch>("report", false)) report_(dict.lookupOrDefault<Switch>("report", false))
{ {
addRestraints(dict); addRestraints(dict);
@ -264,6 +269,7 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
momentOfInertia_(sDoFRBM.momentOfInertia_), momentOfInertia_(sDoFRBM.momentOfInertia_),
mass_(sDoFRBM.mass_), mass_(sDoFRBM.mass_),
aRelax_(sDoFRBM.aRelax_), aRelax_(sDoFRBM.aRelax_),
aDamp_(sDoFRBM.aDamp_),
report_(sDoFRBM.report_) report_(sDoFRBM.report_)
{} {}
@ -375,8 +381,8 @@ void Foam::sixDoFRigidBodyMotion::updatePosition
if (Pstream::master()) if (Pstream::master())
{ {
v() = v0() + 0.5*deltaT0*a(); v() = v0() + aDamp_*0.5*deltaT0*a();
pi() = pi0() + 0.5*deltaT0*tau(); pi() = pi0() + aDamp_*0.5*deltaT0*tau();
// Leapfrog move part // Leapfrog move part
centreOfMass() = centreOfMass0() + deltaT*v(); centreOfMass() = centreOfMass0() + deltaT*v();
@ -426,8 +432,8 @@ void Foam::sixDoFRigidBodyMotion::updateAcceleration
applyConstraints(deltaT); applyConstraints(deltaT);
// Correct velocities // Correct velocities
v() += 0.5*deltaT*a(); v() += aDamp_*0.5*deltaT*a();
pi() += 0.5*deltaT*tau(); pi() += aDamp_*0.5*deltaT*tau();
if (report_) if (report_)
{ {
@ -446,8 +452,8 @@ void Foam::sixDoFRigidBodyMotion::updateVelocity(scalar deltaT)
if (Pstream::master()) if (Pstream::master())
{ {
v() += 0.5*deltaT*a(); v() += aDamp_*0.5*deltaT*a();
pi() += 0.5*deltaT*tau(); pi() += aDamp_*0.5*deltaT*tau();
if (report_) if (report_)
{ {
@ -528,4 +534,47 @@ void Foam::sixDoFRigidBodyMotion::status() const
} }
Foam::tmp<Foam::pointField> Foam::sixDoFRigidBodyMotion::currentPosition
(
const pointField& initialPoints
) const
{
return
(
centreOfMass()
+ (Q() & initialQ_.T() & (initialPoints - initialCentreOfMass_))
);
}
Foam::tmp<Foam::pointField> Foam::sixDoFRigidBodyMotion::scaledPosition
(
const pointField& initialPoints,
const scalarField& scale
) const
{
// Calculate the transformation septerion from the initial state
septernion s
(
centreOfMass() - initialCentreOfMass(),
quaternion(Q() & initialQ().T())
);
tmp<pointField> tpoints(new pointField(initialPoints));
pointField& points = tpoints();
forAll(points, pointi)
{
//- Slerp septernion
septernion ss(slerp(septernion::I, s, scale[pointi]));
points[pointi] =
initialCentreOfMass()
+ ss.transform(initialPoints[pointi] - initialCentreOfMass());
}
return tpoints;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -122,6 +122,9 @@ class sixDoFRigidBodyMotion
//- Acceleration relaxation coefficient //- Acceleration relaxation coefficient
scalar aRelax_; scalar aRelax_;
//- Acceleration damping coefficient (for steady-state simulations)
scalar aDamp_;
//- Switch to turn reporting of motion data on and off //- Switch to turn reporting of motion data on and off
Switch report_; Switch report_;
@ -264,6 +267,7 @@ public:
const tensor& initialQ, const tensor& initialQ,
const diagTensor& momentOfInertia, const diagTensor& momentOfInertia,
scalar aRelax = 1.0, scalar aRelax = 1.0,
scalar aDamp = 1.0,
bool report = false bool report = false
); );
@ -321,14 +325,19 @@ public:
//- Transform the given initial state pointField by the current //- Transform the given initial state pointField by the current
// motion state // motion state
inline tmp<pointField> currentPosition tmp<pointField> currentPosition(const pointField& initialPoints) const;
//- Transform the given initial state pointField by the current
// motion state
tmp<pointField> scaledPosition
( (
const pointField& pInitial const pointField& initialPoints,
const scalarField& scale
) const; ) const;
//- Transform the given initial state point by the current motion //- Transform the given initial state point by the current motion
// state // state
inline point currentPosition(const point& pInitial) const; inline point currentPosition(const point& initialPoints) const;
//- Transform the given initial state direction by the current //- Transform the given initial state direction by the current
// motion state // motion state
@ -344,7 +353,7 @@ public:
// additional supplied force and moment // additional supplied force and moment
point predictedPosition point predictedPosition
( (
const point& pInitial, const point& initialPoints,
const vector& deltaForce, const vector& deltaForce,
const vector& deltaMoment, const vector& deltaMoment,
scalar deltaT scalar deltaT

Some files were not shown because too many files have changed in this diff Show More