mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: regionCoupled polyPatch, fvPatch and
energyRegionCoupledFvPatchScalarField and GAMG interfaces
This commit is contained in:
@ -61,6 +61,8 @@ wmake $makeType topoChangerFvMesh
|
||||
wmake $makeType ODE
|
||||
wmake $makeType randomProcesses
|
||||
|
||||
# ThermophysicalModels needs regionCoupled
|
||||
wmakeLnInclude regionCoupled
|
||||
thermophysicalModels/Allwmake $*
|
||||
transportModels/Allwmake $*
|
||||
turbulenceModels/Allwmake $*
|
||||
@ -76,6 +78,8 @@ wmake $makeType engine
|
||||
|
||||
wmake $makeType fieldSources
|
||||
|
||||
wmake $makeType regionCoupled
|
||||
|
||||
postProcessing/Allwmake $*
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
|
||||
@ -258,7 +258,8 @@ void Foam::GAMGAgglomeration::agglomerateLduAddressing
|
||||
(
|
||||
Pstream::nonBlocking,
|
||||
restrictMap
|
||||
)
|
||||
),
|
||||
fineLevelIndex
|
||||
).ptr()
|
||||
);
|
||||
|
||||
|
||||
@ -38,6 +38,7 @@ SourceFiles
|
||||
|
||||
#include "autoPtr.H"
|
||||
#include "lduInterfacePtrsList.H"
|
||||
#include "GAMGAgglomeration.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -99,14 +100,16 @@ public:
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
),
|
||||
(
|
||||
index,
|
||||
coarseInterfaces,
|
||||
fineInterface,
|
||||
localRestrictAddressing,
|
||||
neighbourRestrictAddressing
|
||||
neighbourRestrictAddressing,
|
||||
fineLevelIndex
|
||||
)
|
||||
);
|
||||
|
||||
@ -121,7 +124,8 @@ public:
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
);
|
||||
|
||||
|
||||
@ -135,7 +139,8 @@ public:
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface&,
|
||||
const labelField&,
|
||||
const labelField&
|
||||
const labelField&,
|
||||
const label fineLevelIndex = -1
|
||||
)
|
||||
:
|
||||
index_(index),
|
||||
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "GAMGInterface.H"
|
||||
#include "GAMGAgglomeration.H"
|
||||
#include "lduMatrix.H"
|
||||
|
||||
|
||||
@ -35,7 +36,8 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
)
|
||||
{
|
||||
const word coupleType(fineInterface.type());
|
||||
@ -65,7 +67,8 @@ Foam::autoPtr<Foam::GAMGInterface> Foam::GAMGInterface::New
|
||||
coarseInterfaces,
|
||||
fineInterface,
|
||||
localRestrictAddressing,
|
||||
neighbourRestrictAddressing
|
||||
neighbourRestrictAddressing,
|
||||
fineLevelIndex
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@ -50,7 +50,8 @@ Foam::cyclicGAMGInterface::cyclicGAMGInterface
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
)
|
||||
:
|
||||
GAMGInterface
|
||||
|
||||
@ -84,7 +84,8 @@ public:
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& restrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -49,7 +49,8 @@ Foam::processorCyclicGAMGInterface::processorCyclicGAMGInterface
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
)
|
||||
:
|
||||
processorGAMGInterface
|
||||
@ -58,7 +59,8 @@ Foam::processorCyclicGAMGInterface::processorCyclicGAMGInterface
|
||||
coarseInterfaces,
|
||||
fineInterface,
|
||||
localRestrictAddressing,
|
||||
neighbourRestrictAddressing
|
||||
neighbourRestrictAddressing,
|
||||
fineLevelIndex
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
@ -75,7 +75,8 @@ public:
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& restrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -50,7 +50,8 @@ Foam::processorGAMGInterface::processorGAMGInterface
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
)
|
||||
:
|
||||
GAMGInterface
|
||||
|
||||
@ -84,7 +84,8 @@ public:
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& restrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -30,6 +30,10 @@ derivedFvPatches = $(fvPatches)/derived
|
||||
$(derivedFvPatches)/wall/wallFvPatch.C
|
||||
$(derivedFvPatches)/mapped/mappedFvPatch.C
|
||||
$(derivedFvPatches)/mapped/mappedWallFvPatch.C
|
||||
$(derivedFvPatches)/regionCoupled/regionCoupledBaseFvPatch.C
|
||||
$(derivedFvPatches)/regionCoupled/regionCoupledFvPatch.C
|
||||
$(derivedFvPatches)/regionCoupled/regionCoupledWallFvPatch.C
|
||||
|
||||
|
||||
wallDist = fvMesh/wallDist
|
||||
$(wallDist)/wallPointYPlus/wallPointYPlus.C
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/triSurface/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
||||
LIB_LIBS = \
|
||||
-lOpenFOAM \
|
||||
|
||||
@ -40,6 +40,7 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
||||
"const fvPatch&, const DimensionedField<Type, volMesh>&) :"
|
||||
" patchFieldType="
|
||||
<< patchFieldType
|
||||
<< " : " << p.type()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -50,7 +51,7 @@ Foam::tmp<Foam::fvPatchField<Type> > Foam::fvPatchField<Type>::New
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"fvPatchField<Type>::New(const word&, const word&, const fvPatch&, "
|
||||
"fvPatchField<Type>::New(const word&, const word&, const fvPatch&,"
|
||||
"const DimensionedField<Type, volMesh>&)"
|
||||
) << "Unknown patchField type "
|
||||
<< patchFieldType << nl << nl
|
||||
|
||||
@ -0,0 +1,40 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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/>.
|
||||
|
||||
Description
|
||||
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionCoupledBaseFvPatch.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledBaseFvPatch, 0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,210 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledBaseFvPatch
|
||||
|
||||
Description
|
||||
Base class of regionCoupledFvPatch with common functionality for
|
||||
regionCoupledFvPatch and regionCoupledWallFvPatch
|
||||
|
||||
SourceFiles
|
||||
regionCoupledBaseFvPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledBaseFvPatch_H
|
||||
#define regionCoupledBaseFvPatch_H
|
||||
|
||||
#include "regionCoupledBase.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "polyPatch.H"
|
||||
#include "regionCoupledLduInterface.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledBaseFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledBaseFvPatch
|
||||
:
|
||||
public regionCoupledLduInterface
|
||||
{
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Reference to regionCoupledBase
|
||||
const regionCoupledBase& regionCoupledBase_;
|
||||
|
||||
//- Reference to fvPatch
|
||||
const fvPatch& patch_;
|
||||
|
||||
|
||||
// Protected members
|
||||
|
||||
//- Returns fvMesh
|
||||
const fvMesh& nbrFvMesh() const
|
||||
{
|
||||
return
|
||||
(
|
||||
patch_.boundaryMesh().mesh().time().lookupObject<fvMesh>
|
||||
(
|
||||
regionCoupledBase_.nbrRegionName()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupledBase");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from polyPatch
|
||||
regionCoupledBaseFvPatch
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const fvPatch& patch
|
||||
)
|
||||
:
|
||||
regionCoupledLduInterface(),
|
||||
regionCoupledBase_
|
||||
(
|
||||
refCast<const regionCoupledBase>(pp)
|
||||
),
|
||||
patch_(patch)
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledBaseFvPatch()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return neighbour
|
||||
virtual label neighbPatchID() const
|
||||
{
|
||||
return regionCoupledBase_.neighbPatchID();
|
||||
}
|
||||
|
||||
//- Is it the owner?
|
||||
virtual bool owner() const
|
||||
{
|
||||
return regionCoupledBase_.owner();
|
||||
}
|
||||
|
||||
//- Return regionCoupledBase neighb Patch
|
||||
virtual const regionCoupledBaseFvPatch& neighbPatch() const
|
||||
{
|
||||
return refCast<const regionCoupledBaseFvPatch>
|
||||
(
|
||||
nbrFvMesh().boundary()
|
||||
[
|
||||
regionCoupledBase_.neighbPatchID()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
//- Return a reference to the AMI interpolator
|
||||
virtual const AMIPatchToPatchInterpolation& AMI() const
|
||||
{
|
||||
return regionCoupledBase_.AMI();
|
||||
}
|
||||
|
||||
//- Returns neighbour polyMesh
|
||||
virtual const polyMesh& nbrMesh() const
|
||||
{
|
||||
return
|
||||
(
|
||||
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
|
||||
(
|
||||
regionCoupledBase_.nbrRegionName()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//- Return fvPatch
|
||||
const fvPatch& patch() const
|
||||
{
|
||||
return patch_;
|
||||
}
|
||||
|
||||
//- Returns if it is the same Region
|
||||
bool sameRegion() const
|
||||
{
|
||||
return regionCoupledBase_.sameRegion();
|
||||
}
|
||||
|
||||
//- Return regionCoupledPolyPatch
|
||||
const regionCoupledBase& regionCoupledPatch() const
|
||||
{
|
||||
return regionCoupledBase_;
|
||||
}
|
||||
|
||||
//- Return neighbor fvPatch
|
||||
const fvPatch& neighbFvPatch() const
|
||||
{
|
||||
return refCast<const fvPatch>
|
||||
(
|
||||
nbrFvMesh().boundary()
|
||||
[
|
||||
regionCoupledBase_.neighbPatchID()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
//- Return the interface type
|
||||
const word& regionCoupleType() const
|
||||
{
|
||||
return regionCoupledBase_.regionCoupleType();
|
||||
}
|
||||
|
||||
|
||||
//- Return faceCell addressing
|
||||
virtual const labelUList& faceCells() const = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,81 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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/>.
|
||||
|
||||
Description
|
||||
coupledFvPatch is an abstract base class for patches that couple regions
|
||||
of the computational domain e.g. cyclic and processor-processor links.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "regionCoupledFvPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledFvPatch, 0);
|
||||
addToRunTimeSelectionTable(fvPatch, regionCoupledFvPatch, polyPatch);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::regionCoupledFvPatch::interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData
|
||||
) const
|
||||
{
|
||||
return patchInternalField(internalData);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::regionCoupledFvPatch::internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF
|
||||
) const
|
||||
{
|
||||
if (neighbFvPatch().sameRegion())
|
||||
{
|
||||
return neighbFvPatch().patchInternalField(iF);
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
WarningIn
|
||||
(
|
||||
"regionCoupledFvPatch::internalFieldTransfer"
|
||||
"( const Pstream::commsTypes, const labelUList&)"
|
||||
" the internal field can not be transfered "
|
||||
" as the neighbFvPatch are in different meshes "
|
||||
);
|
||||
*/
|
||||
return tmp<labelField>(new labelField(iF.size(), 0));
|
||||
|
||||
}
|
||||
return tmp<labelField>(NULL);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,160 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledFvPatch
|
||||
|
||||
Description
|
||||
Common functionality for regionCoupleFvPatch and regionCoupledWallFvPatch
|
||||
|
||||
SourceFiles
|
||||
regionCoupledFvPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledFvPatch_H
|
||||
#define regionCoupledFvPatch_H
|
||||
|
||||
#include "fvPatch.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "regionCoupledPolyPatch.H"
|
||||
#include "regionCoupledBaseFvPatch.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledFvPatch
|
||||
:
|
||||
public lduInterface,
|
||||
public fvPatch,
|
||||
public regionCoupledBaseFvPatch
|
||||
{
|
||||
// Private data
|
||||
|
||||
const regionCoupledPolyPatch& regionCoupledPolyPatch_;
|
||||
|
||||
// Private members
|
||||
|
||||
//- Return regionCoupledFvPatch nbr
|
||||
const regionCoupledFvPatch& neighbFvPatch() const
|
||||
{
|
||||
return refCast<const regionCoupledFvPatch>
|
||||
(
|
||||
nbrFvMesh().boundary()
|
||||
[
|
||||
neighbPatchID()
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(regionCoupledPolyPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from polyPatch
|
||||
regionCoupledFvPatch(const polyPatch& patch, const fvBoundaryMesh& bm)
|
||||
:
|
||||
fvPatch(patch, bm),
|
||||
regionCoupledBaseFvPatch
|
||||
(
|
||||
patch,
|
||||
*this
|
||||
),
|
||||
regionCoupledPolyPatch_
|
||||
(
|
||||
refCast<const regionCoupledPolyPatch>(patch)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
~regionCoupledFvPatch()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return faceCell addressing
|
||||
virtual const labelUList& faceCells() const
|
||||
{
|
||||
return fvPatch::faceCells();
|
||||
}
|
||||
|
||||
//- Return true because this patch is coupled
|
||||
virtual bool coupled() const
|
||||
{
|
||||
return regionCoupledPolyPatch_.coupled();
|
||||
}
|
||||
|
||||
|
||||
// Interface transfer functions
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
// the interface as a field
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData
|
||||
) const;
|
||||
|
||||
//- Initialise neighbour field transfer
|
||||
virtual void initInternalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
labelUList& iF
|
||||
) const
|
||||
{}
|
||||
|
||||
//- Return neighbour field
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,69 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "regionCoupledWallFvPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledWallFvPatch, 0);
|
||||
addToRunTimeSelectionTable(fvPatch, regionCoupledWallFvPatch, polyPatch);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::regionCoupledWallFvPatch::
|
||||
interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData
|
||||
) const
|
||||
{
|
||||
return patchInternalField(internalData);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::regionCoupledWallFvPatch::
|
||||
internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF
|
||||
) const
|
||||
{
|
||||
if (neighbFvPatch().sameRegion())
|
||||
{
|
||||
return neighbFvPatch().patchInternalField(iF);
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<labelField>(new labelField(iF.size(), 0));
|
||||
|
||||
}
|
||||
return tmp<labelField>(NULL);
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,164 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledWallFvPatch
|
||||
|
||||
Description
|
||||
Foam::regionCoupledWallFvPatch
|
||||
|
||||
SourceFiles
|
||||
regionCoupledWallFvPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledWallFvPatch_H
|
||||
#define regionCoupledWallFvPatch_H
|
||||
|
||||
#include "wallFvPatch.H"
|
||||
#include "fvMesh.H"
|
||||
#include "Time.H"
|
||||
#include "regionCoupledWallPolyPatch.H"
|
||||
#include "regionCoupledBaseFvPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledWallFvPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledWallFvPatch
|
||||
:
|
||||
public lduInterface,
|
||||
public wallFvPatch,
|
||||
public regionCoupledBaseFvPatch
|
||||
{
|
||||
|
||||
// Private data
|
||||
|
||||
//- Const reference to regionCoupledWallPolyPatch
|
||||
const regionCoupledWallPolyPatch& regionCoupledPolyPatch_;
|
||||
|
||||
|
||||
// Private members
|
||||
|
||||
//- Return regionCoupledBaseFvPatch nbr
|
||||
const regionCoupledWallFvPatch& neighbFvPatch() const
|
||||
{
|
||||
return refCast<const regionCoupledWallFvPatch>
|
||||
(
|
||||
nbrFvMesh().boundary()[neighbPatchID()]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(regionCoupledWallPolyPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
regionCoupledWallFvPatch
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const fvBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
wallFvPatch(patch, bm),
|
||||
regionCoupledBaseFvPatch
|
||||
(
|
||||
patch,
|
||||
*this
|
||||
),
|
||||
regionCoupledPolyPatch_
|
||||
(
|
||||
refCast<const regionCoupledWallPolyPatch>(patch)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
~regionCoupledWallFvPatch()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return faceCell addressing
|
||||
virtual const labelUList& faceCells() const
|
||||
{
|
||||
return fvPatch::faceCells();
|
||||
}
|
||||
|
||||
//- Return true because this patch is coupled
|
||||
virtual bool coupled() const
|
||||
{
|
||||
return regionCoupledPolyPatch_.coupled();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Interface transfer functions
|
||||
|
||||
//- Return the values of the given internal data adjacent to
|
||||
// the interface as a field
|
||||
virtual tmp<labelField> interfaceInternalField
|
||||
(
|
||||
const labelUList& internalData
|
||||
) const;
|
||||
|
||||
//- Initialise neighbour field transfer
|
||||
virtual void initInternalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
labelUList& iF
|
||||
) const
|
||||
{}
|
||||
|
||||
//- Return neighbour field
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -25,6 +25,7 @@ License
|
||||
|
||||
#include "fvPatch.H"
|
||||
#include "HashTable.H"
|
||||
#include "cyclicAMIPolyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -50,7 +50,8 @@ Foam::cyclicAMIGAMGInterface::cyclicAMIGAMGInterface
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
)
|
||||
:
|
||||
GAMGInterface
|
||||
|
||||
@ -87,7 +87,8 @@ public:
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& restrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -187,4 +187,17 @@ mappedPatches/mappedPointPatch/mappedPointPatch.C
|
||||
mappedPatches/mappedPointPatch/mappedWallPointPatch.C
|
||||
|
||||
|
||||
regionCoupled/patches/regionCoupledPolyPatch/regionCoupledBase.C
|
||||
regionCoupled/patches/regionCoupledPolyPatch/regionCoupledPolyPatch.C
|
||||
regionCoupled/patches/regionCoupledPolyPatch/regionCoupledWallPolyPatch.C
|
||||
regionCoupled/patches/regionCoupledLduInterface/regionCoupledLduInterface.C
|
||||
regionCoupled/patches/regionCoupledPointPatch/regionCoupledPointPatch.C
|
||||
regionCoupled/patches/regionCoupledPointPatch/regionCoupledWallPointPatch.C
|
||||
|
||||
regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledBaseGAMGInterface.C
|
||||
regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledGAMGInterface.C
|
||||
regionCoupled/GAMG/interfaces/regionCoupledGAMGInterface/regionCoupledWallGAMGInterface.C
|
||||
regionCoupled/GAMG/interfaceFields/regionCoupledGAMGInterfaceField/regionCoupledGAMGInterfaceField.C
|
||||
regionCoupled/GAMG/interfaceFields/regionCoupledGAMGInterfaceField/regionCoupledWallGAMGInterfaceField.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libmeshTools
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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 "regionCoupledGAMGInterfaceField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "lduMatrix.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledGAMGInterfaceField, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
GAMGInterfaceField,
|
||||
regionCoupledGAMGInterfaceField,
|
||||
lduInterface
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledGAMGInterfaceField::regionCoupledGAMGInterfaceField
|
||||
(
|
||||
const GAMGInterface& GAMGCp,
|
||||
const lduInterfaceField& fineInterface
|
||||
)
|
||||
:
|
||||
GAMGInterfaceField(GAMGCp, fineInterface),
|
||||
regionCoupledGAMGInterface_
|
||||
(
|
||||
refCast<const regionCoupledGAMGInterface>(GAMGCp)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledGAMGInterfaceField::~regionCoupledGAMGInterfaceField()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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::regionCoupledGAMGInterfaceField
|
||||
|
||||
Description
|
||||
GAMG agglomerated region coupled interface field.
|
||||
|
||||
SourceFiles
|
||||
regionCoupledGAMGInterfaceField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledGAMGInterfaceField_H
|
||||
#define regionCoupledGAMGInterfaceField_H
|
||||
|
||||
#include "GAMGInterfaceField.H"
|
||||
#include "regionCoupledGAMGInterface.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledGAMGInterfaceField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledGAMGInterfaceField
|
||||
:
|
||||
public GAMGInterfaceField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Local reference cast into the cyclic interface
|
||||
const regionCoupledGAMGInterface& regionCoupledGAMGInterface_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
regionCoupledGAMGInterfaceField
|
||||
(
|
||||
const regionCoupledGAMGInterfaceField&
|
||||
);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const regionCoupledGAMGInterfaceField&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupled");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from GAMG interface and fine level interface field
|
||||
regionCoupledGAMGInterfaceField
|
||||
(
|
||||
const GAMGInterface& GAMGCp,
|
||||
const lduInterfaceField& fineInterfaceField
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledGAMGInterfaceField();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return size
|
||||
label size() const
|
||||
{
|
||||
return regionCoupledGAMGInterface_.size();
|
||||
}
|
||||
|
||||
|
||||
//- Interface matrix update
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
scalarField&,
|
||||
const scalarField&,
|
||||
const scalarField&,
|
||||
const direction,
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,66 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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 "regionCoupledWallGAMGInterfaceField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "lduMatrix.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledWallGAMGInterfaceField, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
GAMGInterfaceField,
|
||||
regionCoupledWallGAMGInterfaceField,
|
||||
lduInterface
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledWallGAMGInterfaceField::regionCoupledWallGAMGInterfaceField
|
||||
(
|
||||
const GAMGInterface& GAMGCp,
|
||||
const lduInterfaceField& fineInterface
|
||||
)
|
||||
:
|
||||
GAMGInterfaceField(GAMGCp, fineInterface),
|
||||
regionCoupledGAMGInterface_
|
||||
(
|
||||
refCast<const regionCoupledWallGAMGInterface>(GAMGCp)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledWallGAMGInterfaceField::~regionCoupledWallGAMGInterfaceField()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,126 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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::regionCoupledWallGAMGInterfaceField
|
||||
|
||||
Description
|
||||
GAMG agglomerated region coupled interface field.
|
||||
|
||||
SourceFiles
|
||||
regionCoupledWallGAMGInterfaceField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledWallGAMGInterfaceField_H
|
||||
#define regionCoupledWallGAMGInterfaceField_H
|
||||
|
||||
#include "GAMGInterfaceField.H"
|
||||
#include "regionCoupledWallGAMGInterface.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledWallGAMGInterfaceField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledWallGAMGInterfaceField
|
||||
:
|
||||
public GAMGInterfaceField
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Local reference cast into the region coupled interface
|
||||
const regionCoupledWallGAMGInterface& regionCoupledGAMGInterface_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
regionCoupledWallGAMGInterfaceField
|
||||
(
|
||||
const regionCoupledWallGAMGInterfaceField&
|
||||
);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const regionCoupledWallGAMGInterfaceField&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupledWall");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from GAMG interface and fine level interface field
|
||||
regionCoupledWallGAMGInterfaceField
|
||||
(
|
||||
const GAMGInterface& GAMGCp,
|
||||
const lduInterfaceField& fineInterfaceField
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledWallGAMGInterfaceField();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return size
|
||||
label size() const
|
||||
{
|
||||
return regionCoupledGAMGInterface_.size();
|
||||
}
|
||||
|
||||
|
||||
//- Interface matrix update
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
scalarField&,
|
||||
const scalarField&,
|
||||
const scalarField&,
|
||||
const direction,
|
||||
const Pstream::commsTypes commsType
|
||||
) const
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,261 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "AMIInterpolation.H"
|
||||
#include "regionCoupledBaseGAMGInterface.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "Map.H"
|
||||
#include "polyMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledBaseGAMGInterface::regionCoupledBaseGAMGInterface
|
||||
(
|
||||
const label index,
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
)
|
||||
:
|
||||
GAMGInterface
|
||||
(
|
||||
index,
|
||||
coarseInterfaces,
|
||||
fineInterface,
|
||||
localRestrictAddressing,
|
||||
neighbourRestrictAddressing,
|
||||
fineLevelIndex
|
||||
),
|
||||
fineRegionCoupledLduInterface_
|
||||
(
|
||||
refCast<const regionCoupledLduInterface>(fineInterface)
|
||||
)
|
||||
{
|
||||
/*
|
||||
// Construct face agglomeration from cell agglomeration
|
||||
{
|
||||
// From coarse face to cell
|
||||
DynamicList<label> dynFaceCells(localRestrictAddressing.size());
|
||||
|
||||
// From face to coarse face
|
||||
DynamicList<label> dynFaceRestrictAddressing
|
||||
(
|
||||
localRestrictAddressing.size()
|
||||
);
|
||||
|
||||
Map<label> masterToCoarseFace(localRestrictAddressing.size());
|
||||
|
||||
forAll(localRestrictAddressing, ffi)
|
||||
{
|
||||
label curMaster = localRestrictAddressing[ffi];
|
||||
|
||||
Map<label>::const_iterator fnd = masterToCoarseFace.find
|
||||
(
|
||||
curMaster
|
||||
);
|
||||
|
||||
if (fnd == masterToCoarseFace.end())
|
||||
{
|
||||
// New coarse face
|
||||
label coarseI = dynFaceCells.size();
|
||||
dynFaceRestrictAddressing.append(coarseI);
|
||||
dynFaceCells.append(curMaster);
|
||||
masterToCoarseFace.insert(curMaster, coarseI);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Already have coarse face
|
||||
dynFaceRestrictAddressing.append(fnd());
|
||||
}
|
||||
}
|
||||
|
||||
faceCells_.transfer(dynFaceCells);
|
||||
faceRestrictAddressing_.transfer(dynFaceRestrictAddressing);
|
||||
}
|
||||
|
||||
// On the owner side construct the AMI
|
||||
if (fineRegionCoupledLduInterface_.owner())
|
||||
{
|
||||
const polyMesh& nbrMesh =
|
||||
fineRegionCoupledLduInterface_.nbrMesh();
|
||||
|
||||
if
|
||||
(
|
||||
nbrMesh.foundObject<GAMGAgglomeration>(GAMGAgglomeration::typeName)
|
||||
)
|
||||
{
|
||||
const GAMGAgglomeration& nbrAgg = nbrMesh.thisDb().lookupObject
|
||||
<
|
||||
GAMGAgglomeration
|
||||
>
|
||||
(
|
||||
GAMGAgglomeration::typeName
|
||||
);
|
||||
|
||||
label nbrLevel(-1);
|
||||
if (nbrAgg.size() > fineLevelIndex)
|
||||
{
|
||||
nbrLevel = fineLevelIndex;
|
||||
}
|
||||
else
|
||||
{
|
||||
nbrLevel = nbrAgg.size() - 1;
|
||||
}
|
||||
|
||||
const labelField& nbrRestrictMap =
|
||||
nbrAgg.restrictAddressing(nbrLevel);
|
||||
|
||||
const labelUList& nbrFaceCells =
|
||||
nbrLduInterface
|
||||
(
|
||||
nbrLevel,
|
||||
neighbPatchID()
|
||||
).faceCells();
|
||||
|
||||
|
||||
const IndirectList<label> nbrPatchRestrictMap
|
||||
(
|
||||
nbrRestrictMap,
|
||||
nbrFaceCells
|
||||
);
|
||||
|
||||
labelList nbrFaceRestrictAddressing;
|
||||
{
|
||||
// From face to coarse face
|
||||
DynamicList<label> dynNbrFaceRestrictAddressing
|
||||
(
|
||||
nbrPatchRestrictMap.size()
|
||||
);
|
||||
|
||||
Map<label> masterToCoarseFace(nbrPatchRestrictMap.size());
|
||||
|
||||
forAll(nbrPatchRestrictMap, ffi)
|
||||
{
|
||||
label curMaster = nbrPatchRestrictMap[ffi];
|
||||
|
||||
Map<label>::const_iterator fnd = masterToCoarseFace.find
|
||||
(
|
||||
curMaster
|
||||
);
|
||||
|
||||
if (fnd == masterToCoarseFace.end())
|
||||
{
|
||||
// New coarse face
|
||||
label coarseI = masterToCoarseFace.size();
|
||||
dynNbrFaceRestrictAddressing.append(coarseI);
|
||||
masterToCoarseFace.insert(curMaster, coarseI);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Already have coarse face
|
||||
dynNbrFaceRestrictAddressing.append(fnd());
|
||||
}
|
||||
}
|
||||
|
||||
nbrFaceRestrictAddressing.transfer
|
||||
(
|
||||
dynNbrFaceRestrictAddressing
|
||||
);
|
||||
}
|
||||
|
||||
amiPtr_.reset
|
||||
(
|
||||
new AMIPatchToPatchInterpolation
|
||||
(
|
||||
fineRegionCoupledLduInterface_.AMI(),
|
||||
faceRestrictAddressing_,
|
||||
nbrFaceRestrictAddressing
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"regionCoupledBaseGAMGInterface::"
|
||||
"regionCoupledBaseGAMGInterface"
|
||||
"("
|
||||
"const label index,"
|
||||
"const lduInterfacePtrsList& coarseInterfaces,"
|
||||
"const lduInterface& fineInterface,"
|
||||
"const labelField& localRestrictAddressing,"
|
||||
"const labelField& neighbourRestrictAddressing,"
|
||||
"const label fineLevelIndex"
|
||||
")"
|
||||
) << " GAMGAgglomeration was not found in the nbr mesh. "
|
||||
<< " Check on the cacheAgglomeration flag in fvSolution"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledBaseGAMGInterface::~regionCoupledBaseGAMGInterface()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::tmp<Foam::labelField> Foam::regionCoupledBaseGAMGInterface::
|
||||
internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes,
|
||||
const labelUList& iF
|
||||
) const
|
||||
{
|
||||
/*
|
||||
WarningIn
|
||||
(
|
||||
"regionCoupledBaseGAMGInterface::internalFieldTransfer"
|
||||
"( const Pstream::commsTypes, const labelUList&)"
|
||||
" the internal field can not be transfered "
|
||||
" as the neighbFvPatch are in different meshes "
|
||||
);
|
||||
|
||||
//const labelUList& nbrFaceCells = neighbPatch().faceCells();
|
||||
|
||||
const labelUList& nbrFaceCells = nbrLduInterface().faceCells();
|
||||
|
||||
tmp<labelField> tpnf(new labelField(nbrFaceCells.size()));
|
||||
labelField& pnf = tpnf();
|
||||
|
||||
forAll(pnf, facei)
|
||||
{
|
||||
pnf[facei] = iF[nbrFaceCells[facei]];
|
||||
}
|
||||
*/
|
||||
tmp<labelField> tpnf(new labelField(iF));
|
||||
|
||||
return tpnf;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,169 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledBaseGAMGInterface
|
||||
|
||||
Description
|
||||
Base class for GAMG agglomerated coupled region interface.
|
||||
|
||||
SourceFiles
|
||||
regionCoupledBaseGAMGInterface.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledBaseGAMGInterface_H
|
||||
#define regionCoupledBaseGAMGInterface_H
|
||||
|
||||
#include "GAMGInterface.H"
|
||||
#include "regionCoupledLduInterface.H"
|
||||
#include "GAMGAgglomeration.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledBaseGAMGInterface Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledBaseGAMGInterface
|
||||
:
|
||||
public GAMGInterface,
|
||||
virtual public regionCoupledLduInterface
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Reference for the regionCoupledBaseFvPatch from which this is
|
||||
// agglomerated
|
||||
const regionCoupledLduInterface& fineRegionCoupledLduInterface_;
|
||||
|
||||
//- AMI interface
|
||||
//autoPtr<AMIPatchToPatchInterpolation> amiPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
regionCoupledBaseGAMGInterface(const regionCoupledBaseGAMGInterface&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const regionCoupledBaseGAMGInterface&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from fine level interface,
|
||||
// local and neighbour restrict addressing
|
||||
regionCoupledBaseGAMGInterface
|
||||
(
|
||||
const label index,
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& restrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledBaseGAMGInterface();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Interface transfer functions
|
||||
|
||||
//- Transfer and return internal field adjacent to the interface
|
||||
virtual tmp<labelField> internalFieldTransfer
|
||||
(
|
||||
const Pstream::commsTypes commsType,
|
||||
const labelUList& iF
|
||||
) const;
|
||||
|
||||
|
||||
//- Cyclic interface functions
|
||||
|
||||
//- Return neigbour processor number
|
||||
virtual label neighbPatchID() const
|
||||
{
|
||||
return fineRegionCoupledLduInterface_.neighbPatchID();
|
||||
}
|
||||
|
||||
virtual bool owner() const
|
||||
{
|
||||
return fineRegionCoupledLduInterface_.owner();
|
||||
}
|
||||
|
||||
virtual const regionCoupledBaseGAMGInterface& neighbPatch() const
|
||||
{
|
||||
return dynamic_cast<const regionCoupledBaseGAMGInterface&>
|
||||
(
|
||||
fineRegionCoupledLduInterface_.neighbPatch()
|
||||
);
|
||||
}
|
||||
|
||||
//virtual const AMIPatchToPatchInterpolation& AMI() const
|
||||
//{
|
||||
// return amiPtr_();
|
||||
//}
|
||||
|
||||
virtual const polyMesh& nbrMesh() const
|
||||
{
|
||||
return fineRegionCoupledLduInterface_.nbrMesh();
|
||||
}
|
||||
|
||||
const lduInterface& nbrLduInterface
|
||||
(
|
||||
const label fineLevelIndex,
|
||||
const label index
|
||||
) const
|
||||
{
|
||||
const GAMGAgglomeration& agg = nbrMesh().thisDb().lookupObject
|
||||
<
|
||||
GAMGAgglomeration
|
||||
>
|
||||
(
|
||||
GAMGAgglomeration::typeName
|
||||
);
|
||||
|
||||
const lduMesh& mesh = agg.meshLevel(fineLevelIndex);
|
||||
return mesh.interfaces()[index];
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,73 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "regionCoupledGAMGInterface.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledGAMGInterface, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
GAMGInterface,
|
||||
regionCoupledGAMGInterface,
|
||||
lduInterface
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledGAMGInterface::regionCoupledGAMGInterface
|
||||
(
|
||||
const label index,
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
)
|
||||
:
|
||||
regionCoupledBaseGAMGInterface
|
||||
(
|
||||
index,
|
||||
coarseInterfaces,
|
||||
fineInterface,
|
||||
localRestrictAddressing,
|
||||
neighbourRestrictAddressing,
|
||||
fineLevelIndex
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledGAMGInterface::~regionCoupledGAMGInterface()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,98 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledGAMGInterface
|
||||
|
||||
Description
|
||||
GAMG agglomerated coupled region interface.
|
||||
|
||||
SourceFiles
|
||||
regionCoupledGAMGInterface.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledGAMGInterface_H
|
||||
#define regionCoupledGAMGInterface_H
|
||||
|
||||
#include "regionCoupledBaseGAMGInterface.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledGAMGInterface Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledGAMGInterface
|
||||
:
|
||||
public regionCoupledBaseGAMGInterface
|
||||
{
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
regionCoupledGAMGInterface(const regionCoupledGAMGInterface&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const regionCoupledGAMGInterface&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupled");
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from fine level interface,
|
||||
// local and neighbour restrict addressing
|
||||
regionCoupledGAMGInterface
|
||||
(
|
||||
const label index,
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& restrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledGAMGInterface();
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,73 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "regionCoupledWallGAMGInterface.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledWallGAMGInterface, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
GAMGInterface,
|
||||
regionCoupledWallGAMGInterface,
|
||||
lduInterface
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledWallGAMGInterface::regionCoupledWallGAMGInterface
|
||||
(
|
||||
const label index,
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& localRestrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
)
|
||||
:
|
||||
regionCoupledBaseGAMGInterface
|
||||
(
|
||||
index,
|
||||
coarseInterfaces,
|
||||
fineInterface,
|
||||
localRestrictAddressing,
|
||||
neighbourRestrictAddressing,
|
||||
fineLevelIndex
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Desstructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledWallGAMGInterface::~regionCoupledWallGAMGInterface()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,99 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledWallGAMGInterface
|
||||
|
||||
Description
|
||||
GAMG agglomerated coupled region interface.
|
||||
|
||||
SourceFiles
|
||||
regionCoupledWallGAMGInterface.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledWallGAMGInterface_H
|
||||
#define regionCoupledWallGAMGInterface_H
|
||||
|
||||
#include "regionCoupledBaseGAMGInterface.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledWallGAMGInterface Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledWallGAMGInterface
|
||||
:
|
||||
public regionCoupledBaseGAMGInterface
|
||||
{
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
regionCoupledWallGAMGInterface(const regionCoupledWallGAMGInterface&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const regionCoupledWallGAMGInterface&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupledWall");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from fine level interface,
|
||||
// local and neighbour restrict addressing
|
||||
regionCoupledWallGAMGInterface
|
||||
(
|
||||
const label index,
|
||||
const lduInterfacePtrsList& coarseInterfaces,
|
||||
const lduInterface& fineInterface,
|
||||
const labelField& restrictAddressing,
|
||||
const labelField& neighbourRestrictAddressing,
|
||||
const label fineLevelIndex
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledWallGAMGInterface();
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "regionCoupledLduInterface.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(Foam::regionCoupledLduInterface, 0);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledLduInterface::~regionCoupledLduInterface()
|
||||
{}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,103 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledLduInterface
|
||||
|
||||
Description
|
||||
An abstract base class for region coupled interfaces
|
||||
|
||||
SourceFiles
|
||||
regionCoupledLduInterface.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledLduInterface_H
|
||||
#define regionCoupledLduInterface_H
|
||||
|
||||
#include "primitiveFieldsFwd.H"
|
||||
#include "AMIPatchToPatchInterpolation.H"
|
||||
#include "polyMesh.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledLduInterface Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledLduInterface
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupledLduInterface");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct null
|
||||
regionCoupledLduInterface()
|
||||
{}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledLduInterface();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return neighbour
|
||||
virtual label neighbPatchID() const = 0;
|
||||
|
||||
//- Is it owner?
|
||||
virtual bool owner() const = 0;
|
||||
|
||||
//- Return neighb regionCoupledLduInterface
|
||||
virtual const regionCoupledLduInterface& neighbPatch() const = 0;
|
||||
|
||||
//- Return AMI
|
||||
//virtual const AMIPatchToPatchInterpolation& AMI() const = 0;
|
||||
|
||||
//- Return nbrMesh
|
||||
virtual const polyMesh& nbrMesh() const = 0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,48 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "regionCoupledPointPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(regionCoupledPointPatch, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
facePointPatch,
|
||||
regionCoupledPointPatch,
|
||||
polyPatch
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,84 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledPointPatch
|
||||
|
||||
Description
|
||||
Cyclic AMI point patch - place holder only
|
||||
|
||||
SourceFiles
|
||||
regionCoupledPointPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledPointPatch_H
|
||||
#define regionCoupledPointPatch_H
|
||||
|
||||
#include "facePointPatch.H"
|
||||
#include "regionCoupledPolyPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledPointPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledPointPatch
|
||||
:
|
||||
public facePointPatch
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(regionCoupledPolyPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
regionCoupledPointPatch
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const pointBoundaryMesh& bm
|
||||
):
|
||||
facePointPatch(patch, bm)
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,48 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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 "regionCoupledWallPointPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
defineTypeNameAndDebug(regionCoupledWallPointPatch, 0);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
facePointPatch,
|
||||
regionCoupledWallPointPatch,
|
||||
polyPatch
|
||||
);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,84 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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::regionCoupledWallPointPatch
|
||||
|
||||
Description
|
||||
Cyclic AMI point patch - place holder only
|
||||
|
||||
SourceFiles
|
||||
regionCoupledWallPointPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledWallPointPatch_H
|
||||
#define regionCoupledWallPointPatch_H
|
||||
|
||||
#include "facePointPatch.H"
|
||||
#include "regionCoupledWallPolyPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledWallPointPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledWallPointPatch
|
||||
:
|
||||
public facePointPatch
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName(regionCoupledWallPolyPatch::typeName_());
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
regionCoupledWallPointPatch
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const pointBoundaryMesh& bm
|
||||
):
|
||||
facePointPatch(patch, bm)
|
||||
{}
|
||||
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,369 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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 "regionCoupledBase.H"
|
||||
#include "SubField.H"
|
||||
#include "polyMesh.H"
|
||||
#include "Time.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledBase, 0);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionCoupledBase::resetAMI() const
|
||||
{
|
||||
if (owner())
|
||||
{
|
||||
AMIPtr_.clear();
|
||||
|
||||
const polyPatch& nbr = refCast<const polyPatch>(neighbPatch());
|
||||
pointField nbrPoints = nbr.localPoints();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
const Time& t = patch_.boundaryMesh().mesh().time();
|
||||
OFstream os(t.path()/patch_.name() + "_neighbourPatch-org.obj");
|
||||
meshTools::writeOBJ(os, nbr.localFaces(), nbrPoints);
|
||||
}
|
||||
|
||||
// transform neighbour patch to local system
|
||||
//transformPosition(nbrPoints);
|
||||
primitivePatch nbrPatch0
|
||||
(
|
||||
SubList<face>
|
||||
(
|
||||
nbr.localFaces(),
|
||||
nbr.size()
|
||||
),
|
||||
nbrPoints
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
const Time& t = patch_.boundaryMesh().mesh().time();
|
||||
OFstream osN(t.path()/patch_.name() + "_neighbourPatch-trans.obj");
|
||||
meshTools::writeOBJ(osN, nbrPatch0.localFaces(), nbrPoints);
|
||||
|
||||
OFstream osO(t.path()/patch_.name() + "_ownerPatch.obj");
|
||||
meshTools::writeOBJ
|
||||
(
|
||||
osO,
|
||||
patch_.localFaces(),
|
||||
patch_.localPoints()
|
||||
);
|
||||
}
|
||||
|
||||
// Construct/apply AMI interpolation to determine addressing and weights
|
||||
AMIPtr_.reset
|
||||
(
|
||||
new AMIPatchToPatchInterpolation
|
||||
(
|
||||
patch_,
|
||||
nbrPatch0,
|
||||
surfPtr(),
|
||||
faceAreaIntersect::tmMesh,
|
||||
AMIReverse_
|
||||
)
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "regionCoupledBase : " << patch_.name()
|
||||
<< " constructed AMI with " << nl
|
||||
<< " " << ":srcAddress:" << AMIPtr_().srcAddress().size()
|
||||
<< nl
|
||||
<< " " << " tgAddress :" << AMIPtr_().tgtAddress().size()
|
||||
<< nl << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionCoupledBase::clearGeom()
|
||||
{
|
||||
AMIPtr_.clear();
|
||||
surfPtr_.clear();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledBase::regionCoupledBase
|
||||
(
|
||||
const polyPatch& pp
|
||||
)
|
||||
:
|
||||
patch_(pp),
|
||||
nbrPatchName_(word::null),
|
||||
nbrPatchID_(-1),
|
||||
nbrRegionName_(word::null),
|
||||
sameRegion_(false),
|
||||
AMIPtr_(NULL),
|
||||
AMIReverse_(false),
|
||||
surfPtr_(NULL),
|
||||
surfDict_(fileName("surface"))
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledBase::regionCoupledBase
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
patch_(pp),
|
||||
nbrPatchName_(dict.lookup("neighbourPatch")),
|
||||
nbrPatchID_(-1),
|
||||
nbrRegionName_(dict.lookup("neighbourRegion")),
|
||||
sameRegion_(nbrRegionName_ == patch_.boundaryMesh().mesh().name()),
|
||||
AMIPtr_(NULL),
|
||||
AMIReverse_(dict.lookupOrDefault<bool>("flipNormals", false)),
|
||||
surfPtr_(NULL),
|
||||
surfDict_(dict.subOrEmptyDict("surface"))
|
||||
{
|
||||
if (nbrPatchName_ == patch_.name())
|
||||
{
|
||||
FatalIOErrorIn
|
||||
(
|
||||
"regionCoupledBase::regionCoupledBase"
|
||||
"("
|
||||
"const polyPatch&, "
|
||||
"const dictionary& "
|
||||
")",
|
||||
dict
|
||||
) << "Neighbour patch name " << nbrPatchName_
|
||||
<< " cannot be the same as this patch " << patch_.name()
|
||||
<< exit(FatalIOError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::regionCoupledBase::regionCoupledBase
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const regionCoupledBase& mpb
|
||||
)
|
||||
:
|
||||
patch_(pp),
|
||||
nbrPatchName_(mpb.nbrPatchName_),
|
||||
nbrPatchID_(mpb.nbrPatchID_),
|
||||
nbrRegionName_(mpb.nbrRegionName_),
|
||||
sameRegion_(mpb.sameRegion_),
|
||||
AMIPtr_(NULL),
|
||||
AMIReverse_(mpb.AMIReverse_),
|
||||
surfPtr_(mpb.surfPtr_),
|
||||
surfDict_(mpb.surfDict_)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledBase::~regionCoupledBase()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
Foam::label Foam::regionCoupledBase::neighbPatchID() const
|
||||
{
|
||||
if (nbrPatchID_ == -1)
|
||||
{
|
||||
if
|
||||
(
|
||||
patch_.boundaryMesh().mesh().time().foundObject<polyMesh>
|
||||
(
|
||||
nbrRegionName_
|
||||
)
|
||||
)
|
||||
{
|
||||
const polyMesh& mesh =
|
||||
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
|
||||
(
|
||||
nbrRegionName_
|
||||
);
|
||||
|
||||
nbrPatchID_ = mesh.boundaryMesh().findPatchID(nbrPatchName_);
|
||||
|
||||
if (nbrPatchID_ == -1)
|
||||
{
|
||||
FatalErrorIn("cyclicPolyAMIPatch::neighbPatchID() const")
|
||||
<< "Illegal neighbourPatch name " << nbrPatchName_
|
||||
<< nl << "Valid patch names are "
|
||||
<< mesh.boundaryMesh().names()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
// Check that it is a cyclic AMI patch
|
||||
const regionCoupledBase& nbrPatch =
|
||||
refCast<const regionCoupledBase>
|
||||
(
|
||||
mesh.boundaryMesh()[nbrPatchID_]
|
||||
);
|
||||
|
||||
if (nbrPatch.nbrPatchName() != patch_.name())
|
||||
{
|
||||
WarningIn("regionCoupledBase::neighbPatchID() const")
|
||||
<< "Patch " << patch_.name()
|
||||
<< " specifies neighbour patch " << nbrPatchName()
|
||||
<< nl << " but that in return specifies "
|
||||
<< nbrPatch.nbrPatchName() << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nbrPatchID_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::regionCoupledBase::owner() const
|
||||
{
|
||||
if (nbrRegionName_ == patch_.boundaryMesh().mesh().name())
|
||||
{
|
||||
return patch_.index() < neighbPatchID();
|
||||
}
|
||||
else
|
||||
{
|
||||
return patch_.boundaryMesh().mesh().name() < nbrRegionName_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
const Foam::autoPtr<Foam::searchableSurface>&Foam::regionCoupledBase::
|
||||
surfPtr() const
|
||||
{
|
||||
const word surfType(surfDict_.lookupOrDefault<word>("type", "none"));
|
||||
|
||||
if (!surfPtr_.valid() && owner() && surfType != "none")
|
||||
{
|
||||
word surfName(surfDict_.lookupOrDefault("name", patch_.name()));
|
||||
|
||||
const polyMesh& mesh = patch_.boundaryMesh().mesh();
|
||||
|
||||
surfPtr_ =
|
||||
searchableSurface::New
|
||||
(
|
||||
surfType,
|
||||
IOobject
|
||||
(
|
||||
surfName,
|
||||
mesh.time().constant(),
|
||||
"triSurface",
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
surfDict_
|
||||
);
|
||||
}
|
||||
|
||||
return surfPtr_;
|
||||
}
|
||||
|
||||
|
||||
const Foam::AMIPatchToPatchInterpolation& Foam::regionCoupledBase::AMI() const
|
||||
{
|
||||
if (!owner())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"const AMIPatchToPatchInterpolation& regionCoupledBase::AMI()"
|
||||
)
|
||||
<< "AMI interpolator only available to owner patch"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (!AMIPtr_.valid())
|
||||
{
|
||||
resetAMI();
|
||||
}
|
||||
|
||||
return AMIPtr_();
|
||||
}
|
||||
|
||||
|
||||
const Foam::regionCoupledBase&
|
||||
Foam::regionCoupledBase::neighbPatch() const
|
||||
{
|
||||
const polyMesh& mesh =
|
||||
patch_.boundaryMesh().mesh().time().lookupObject<polyMesh>
|
||||
(
|
||||
nbrRegionName_
|
||||
);
|
||||
|
||||
const polyPatch& pp = mesh.boundaryMesh()[neighbPatchID()];
|
||||
return refCast<const regionCoupledBase>(pp);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::regionCoupledBase::order
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const primitivePatch& pp,
|
||||
labelList& faceMap,
|
||||
labelList& rotation
|
||||
) const
|
||||
{
|
||||
faceMap.setSize(pp.size());
|
||||
faceMap = -1;
|
||||
|
||||
rotation.setSize(pp.size());
|
||||
rotation = 0;
|
||||
|
||||
// do nothing
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledBase::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("neighbourPatch") << nbrPatchName_
|
||||
<< token::END_STATEMENT << nl;
|
||||
os.writeKeyword("nbrRegionName") << nbrRegionName_
|
||||
<< token::END_STATEMENT << nl;
|
||||
|
||||
if (AMIReverse_)
|
||||
{
|
||||
os.writeKeyword("flipNormals") << AMIReverse_
|
||||
<< token::END_STATEMENT << nl;
|
||||
}
|
||||
|
||||
if (!surfDict_.empty())
|
||||
{
|
||||
os.writeKeyword(surfDict_.dictName());
|
||||
os << surfDict_;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,219 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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::regionCoupledBase
|
||||
|
||||
Description
|
||||
Base class with common functinality for regionCoupled polyPatch.
|
||||
It includes AMI.
|
||||
|
||||
|
||||
SourceFiles
|
||||
regionCoupledBase.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledBase_H
|
||||
#define regionCoupledBase_H
|
||||
|
||||
#include "AMIPatchToPatchInterpolation.H"
|
||||
#include "polyBoundaryMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledBase Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledBase
|
||||
{
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Patch to sample
|
||||
const polyPatch& patch_;
|
||||
|
||||
//- Name of other half
|
||||
const word nbrPatchName_;
|
||||
|
||||
//- Index of other half
|
||||
mutable label nbrPatchID_;
|
||||
|
||||
//- Name of other region
|
||||
const word nbrRegionName_;
|
||||
|
||||
//- Same region
|
||||
const bool sameRegion_;
|
||||
|
||||
//- AMI interpolation class
|
||||
mutable autoPtr<AMIPatchToPatchInterpolation> AMIPtr_;
|
||||
|
||||
//- Flag to indicate that slave patch should be reversed for AMI
|
||||
const bool AMIReverse_;
|
||||
|
||||
//- Projection surface
|
||||
mutable autoPtr<searchableSurface> surfPtr_;
|
||||
|
||||
//- Dictionary used during projection surface construction
|
||||
const dictionary surfDict_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Reset the AMI interpolator
|
||||
void resetAMI() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
//- Clear geometry
|
||||
virtual void clearGeom();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupledBase");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch
|
||||
regionCoupledBase(const polyPatch&);
|
||||
|
||||
//- Construct from dictionary
|
||||
regionCoupledBase(const polyPatch&, const dictionary&);
|
||||
|
||||
//- Construct as copy, resetting patch
|
||||
regionCoupledBase(const polyPatch&, const regionCoupledBase&);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledBase();
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Neighbour patch name
|
||||
const word& nbrPatchName() const
|
||||
{
|
||||
return nbrPatchName_;
|
||||
}
|
||||
|
||||
//- Neighbour region name
|
||||
const word& nbrRegionName() const
|
||||
{
|
||||
return nbrRegionName_;
|
||||
}
|
||||
|
||||
//- Cached sampleRegion != mesh.name()
|
||||
bool sameRegion() const
|
||||
{
|
||||
return sameRegion_;
|
||||
}
|
||||
|
||||
//- Neighbour patch ID
|
||||
label neighbPatchID() const;
|
||||
|
||||
//- Does this side own the patch?
|
||||
bool owner() const;
|
||||
|
||||
//- Return a reference to the neighbour patch
|
||||
const regionCoupledBase& neighbPatch() const;
|
||||
|
||||
//- Return a reference to the projection surface
|
||||
const autoPtr<searchableSurface>& surfPtr() const;
|
||||
|
||||
//- Return a reference to the AMI interpolator
|
||||
const AMIPatchToPatchInterpolation& AMI() const;
|
||||
|
||||
|
||||
// Interpolations
|
||||
|
||||
//- Interpolate field
|
||||
template<class Type>
|
||||
tmp<Field<Type> > interpolate(const Field<Type>& fld) const;
|
||||
|
||||
//- Interpolate tmp field
|
||||
template<class Type>
|
||||
tmp<Field<Type> > interpolate
|
||||
(
|
||||
const tmp<Field<Type> >& tFld
|
||||
) const;
|
||||
|
||||
//- Low-level interpolate List
|
||||
template<class Type, class BinaryOp>
|
||||
void interpolate
|
||||
(
|
||||
const UList<Type>& fld,
|
||||
const BinaryOp& bop,
|
||||
List<Type>& result
|
||||
) const;
|
||||
|
||||
|
||||
//- Return new ordering for primitivePatch.
|
||||
// Ordering is -faceMap: for every face
|
||||
// index of the new face -rotation:for every new face the clockwise
|
||||
// shift of the original face. Return false if nothing changes
|
||||
// (faceMap is identity, rotation is 0), true otherwise.
|
||||
virtual bool order
|
||||
(
|
||||
PstreamBuffers&,
|
||||
const primitivePatch&,
|
||||
labelList& faceMap,
|
||||
labelList& rotation
|
||||
) const;
|
||||
|
||||
|
||||
//- Return the type
|
||||
virtual const word& regionCoupleType() const = 0;
|
||||
|
||||
//- Write the polyPatch data as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "regionCoupledBaseTemplates.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,81 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::regionCoupledBase::interpolate
|
||||
(
|
||||
const Field<Type>& fld
|
||||
) const
|
||||
{
|
||||
if (owner())
|
||||
{
|
||||
return AMI().interpolateToSource(fld);
|
||||
}
|
||||
else
|
||||
{
|
||||
return neighbPatch().AMI().interpolateToTarget(fld);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::regionCoupledBase::interpolate
|
||||
(
|
||||
const tmp<Field<Type> >& tFld
|
||||
) const
|
||||
{
|
||||
if (owner())
|
||||
{
|
||||
return AMI().interpolateToSource(tFld);
|
||||
}
|
||||
else
|
||||
{
|
||||
return neighbPatch().AMI().interpolateToTarget(tFld);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type, class BinaryOp>
|
||||
void Foam::regionCoupledBase::interpolate
|
||||
(
|
||||
const UList<Type>& fld,
|
||||
const BinaryOp& bop,
|
||||
List<Type>& result
|
||||
) const
|
||||
{
|
||||
if (owner())
|
||||
{
|
||||
AMI().interpolateToSource(fld, bop, result);
|
||||
}
|
||||
else
|
||||
{
|
||||
neighbPatch().AMI().interpolateToTarget(fld, bop, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,170 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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 "regionCoupledPolyPatch.H"
|
||||
#include "polyMesh.H"
|
||||
#include "Time.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledPolyPatch, 0);
|
||||
|
||||
addToRunTimeSelectionTable(polyPatch, regionCoupledPolyPatch, word);
|
||||
addToRunTimeSelectionTable(polyPatch, regionCoupledPolyPatch, dictionary);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
|
||||
(
|
||||
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),
|
||||
regionCoupledBase(static_cast<const polyPatch&>(*this))
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const word& patchType
|
||||
)
|
||||
:
|
||||
polyPatch(name, dict, index, bm, patchType),
|
||||
regionCoupledBase(*this, dict)
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
|
||||
(
|
||||
const regionCoupledPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
polyPatch(pp, bm),
|
||||
regionCoupledBase(*this, pp)
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
|
||||
(
|
||||
const regionCoupledPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart
|
||||
)
|
||||
:
|
||||
polyPatch(pp, bm, index, newSize, newStart),
|
||||
regionCoupledBase(*this, pp)
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledPolyPatch::regionCoupledPolyPatch
|
||||
(
|
||||
const regionCoupledPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const labelUList& mapAddressing,
|
||||
const label newStart
|
||||
)
|
||||
:
|
||||
polyPatch(pp, bm, index, mapAddressing, newStart),
|
||||
regionCoupledBase(*this, pp)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledPolyPatch::~regionCoupledPolyPatch()
|
||||
{
|
||||
regionCoupledBase::clearGeom();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionCoupledPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||
{
|
||||
polyPatch::initGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledPolyPatch::initMovePoints
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const pointField& p
|
||||
)
|
||||
{
|
||||
polyPatch::initMovePoints(pBufs, p);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledPolyPatch::movePoints
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const pointField& p
|
||||
)
|
||||
{
|
||||
polyPatch::movePoints(pBufs, p);
|
||||
regionCoupledBase::clearGeom();
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
{
|
||||
polyPatch::initUpdateMesh(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
{
|
||||
polyPatch::updateMesh(pBufs);
|
||||
regionCoupledBase::clearGeom();
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledPolyPatch::write(Ostream& os) const
|
||||
{
|
||||
polyPatch::write(os);
|
||||
regionCoupledBase::write(os);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,223 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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::regionCoupledPolyPatch
|
||||
|
||||
Description
|
||||
Region coupled polyPatch
|
||||
|
||||
SourceFiles
|
||||
regionCoupledPolyPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledPolyPatch_H
|
||||
#define regionCoupledPolyPatch_H
|
||||
|
||||
#include "regionCoupledBase.H"
|
||||
#include "polyBoundaryMesh.H"
|
||||
#include "polyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledPolyPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledPolyPatch
|
||||
:
|
||||
public polyPatch,
|
||||
public regionCoupledBase
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Initialise the calculation of the patch geometry
|
||||
virtual void initGeometry(PstreamBuffers&);
|
||||
|
||||
//- Initialise the patches for moving points
|
||||
virtual void initMovePoints(PstreamBuffers& pBufs, const pointField&);
|
||||
|
||||
//- Correct patches after moving points
|
||||
virtual void movePoints(PstreamBuffers& pBufs, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupled");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from (base couped patch) components
|
||||
regionCoupledPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const label size,
|
||||
const label start,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const word& patchType
|
||||
);
|
||||
|
||||
//- Construct from dictionary
|
||||
regionCoupledPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const word& patchType
|
||||
);
|
||||
|
||||
//- Construct as copy, resetting the boundary mesh
|
||||
regionCoupledPolyPatch
|
||||
(
|
||||
const regionCoupledPolyPatch&,
|
||||
const polyBoundaryMesh&
|
||||
);
|
||||
|
||||
//- Construct given the original patch and resetting the
|
||||
// face list and boundary mesh information
|
||||
regionCoupledPolyPatch
|
||||
(
|
||||
const regionCoupledPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart
|
||||
);
|
||||
|
||||
//- Construct given the original patch and a map
|
||||
regionCoupledPolyPatch
|
||||
(
|
||||
const regionCoupledPolyPatch& 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 regionCoupledPolyPatch(*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 regionCoupledPolyPatch
|
||||
(
|
||||
*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 regionCoupledPolyPatch
|
||||
(
|
||||
*this,
|
||||
bm,
|
||||
index,
|
||||
mapAddressing,
|
||||
newStart
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledPolyPatch();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Is it coupled?
|
||||
virtual bool coupled() const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//- Return the type
|
||||
virtual const word& regionCoupleType() const
|
||||
{
|
||||
return type();
|
||||
}
|
||||
|
||||
|
||||
//- Write the polyPatch data as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,180 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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 "regionCoupledWallPolyPatch.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "polyPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
defineTypeNameAndDebug(regionCoupledWallPolyPatch, 0);
|
||||
|
||||
addToRunTimeSelectionTable(polyPatch, regionCoupledWallPolyPatch, word);
|
||||
addToRunTimeSelectionTable
|
||||
(
|
||||
polyPatch,
|
||||
regionCoupledWallPolyPatch,
|
||||
dictionary
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const label size,
|
||||
const label start,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const word& patchType
|
||||
)
|
||||
:
|
||||
wallPolyPatch(name, size, start, index, bm, patchType),
|
||||
regionCoupledBase(static_cast<const polyPatch&>(*this))
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const word& patchType
|
||||
)
|
||||
:
|
||||
wallPolyPatch(name, dict, index, bm, patchType),
|
||||
regionCoupledBase(static_cast<const polyPatch&>(*this), dict)
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
|
||||
(
|
||||
const regionCoupledWallPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm
|
||||
)
|
||||
:
|
||||
wallPolyPatch(pp, bm),
|
||||
regionCoupledBase(*this, pp)
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
|
||||
(
|
||||
const regionCoupledWallPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart
|
||||
)
|
||||
:
|
||||
wallPolyPatch(pp, bm, index, newSize, newStart),
|
||||
regionCoupledBase(*this, pp)
|
||||
{}
|
||||
|
||||
|
||||
Foam::regionCoupledWallPolyPatch::regionCoupledWallPolyPatch
|
||||
(
|
||||
const regionCoupledWallPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const labelUList& mapAddressing,
|
||||
const label newStart
|
||||
)
|
||||
:
|
||||
wallPolyPatch(pp, bm, index, mapAddressing, newStart),
|
||||
regionCoupledBase(*this, pp)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::regionCoupledWallPolyPatch::~regionCoupledWallPolyPatch()
|
||||
{
|
||||
regionCoupledBase::clearGeom();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::regionCoupledWallPolyPatch::initGeometry(PstreamBuffers& pBufs)
|
||||
{
|
||||
wallPolyPatch::initGeometry(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledWallPolyPatch::calcGeometry(PstreamBuffers& pBufs)
|
||||
{
|
||||
wallPolyPatch::calcGeometry(pBufs);
|
||||
regionCoupledBase::clearGeom();
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledWallPolyPatch::initMovePoints
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const pointField& p
|
||||
)
|
||||
{
|
||||
wallPolyPatch::initMovePoints(pBufs, p);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledWallPolyPatch::movePoints
|
||||
(
|
||||
PstreamBuffers& pBufs,
|
||||
const pointField& p
|
||||
)
|
||||
{
|
||||
wallPolyPatch::movePoints(pBufs, p);
|
||||
regionCoupledBase::clearGeom();
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledWallPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
{
|
||||
wallPolyPatch::initUpdateMesh(pBufs);
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledWallPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
{
|
||||
wallPolyPatch::updateMesh(pBufs);
|
||||
regionCoupledBase::clearGeom();
|
||||
}
|
||||
|
||||
|
||||
void Foam::regionCoupledWallPolyPatch::write(Ostream& os) const
|
||||
{
|
||||
wallPolyPatch::write(os);
|
||||
regionCoupledBase::write(os);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,222 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 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::regionCoupledWallPolyPatch
|
||||
|
||||
Description
|
||||
regionCoupledWall
|
||||
|
||||
SourceFiles
|
||||
regionCoupledWallPolyPatch.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef regionCoupledWallPolyPatch_H
|
||||
#define regionCoupledWallPolyPatch_H
|
||||
|
||||
#include "wallPolyPatch.H"
|
||||
#include "regionCoupledBase.H"
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
class polyMesh;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class regionCoupledWallPolyPatch Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class regionCoupledWallPolyPatch
|
||||
:
|
||||
public wallPolyPatch,
|
||||
public regionCoupledBase
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
//- Initialise the calculation of the patch geometry
|
||||
virtual void initGeometry(PstreamBuffers&);
|
||||
|
||||
//- Calculate the patch geometry
|
||||
virtual void calcGeometry(PstreamBuffers&);
|
||||
|
||||
//- Initialise the patches for moving points
|
||||
virtual void initMovePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Correct patches after moving points
|
||||
virtual void movePoints(PstreamBuffers&, const pointField&);
|
||||
|
||||
//- Initialise the update of the patch topology
|
||||
virtual void initUpdateMesh(PstreamBuffers&);
|
||||
|
||||
//- Update of the patch topology
|
||||
virtual void updateMesh(PstreamBuffers&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("regionCoupledWall");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
regionCoupledWallPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const label size,
|
||||
const label start,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const word& patchType
|
||||
);
|
||||
|
||||
|
||||
//- Construct from dictionary
|
||||
regionCoupledWallPolyPatch
|
||||
(
|
||||
const word& name,
|
||||
const dictionary& dict,
|
||||
const label index,
|
||||
const polyBoundaryMesh& bm,
|
||||
const word& patchType
|
||||
);
|
||||
|
||||
//- Construct as copy, resetting the boundary mesh
|
||||
regionCoupledWallPolyPatch
|
||||
(
|
||||
const regionCoupledWallPolyPatch&,
|
||||
const polyBoundaryMesh&
|
||||
);
|
||||
|
||||
//- Construct given the original patch and resetting the
|
||||
// face list and boundary mesh information
|
||||
regionCoupledWallPolyPatch
|
||||
(
|
||||
const regionCoupledWallPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart
|
||||
);
|
||||
|
||||
//- Construct given the original patch and a map
|
||||
regionCoupledWallPolyPatch
|
||||
(
|
||||
const regionCoupledWallPolyPatch& pp,
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const labelUList& mapAddressing,
|
||||
const label newStart
|
||||
);
|
||||
|
||||
//- Construct and return a clone, resetting the boundary mesh
|
||||
virtual autoPtr<wallPolyPatch::polyPatch> clone
|
||||
(
|
||||
const polyBoundaryMesh& bm
|
||||
) const
|
||||
{
|
||||
return autoPtr<wallPolyPatch::polyPatch>
|
||||
(
|
||||
new regionCoupledWallPolyPatch(*this, bm)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct and return a clone, resetting the face list
|
||||
// and boundary mesh
|
||||
virtual autoPtr<wallPolyPatch::polyPatch> clone
|
||||
(
|
||||
const polyBoundaryMesh& bm,
|
||||
const label index,
|
||||
const label newSize,
|
||||
const label newStart
|
||||
) const
|
||||
{
|
||||
return autoPtr<wallPolyPatch::polyPatch>
|
||||
(
|
||||
new regionCoupledWallPolyPatch
|
||||
(
|
||||
*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 regionCoupledWallPolyPatch
|
||||
(
|
||||
*this,
|
||||
bm,
|
||||
index,
|
||||
mapAddressing,
|
||||
newStart
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~regionCoupledWallPolyPatch();
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return the type
|
||||
virtual const word& regionCoupleType() const
|
||||
{
|
||||
return type();
|
||||
}
|
||||
|
||||
//- Write the polyPatch data as a dictionary
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
3
src/regionCoupled/Make/files
Normal file
3
src/regionCoupled/Make/files
Normal file
@ -0,0 +1,3 @@
|
||||
derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libregionCoupled
|
||||
11
src/regionCoupled/Make/options
Normal file
11
src/regionCoupled/Make/options
Normal file
@ -0,0 +1,11 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude
|
||||
|
||||
LIB_LIBS = \
|
||||
-lfluidThermophysicalModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lcompressibleTurbulenceModel
|
||||
@ -0,0 +1,559 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 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 "addToRunTimeSelectionTable.H"
|
||||
#include "energyRegionCoupledFvPatchScalarField.H"
|
||||
#include "Time.H"
|
||||
#include "turbulenceModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
template<>
|
||||
const char* Foam::NamedEnum
|
||||
<
|
||||
Foam::energyRegionCoupledFvPatchScalarField::kappaMethodType,
|
||||
3
|
||||
>::names[] =
|
||||
{
|
||||
"solid",
|
||||
"fluid",
|
||||
"undefined"
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
const Foam::NamedEnum
|
||||
<
|
||||
Foam::energyRegionCoupledFvPatchScalarField::kappaMethodType,
|
||||
3
|
||||
> Foam::energyRegionCoupledFvPatchScalarField::methodTypeNames_;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Private members * * * * * * * * * * * * *//
|
||||
|
||||
void Foam::energyRegionCoupledFvPatchScalarField::setMethod() const
|
||||
{
|
||||
if (method_ == UNDEFINED)
|
||||
{
|
||||
if (
|
||||
this->db().foundObject<compressible::turbulenceModel>
|
||||
(
|
||||
"turbulenceModel"
|
||||
)
|
||||
)
|
||||
{
|
||||
method_ = FLUID;
|
||||
}
|
||||
else
|
||||
{
|
||||
method_ = SOLID;
|
||||
}
|
||||
}
|
||||
|
||||
if (!nbrThermoPtr_)
|
||||
{
|
||||
nbrThermoPtr_ =
|
||||
(
|
||||
®ionCoupledPatch_.nbrMesh().lookupObject<basicThermo>
|
||||
(
|
||||
"thermophysicalProperties"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (!thermoPtr_)
|
||||
{
|
||||
thermoPtr_ =
|
||||
(
|
||||
&this->db().lookupObject<basicThermo>
|
||||
(
|
||||
"thermophysicalProperties"
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
kappa() const
|
||||
{
|
||||
switch (method_)
|
||||
{
|
||||
case FLUID:
|
||||
{
|
||||
const compressible::turbulenceModel& model =
|
||||
this->db().lookupObject<compressible::turbulenceModel>
|
||||
(
|
||||
"turbulenceModel"
|
||||
);
|
||||
|
||||
return model.kappaEff(patch().index());
|
||||
}
|
||||
break;
|
||||
|
||||
case SOLID:
|
||||
{
|
||||
const basicThermo& thermo =
|
||||
this->db().lookupObject<basicThermo>
|
||||
(
|
||||
"thermophysicalProperties"
|
||||
);
|
||||
|
||||
return thermo.kappa(patch().index());
|
||||
}
|
||||
break;
|
||||
|
||||
case UNDEFINED:
|
||||
{
|
||||
FatalErrorIn("energyRegionCoupledFvPatchScalarField::kappa() const")
|
||||
<< " on mesh " << this->db().name() << " patch "
|
||||
<< patch().name()
|
||||
<< " could not find a method in. Methods are: "
|
||||
<< methodTypeNames_.toc()
|
||||
<< " Not turbulenceModel or thermophysicalProperties"
|
||||
<< " were found"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return scalarField(0);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
weights() const
|
||||
{
|
||||
const fvPatch& patch = regionCoupledPatch_.patch();
|
||||
|
||||
const scalarField deltas
|
||||
(
|
||||
patch.nf() & patch.delta()
|
||||
);
|
||||
|
||||
const scalarField alphaDelta(kappa()/deltas);
|
||||
|
||||
const fvPatch& nbrPatch = regionCoupledPatch_.neighbFvPatch();
|
||||
|
||||
const energyRegionCoupledFvPatchScalarField& nbrField =
|
||||
refCast
|
||||
<
|
||||
const energyRegionCoupledFvPatchScalarField
|
||||
>
|
||||
(
|
||||
nbrPatch.lookupPatchField<volScalarField, scalar>("T")
|
||||
);
|
||||
|
||||
// Needed in the first calculation of weights
|
||||
nbrField.setMethod();
|
||||
|
||||
const scalarField nbrAlpha
|
||||
(
|
||||
regionCoupledPatch_.regionCoupledPatch().interpolate
|
||||
(
|
||||
nbrField.kappa()
|
||||
)
|
||||
);
|
||||
|
||||
const scalarField nbrDeltas
|
||||
(
|
||||
regionCoupledPatch_.regionCoupledPatch().interpolate
|
||||
(
|
||||
nbrPatch.nf() & nbrPatch.delta()
|
||||
)
|
||||
);
|
||||
|
||||
const scalarField nbrAlphaDelta(nbrAlpha/nbrDeltas);
|
||||
|
||||
tmp<scalarField> tw(new scalarField(deltas.size()));
|
||||
scalarField& w = tw();
|
||||
|
||||
forAll(alphaDelta, faceI)
|
||||
{
|
||||
scalar di = alphaDelta[faceI];
|
||||
scalar dni = nbrAlphaDelta[faceI];
|
||||
|
||||
w[faceI] = di/(di + dni);
|
||||
}
|
||||
|
||||
return tw;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::energyRegionCoupledFvPatchScalarField::
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
LduInterfaceField<scalar>(refCast<const lduInterface>(p)),
|
||||
fvPatchScalarField(p, iF),
|
||||
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
||||
method_(UNDEFINED),
|
||||
nbrThermoPtr_(NULL),
|
||||
thermoPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Foam::energyRegionCoupledFvPatchScalarField::
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const energyRegionCoupledFvPatchScalarField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
LduInterfaceField<scalar>(refCast<const lduInterface>(p)),
|
||||
fvPatchScalarField(ptf, p, iF, mapper),
|
||||
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
||||
method_(ptf.method_),
|
||||
nbrThermoPtr_(NULL),
|
||||
thermoPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Foam::energyRegionCoupledFvPatchScalarField::
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<scalar, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
LduInterfaceField<scalar>(refCast<const lduInterface>(p)),
|
||||
fvPatchScalarField(p, iF, dict),
|
||||
regionCoupledPatch_(refCast<const regionCoupledBaseFvPatch>(p)),
|
||||
method_(UNDEFINED),
|
||||
nbrThermoPtr_(NULL),
|
||||
thermoPtr_(NULL)
|
||||
{
|
||||
|
||||
if (!isA<regionCoupledBase>(this->patch().patch()))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"energyRegionCoupledFvPatchScalarField::"
|
||||
"energyRegionCoupledFvPatchScalarField\n"
|
||||
"(\n"
|
||||
" const fvPatch& p,\n"
|
||||
" const DimensionedField<scalar, volMesh>& iF,\n"
|
||||
" const dictionary& dict\n"
|
||||
")\n"
|
||||
) << "\n patch type '" << p.type()
|
||||
<< "' not type '" << regionCoupledBase::typeName << "'"
|
||||
<< "\n for patch " << p.name()
|
||||
<< " of field " << dimensionedInternalField().name()
|
||||
<< " in file " << dimensionedInternalField().objectPath()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if (dict.found("value"))
|
||||
{
|
||||
fvPatchScalarField::operator=(scalarField("value", dict, p.size()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::energyRegionCoupledFvPatchScalarField::
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const energyRegionCoupledFvPatchScalarField& ptf
|
||||
)
|
||||
:
|
||||
LduInterfaceField<scalar>(refCast<const lduInterface>(ptf.patch())),
|
||||
fvPatchScalarField(ptf),
|
||||
regionCoupledPatch_(ptf.regionCoupledPatch_),
|
||||
method_(ptf.method_),
|
||||
nbrThermoPtr_(NULL),
|
||||
thermoPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
Foam::energyRegionCoupledFvPatchScalarField::
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const energyRegionCoupledFvPatchScalarField& ptf,
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
)
|
||||
:
|
||||
LduInterfaceField<scalar>(refCast<const lduInterface>(ptf.patch())),
|
||||
fvPatchScalarField(ptf, iF),
|
||||
regionCoupledPatch_(ptf.regionCoupledPatch_),
|
||||
method_(ptf.method_),
|
||||
nbrThermoPtr_(NULL),
|
||||
thermoPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
snGrad() const
|
||||
{
|
||||
return
|
||||
(*this - patchInternalField())*regionCoupledPatch_.patch().deltaCoeffs();
|
||||
}
|
||||
|
||||
|
||||
void Foam::energyRegionCoupledFvPatchScalarField::initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes
|
||||
)
|
||||
{
|
||||
if (!updated())
|
||||
{
|
||||
updateCoeffs();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::energyRegionCoupledFvPatchScalarField::evaluate
|
||||
(
|
||||
const Pstream::commsTypes
|
||||
)
|
||||
{
|
||||
if (!updated())
|
||||
{
|
||||
updateCoeffs();
|
||||
}
|
||||
|
||||
label patchi = patch().index();
|
||||
const scalarField& pp = thermoPtr_->p().boundaryField()[patchi];
|
||||
|
||||
const scalarField lWeights = weights();
|
||||
|
||||
scalarField::operator=
|
||||
(
|
||||
thermoPtr_->he
|
||||
(
|
||||
pp,
|
||||
lWeights*patchInternalTemperatureField()
|
||||
+ (1.0 - lWeights)*patchNeighbourTemperatureField(),
|
||||
patchi
|
||||
)
|
||||
);
|
||||
|
||||
fvPatchScalarField::evaluate();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>& w
|
||||
) const
|
||||
{
|
||||
return scalar(pTraits<scalar>::one)*w;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>& w
|
||||
) const
|
||||
{
|
||||
return scalar(pTraits<scalar>::one)*(1.0 - w);
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
gradientInternalCoeffs() const
|
||||
{
|
||||
return
|
||||
-scalar(pTraits<scalar>::one)
|
||||
*regionCoupledPatch_.patch().deltaCoeffs();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
gradientBoundaryCoeffs() const
|
||||
{
|
||||
return -this->gradientInternalCoeffs();
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::Field<Foam::scalar> >
|
||||
Foam::energyRegionCoupledFvPatchScalarField::
|
||||
patchNeighbourField() const
|
||||
{
|
||||
const fvPatch& nbrPatch = regionCoupledPatch_.neighbFvPatch();
|
||||
|
||||
const labelUList& nbrFaceCells = nbrPatch.faceCells();
|
||||
|
||||
setMethod();
|
||||
|
||||
const scalarField nbrIntT
|
||||
(
|
||||
nbrThermoPtr_->T().internalField(), nbrFaceCells
|
||||
);
|
||||
|
||||
scalarField intNbrT =
|
||||
regionCoupledPatch_.regionCoupledPatch().interpolate(nbrIntT);
|
||||
|
||||
label patchi = patch().index();
|
||||
const scalarField& pp = thermoPtr_->p().boundaryField()[patchi];
|
||||
tmp<scalarField> tmyHE = thermoPtr_->he(pp, intNbrT, patchi);
|
||||
|
||||
return tmyHE;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
patchNeighbourTemperatureField() const
|
||||
{
|
||||
const fvPatch& nbrPatch = regionCoupledPatch_.neighbFvPatch();
|
||||
|
||||
const labelUList& nbrFaceCells = nbrPatch.faceCells();
|
||||
|
||||
const scalarField nbrIntT
|
||||
(
|
||||
nbrThermoPtr_->T().internalField(), nbrFaceCells
|
||||
);
|
||||
|
||||
tmp<scalarField> tintNbrT =
|
||||
regionCoupledPatch_.regionCoupledPatch().interpolate(nbrIntT);
|
||||
|
||||
return tintNbrT;
|
||||
}
|
||||
|
||||
|
||||
Foam::tmp<Foam::scalarField> Foam::energyRegionCoupledFvPatchScalarField::
|
||||
patchInternalTemperatureField() const
|
||||
{
|
||||
const labelUList& faceCells = regionCoupledPatch_.faceCells();
|
||||
|
||||
tmp<scalarField> tintT
|
||||
(
|
||||
new scalarField(thermoPtr_->T().internalField(), faceCells)
|
||||
);
|
||||
|
||||
return tintT;
|
||||
}
|
||||
|
||||
|
||||
void Foam::energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix
|
||||
(
|
||||
Field<scalar>& result,
|
||||
const scalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
setMethod();
|
||||
|
||||
scalarField myHE(this->size());
|
||||
|
||||
if (&psiInternal == &internalField())
|
||||
{
|
||||
|
||||
label patchi = this->patch().index();
|
||||
const scalarField& pp = thermoPtr_->p().boundaryField()[patchi];
|
||||
const scalarField& Tp = thermoPtr_->T().boundaryField()[patchi];
|
||||
|
||||
myHE = thermoPtr_->he(pp, Tp, patchi);
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(*this, facei)
|
||||
{
|
||||
myHE[facei] = psiInternal[regionCoupledPatch_.faceCells()[facei]];
|
||||
}
|
||||
}
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
const labelUList& faceCells = regionCoupledPatch_.faceCells();
|
||||
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*myHE[elemI];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::energyRegionCoupledFvPatchScalarField::updateInterfaceMatrix
|
||||
(
|
||||
Field<scalar>& result,
|
||||
const Field<scalar>& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
setMethod();
|
||||
|
||||
scalarField myHE(this->size());
|
||||
|
||||
if (&psiInternal == &internalField())
|
||||
{
|
||||
label patchi = this->patch().index();
|
||||
const scalarField& pp = thermoPtr_->p().boundaryField()[patchi];
|
||||
const scalarField& Tp = thermoPtr_->T().boundaryField()[patchi];
|
||||
|
||||
myHE = thermoPtr_->he(pp, Tp, patchi);
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(*this, facei)
|
||||
{
|
||||
myHE[facei] = psiInternal[regionCoupledPatch_.faceCells()[facei]];
|
||||
}
|
||||
}
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
const labelUList& faceCells = regionCoupledPatch_.faceCells();
|
||||
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*myHE[elemI];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::energyRegionCoupledFvPatchScalarField::write(Ostream& os) const
|
||||
{
|
||||
fvPatchField<scalar>::write(os);
|
||||
this->writeEntry("value", os);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchScalarField,
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,287 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 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::energyRegionCoupledFvPatchScalarField
|
||||
|
||||
Description
|
||||
Energy region coupled implicit boundary condition.
|
||||
The fvPatch is treated as uncoupled from the delta point of view.
|
||||
In the mesh the fvPatch is an interface and is incorporated
|
||||
into the matrix implicitly.
|
||||
|
||||
SourceFiles
|
||||
energyRegionCoupledFvPatchScalarField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef energyRegionCoupledFvPatchScalarField_H
|
||||
#define energyRegionCoupledFvPatchScalarField_H
|
||||
|
||||
#include "regionCoupledBaseFvPatch.H"
|
||||
#include "LduInterfaceField.H"
|
||||
#include "fvPatchField.H"
|
||||
#include "NamedEnum.H"
|
||||
#include "basicThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class energyRegionCoupledFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class energyRegionCoupledFvPatchScalarField
|
||||
:
|
||||
public LduInterfaceField<scalar>,
|
||||
public fvPatchScalarField
|
||||
{
|
||||
public:
|
||||
|
||||
enum kappaMethodType
|
||||
{
|
||||
SOLID,
|
||||
FLUID,
|
||||
UNDEFINED
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Local reference to region couple patch
|
||||
const regionCoupledBaseFvPatch& regionCoupledPatch_;
|
||||
|
||||
//- Methof to extract kappa
|
||||
static const NamedEnum<kappaMethodType, 3> methodTypeNames_;
|
||||
|
||||
//- How to get K
|
||||
mutable kappaMethodType method_;
|
||||
|
||||
//- AutoPtr to nbr thermo
|
||||
mutable const basicThermo* nbrThermoPtr_;
|
||||
|
||||
//- AutoPtr to my thermo
|
||||
mutable const basicThermo* thermoPtr_;
|
||||
|
||||
|
||||
// Private functions
|
||||
|
||||
//- Local weight for this coupled field
|
||||
tmp<scalarField> weights() const;
|
||||
|
||||
//- Return nbr temperature internal field
|
||||
tmp<scalarField> patchNeighbourTemperatureField() const;
|
||||
|
||||
//- Return local temperature internal field
|
||||
tmp<scalarField> patchInternalTemperatureField() const;
|
||||
|
||||
//- Return kappa
|
||||
tmp<scalarField> kappa() const;
|
||||
|
||||
//- Set method
|
||||
void setMethod() const;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("compressible::energyRegionCoupled");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given energyRegionCoupledFvPatchScalarField
|
||||
// onto a new patch
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const energyRegionCoupledFvPatchScalarField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<scalar, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const energyRegionCoupledFvPatchScalarField&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchField<scalar> > clone() const
|
||||
{
|
||||
return tmp<fvPatchField<scalar> >
|
||||
(
|
||||
new energyRegionCoupledFvPatchScalarField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
energyRegionCoupledFvPatchScalarField
|
||||
(
|
||||
const energyRegionCoupledFvPatchScalarField&,
|
||||
const DimensionedField<scalar, volMesh>&
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~energyRegionCoupledFvPatchScalarField()
|
||||
{}
|
||||
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchField<scalar> > clone
|
||||
(
|
||||
const DimensionedField<scalar, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchField<scalar> >
|
||||
(
|
||||
new energyRegionCoupledFvPatchScalarField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
|
||||
// Access
|
||||
|
||||
//- Return true if this patch field is coupled
|
||||
virtual bool coupled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Method to obtain K
|
||||
word kappaMethod() const
|
||||
{
|
||||
return methodTypeNames_[method_];
|
||||
}
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Return neighbour coupled internal cell data
|
||||
virtual tmp<scalarField> patchNeighbourField() const;
|
||||
|
||||
//- Return patch-normal gradient
|
||||
virtual tmp<scalarField> snGrad() const;
|
||||
|
||||
//- Initialise the evaluation of the patch field
|
||||
virtual void initEvaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType
|
||||
);
|
||||
|
||||
//- Evaluate the patch field
|
||||
virtual void evaluate
|
||||
(
|
||||
const Pstream::commsTypes commsType
|
||||
);
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
// evaluation of the value of this patchField with given weights
|
||||
virtual tmp<scalarField> valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
// evaluation of the value of this patchField with given weights
|
||||
virtual tmp<scalarField> valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
// evaluation of the gradient of this patchField
|
||||
virtual tmp<scalarField> gradientInternalCoeffs() const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
// evaluation of the gradient of this patchField
|
||||
virtual tmp<scalarField> gradientBoundaryCoeffs() const;
|
||||
|
||||
|
||||
// Coupled interface functionality
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
Field<scalar>& result,
|
||||
const scalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
virtual void updateInterfaceMatrix
|
||||
(
|
||||
Field<scalar>&,
|
||||
const Field<scalar>&,
|
||||
const scalarField&,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
//- Return the interface type
|
||||
virtual const word& interfaceFieldType() const
|
||||
{
|
||||
return regionCoupledPatch_.regionCoupleType();
|
||||
}
|
||||
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -32,6 +32,7 @@ License
|
||||
#include "fixedJumpAMIFvPatchFields.H"
|
||||
#include "energyJumpFvPatchScalarField.H"
|
||||
#include "energyJumpAMIFvPatchScalarField.H"
|
||||
#include "energyRegionCoupledFvPatchScalarField.H"
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -69,6 +70,10 @@ Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryTypes()
|
||||
{
|
||||
hbt[patchi] = energyJumpAMIFvPatchScalarField::typeName;
|
||||
}
|
||||
else if (isA<energyRegionCoupledFvPatchScalarField>(tbf[patchi]))
|
||||
{
|
||||
hbt[patchi] = energyRegionCoupledFvPatchScalarField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
return hbt;
|
||||
|
||||
@ -9,4 +9,5 @@ derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffu
|
||||
derivedFvPatchFields/turbulentTemperatureRadCoupledMixed/turbulentTemperatureRadCoupledMixedFvPatchScalarField.C
|
||||
derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
|
||||
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libcompressibleTurbulenceModel
|
||||
|
||||
Reference in New Issue
Block a user