mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: snappyHexMesh: fixed points
This commit is contained in:
@ -30,7 +30,7 @@ meshMover = $(autoHexMesh)/externalDisplacementMeshMover
|
||||
$(meshMover)/displacementMeshMoverMotionSolver.C
|
||||
$(meshMover)/externalDisplacementMeshMover.C
|
||||
$(meshMover)/medialAxisMeshMover.C
|
||||
|
||||
$(meshMover)/zeroFixedValue/zeroFixedValuePointPatchFields.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libautoMesh
|
||||
|
||||
|
||||
@ -50,6 +50,7 @@ Description
|
||||
#include "PatchTools.H"
|
||||
#include "slipPointPatchFields.H"
|
||||
#include "fixedValuePointPatchFields.H"
|
||||
#include "zeroFixedValuePointPatchFields.H"
|
||||
#include "calculatedPointPatchFields.H"
|
||||
#include "cyclicSlipPointPatchFields.H"
|
||||
#include "fixedValueFvPatchFields.H"
|
||||
@ -826,7 +827,12 @@ Foam::autoLayerDriver::makeLayerDisplacementField
|
||||
{
|
||||
// 0 layers: do not allow slip so fixedValue 0
|
||||
// >0 layers: fixedValue which gets adapted
|
||||
if (numLayers[patchI] >= 0)
|
||||
if (numLayers[patchI] == 0)
|
||||
{
|
||||
patchFieldTypes[patchI] =
|
||||
zeroFixedValuePointPatchVectorField::typeName;
|
||||
}
|
||||
else if (numLayers[patchI] > 0)
|
||||
{
|
||||
patchFieldTypes[patchI] = fixedValuePointPatchVectorField::typeName;
|
||||
}
|
||||
|
||||
@ -33,6 +33,7 @@ License
|
||||
#include "PatchTools.H"
|
||||
#include "OBJstream.H"
|
||||
#include "pointData.H"
|
||||
#include "zeroFixedValuePointPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
@ -63,10 +64,18 @@ Foam::labelList Foam::medialAxisMeshMover::getFixedValueBCs
|
||||
fld.boundaryField()[patchI];
|
||||
|
||||
if (isA<valuePointPatchField<vector> >(patchFld))
|
||||
{
|
||||
if (isA<zeroFixedValuePointPatchField<vector> >(patchFld))
|
||||
{
|
||||
// Special condition of fixed boundary condition. Does not
|
||||
// get adapted
|
||||
}
|
||||
else
|
||||
{
|
||||
adaptPatchIDs.append(patchI);
|
||||
}
|
||||
}
|
||||
}
|
||||
return adaptPatchIDs;
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,10 @@ Description
|
||||
Mesh motion solver that uses a medial axis algorithm to work
|
||||
out a fraction between the (nearest point on a) moving surface
|
||||
and the (nearest point on a) fixed surface.
|
||||
This fraction is then used to scale the motion.
|
||||
This fraction is then used to scale the motion. Use
|
||||
- fixedValue on all moving patches
|
||||
- zeroFixedValue on stationary patches
|
||||
- slip on all slipping patches
|
||||
|
||||
SourceFiles
|
||||
medialAxisMeshMover.C
|
||||
|
||||
@ -0,0 +1,109 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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 "zeroFixedValuePointPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
zeroFixedValuePointPatchField<Type>::
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(p, iF)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
zeroFixedValuePointPatchField<Type>::
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(p, iF, dict, false)
|
||||
{
|
||||
fixedValuePointPatchField<Type>::operator=(pTraits<Type>::zero);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
zeroFixedValuePointPatchField<Type>::
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>& ptf,
|
||||
const pointPatch& p,
|
||||
const DimensionedField<Type, pointMesh>& iF,
|
||||
const pointPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(ptf, p, iF, mapper)
|
||||
{
|
||||
// For safety re-evaluate
|
||||
fixedValuePointPatchField<Type>::operator=(pTraits<Type>::zero);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
zeroFixedValuePointPatchField<Type>::
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>& ptf
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(ptf)
|
||||
{}
|
||||
|
||||
|
||||
template<class Type>
|
||||
zeroFixedValuePointPatchField<Type>::
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, pointMesh>& iF
|
||||
)
|
||||
:
|
||||
fixedValuePointPatchField<Type>(ptf, iF)
|
||||
{
|
||||
// For safety re-evaluate
|
||||
fixedValuePointPatchField<Type>::operator=(pTraits<Type>::zero);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,154 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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::zeroFixedValuePointPatchField
|
||||
|
||||
Description
|
||||
Enables the specification of a zero fixed value boundary condition.
|
||||
|
||||
Example of the boundary condition specification:
|
||||
\verbatim
|
||||
inlet
|
||||
{
|
||||
type zeroFixedValue;
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
zeroFixedValuePointPatchField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef zeroFixedValuePointPatchField_H
|
||||
#define zeroFixedValuePointPatchField_H
|
||||
|
||||
#include "fixedValuePointPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class zeroFixedValuePointPatchField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class zeroFixedValuePointPatchField
|
||||
:
|
||||
public fixedValuePointPatchField<Type>
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("zeroFixedValue");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given patchField<Type> onto a new patch
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>&,
|
||||
const pointPatch&,
|
||||
const DimensionedField<Type, pointMesh>&,
|
||||
const pointPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<Type>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<pointPatchField<Type> > clone() const
|
||||
{
|
||||
return autoPtr<pointPatchField<Type> >
|
||||
(
|
||||
new zeroFixedValuePointPatchField<Type>
|
||||
(
|
||||
*this
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
zeroFixedValuePointPatchField
|
||||
(
|
||||
const zeroFixedValuePointPatchField<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 zeroFixedValuePointPatchField<Type>
|
||||
(
|
||||
*this,
|
||||
iF
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "zeroFixedValuePointPatchField.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,43 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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 "zeroFixedValuePointPatchFields.H"
|
||||
#include "pointPatchFields.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFields(zeroFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,57 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2014 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/>.
|
||||
|
||||
InClass
|
||||
Foam::zeroFixedValuePointPatchFields
|
||||
|
||||
Description
|
||||
|
||||
SourceFiles
|
||||
zeroFixedValuePointPatchFields.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef zeroFixedValuePointPatchFields_H
|
||||
#define zeroFixedValuePointPatchFields_H
|
||||
|
||||
#include "zeroFixedValuePointPatchField.H"
|
||||
#include "fieldTypes.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makePointPatchFieldTypedefs(zeroFixedValue);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1972,7 +1972,7 @@ void Foam::meshRefinement::calculateEdgeWeights
|
||||
const edge& e = edges[edgeI];
|
||||
scalar eMag = max
|
||||
(
|
||||
VSMALL,
|
||||
SMALL,
|
||||
mag
|
||||
(
|
||||
pts[meshPoints[e[1]]]
|
||||
|
||||
Reference in New Issue
Block a user