mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: New vibro-acoustic model suite
- New solver: `acousticFoam`
- New base finite-area region class: `regionFaModel`
- New base shell model classes:
- `vibrationShellModel`
- `thermalShellModel`
- New shell models:
- A vibration-shell model: `KirchhoffShell`
- A thermal-shell model: `thermalShell`
- New finite-area/finite-volume boundary conditions:
- `clampedPlate`
- `timeVaryingFixedValue`
- `acousticWaveTransmissive`
- New base classes for `fvOption` of finite-area methods: `faOption`
- New `faOption`s:
- `contactHeatFluxSource`
- `externalFileSource`
- `externalHeatFluxSource`
- `jouleHeatingSource`
- New tutorial: `compressible/acousticFoam/obliqueAirJet`
Signed-off-by: Kutalmis Bercin <kutalmis.bercin@esi-group.com>
This commit is contained in:
@ -281,6 +281,7 @@ Foam::fac::interpolate
|
||||
tmp<GeometricField<Type, faePatchField, edgeMesh>> tsf =
|
||||
interpolate(tvf());
|
||||
tvf.clear();
|
||||
|
||||
return tsf;
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -47,8 +48,6 @@ void Foam::edgeInterpolation::clearOut()
|
||||
deleteDemandDrivenData(differenceFactors_);
|
||||
deleteDemandDrivenData(correctionVectors_);
|
||||
deleteDemandDrivenData(skewCorrectionVectors_);
|
||||
// deleteDemandDrivenData(leastSquarePvectors_);
|
||||
// deleteDemandDrivenData(leastSquareNvectors_);
|
||||
}
|
||||
|
||||
|
||||
@ -64,8 +63,6 @@ Foam::edgeInterpolation::edgeInterpolation(const faMesh& fam)
|
||||
correctionVectors_(nullptr),
|
||||
skew_(true),
|
||||
skewCorrectionVectors_(nullptr)
|
||||
// leastSquarePvectors_(nullptr),
|
||||
// leastSquareNvectors_(nullptr)
|
||||
{}
|
||||
|
||||
|
||||
@ -161,30 +158,6 @@ Foam::edgeInterpolation::skewCorrectionVectors() const
|
||||
}
|
||||
|
||||
|
||||
// const Foam::edgeVectorField&
|
||||
// Foam::edgeInterpolation::leastSquarePvectors() const
|
||||
// {
|
||||
// if (!leastSquarePvectors_)
|
||||
// {
|
||||
// makeLeastSquareVectors();
|
||||
// }
|
||||
//
|
||||
// return (*leastSquarePvectors_);
|
||||
// }
|
||||
|
||||
|
||||
// const Foam::edgeVectorField&
|
||||
// Foam::edgeInterpolation::leastSquareNvectors() const
|
||||
// {
|
||||
// if (!leastSquareNvectors_)
|
||||
// {
|
||||
// makeLeastSquareVectors();
|
||||
// }
|
||||
//
|
||||
// return (*leastSquareNvectors_);
|
||||
// }
|
||||
|
||||
|
||||
bool Foam::edgeInterpolation::movePoints() const
|
||||
{
|
||||
deleteDemandDrivenData(lPN_);
|
||||
@ -197,9 +170,6 @@ bool Foam::edgeInterpolation::movePoints() const
|
||||
skew_ = true;
|
||||
deleteDemandDrivenData(skewCorrectionVectors_);
|
||||
|
||||
// deleteDemandDrivenData(leastSquarePvectors_);
|
||||
// deleteDemandDrivenData(leastSquareNvectors_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -527,10 +497,12 @@ void Foam::edgeInterpolation::makeCorrectionVectors() const
|
||||
- deltaCoeffs[edgeI]*unitDelta;
|
||||
}
|
||||
|
||||
|
||||
edgeVectorField::Boundary& CorrVecsbf = CorrVecs.boundaryFieldRef();
|
||||
for (faePatchVectorField& patchCorrVecs : CorrVecsbf)
|
||||
|
||||
forAll(CorrVecs.boundaryField(), patchI)
|
||||
{
|
||||
patchCorrVecs = vector::zero;
|
||||
mesh().boundary()[patchI].makeCorrectionVectors(CorrVecsbf[patchI]);
|
||||
}
|
||||
|
||||
scalar NonOrthogCoeff = 0.0;
|
||||
|
||||
@ -0,0 +1,219 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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::skewCorrectedEdgeInterpolation
|
||||
|
||||
Description
|
||||
Linear/upwind blended differencing scheme
|
||||
|
||||
SourceFiles
|
||||
skewCorrectedEdgeInterpolationMake.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef skewCorrectedEdgeInterpolation_H
|
||||
#define skewCorrectedEdgeInterpolation_H
|
||||
|
||||
#include "edgeInterpolationScheme.H"
|
||||
#include "linearEdgeInterpolation.H"
|
||||
#include "gaussFaGrad.H"
|
||||
#include "areaFields.H"
|
||||
#include "zeroGradientFaPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class skewCorrectedEdgeInterpolation Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class skewCorrectedEdgeInterpolation
|
||||
:
|
||||
virtual public edgeInterpolationScheme<Type>
|
||||
{
|
||||
// Private Data
|
||||
|
||||
tmp<edgeInterpolationScheme<Type>> tScheme_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("skewCorrected");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from Istream
|
||||
skewCorrectedEdgeInterpolation(const faMesh& mesh, Istream& is)
|
||||
:
|
||||
edgeInterpolationScheme<Type>(mesh),
|
||||
tScheme_
|
||||
(
|
||||
edgeInterpolationScheme<Type>::New(mesh, is)
|
||||
)
|
||||
{}
|
||||
|
||||
//- Construct from mesh, faceFlux and blendingFactor
|
||||
skewCorrectedEdgeInterpolation
|
||||
(
|
||||
const faMesh& mesh,
|
||||
const edgeScalarField& faceFlux,
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
edgeInterpolationScheme<Type>(mesh),
|
||||
tScheme_
|
||||
(
|
||||
edgeInterpolationScheme<Type>::New(mesh, faceFlux, is)
|
||||
)
|
||||
{}
|
||||
|
||||
//- No copy construct
|
||||
skewCorrectedEdgeInterpolation(const skewCorrectedEdgeInterpolation&) =
|
||||
delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const skewCorrectedEdgeInterpolation&) = delete;
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Return the interpolation weighting factors
|
||||
virtual tmp<edgeScalarField> weights
|
||||
(
|
||||
const GeometricField<Type, faPatchField, areaMesh>& vf
|
||||
) const
|
||||
{
|
||||
return tScheme_().weights(vf);
|
||||
}
|
||||
|
||||
//- Return true if this scheme uses an explicit correction
|
||||
virtual bool corrected() const
|
||||
{
|
||||
return
|
||||
tScheme_().corrected() || (this->mesh()).skew();
|
||||
}
|
||||
|
||||
tmp<GeometricField<Type, faePatchField, edgeMesh>>
|
||||
skewCorrection
|
||||
(
|
||||
const GeometricField<Type, faPatchField, areaMesh>& vf
|
||||
) const
|
||||
{
|
||||
const faMesh& mesh = this->mesh();
|
||||
|
||||
const edgeVectorField& scv = mesh.skewCorrectionVectors();
|
||||
|
||||
tmp<GeometricField<Type, faePatchField, edgeMesh>> tsfCorr
|
||||
(
|
||||
new GeometricField<Type, faePatchField, edgeMesh>
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"skewCorrected::skewCorrection(" + vf.name() + ')',
|
||||
vf.instance(),
|
||||
vf.db()
|
||||
),
|
||||
mesh,
|
||||
dimensioned<Type>(vf.dimensions(), Zero)
|
||||
)
|
||||
);
|
||||
|
||||
GeometricField<Type, faePatchField, edgeMesh>& corr = tsfCorr.ref();
|
||||
|
||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; ++cmpt)
|
||||
{
|
||||
corr.replace
|
||||
(
|
||||
cmpt,
|
||||
scv & linearEdgeInterpolation
|
||||
<
|
||||
typename outerProduct
|
||||
<
|
||||
vector,
|
||||
typename pTraits<Type>::cmptType
|
||||
>::type
|
||||
>(mesh).interpolate
|
||||
(
|
||||
fa::gaussGrad<typename pTraits<Type>::cmptType>
|
||||
(mesh).grad(vf.component(cmpt))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return tsfCorr;
|
||||
}
|
||||
|
||||
|
||||
//- Return the explicit correction to the face-interpolate
|
||||
virtual tmp<GeometricField<Type, faePatchField, edgeMesh>>
|
||||
correction
|
||||
(
|
||||
const GeometricField<Type, faPatchField, areaMesh>& vf
|
||||
) const
|
||||
{
|
||||
if
|
||||
(
|
||||
tScheme_().corrected()
|
||||
&& (this->mesh()).skew()
|
||||
)
|
||||
{
|
||||
return tScheme_().correction(vf) + skewCorrection(vf);
|
||||
}
|
||||
else if (tScheme_().corrected())
|
||||
{
|
||||
return tScheme_().correction(vf);
|
||||
}
|
||||
else if ((this->mesh()).skew())
|
||||
{
|
||||
return skewCorrection(vf);
|
||||
}
|
||||
else
|
||||
{
|
||||
return
|
||||
tmp<GeometricField<Type, faePatchField, edgeMesh>>
|
||||
(
|
||||
nullptr
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,39 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | www.openfoam.com
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
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 "faMesh.H"
|
||||
#include "skewCorrectedEdgeInterpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makeEdgeInterpolationScheme(skewCorrectedEdgeInterpolation)
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -6,6 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -38,11 +39,8 @@ Foam::tmp<Foam::Field<Type>> Foam::volSurfaceMapping::mapToSurface
|
||||
// Grab labels for all faces in faMesh
|
||||
const labelList& faceLabels = mesh_.faceLabels();
|
||||
|
||||
tmp<Field<Type>> tresult
|
||||
(
|
||||
new Field<Type>(faceLabels.size(), Zero)
|
||||
);
|
||||
Field<Type>& result = tresult.ref();
|
||||
auto tresult = tmp<Field<Type>>::New(faceLabels.size(), Zero);
|
||||
auto& result = tresult.ref();
|
||||
|
||||
// Get reference to volume mesh
|
||||
const polyMesh& pMesh = mesh_();
|
||||
@ -67,6 +65,41 @@ Foam::tmp<Foam::Field<Type>> Foam::volSurfaceMapping::mapToSurface
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type>> Foam::volSurfaceMapping::mapInternalToSurface
|
||||
(
|
||||
const typename GeometricField<Type, fvPatchField, volMesh>::Boundary& df
|
||||
) const
|
||||
{
|
||||
// Grab labels for all faces in faMesh
|
||||
const labelList& faceLabels = mesh_.faceLabels();
|
||||
|
||||
auto tresult = tmp<Field<Type>>::New(faceLabels.size(), Zero);
|
||||
auto& result = tresult.ref();
|
||||
|
||||
// Get reference to volume mesh
|
||||
const polyMesh& pMesh = mesh_();
|
||||
const polyBoundaryMesh& bm = pMesh.boundaryMesh();
|
||||
|
||||
label patchID, faceID;
|
||||
|
||||
// Grab droplet cloud source by identifying patch and face
|
||||
forAll(faceLabels, i)
|
||||
{
|
||||
// Escape if face is beyond active faces, eg belongs to a face zone
|
||||
if (faceLabels[i] < pMesh.nFaces())
|
||||
{
|
||||
patchID = bm.whichPatch(faceLabels[i]);
|
||||
faceID = bm[patchID].whichFace(faceLabels[i]);
|
||||
|
||||
result[i] = df[patchID].patchInternalField()()[faceID];
|
||||
}
|
||||
}
|
||||
|
||||
return tresult;
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::volSurfaceMapping::mapToVolume
|
||||
(
|
||||
@ -103,7 +136,7 @@ template<class Type>
|
||||
void Foam::volSurfaceMapping::mapToVolume
|
||||
(
|
||||
const tmp<GeometricField<Type, faPatchField, areaMesh>>& taf,
|
||||
typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bf
|
||||
typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bf
|
||||
) const
|
||||
{
|
||||
mapToVolume(taf(), bf);
|
||||
@ -112,4 +145,31 @@ void Foam::volSurfaceMapping::mapToVolume
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::volSurfaceMapping::mapToField
|
||||
(
|
||||
const GeometricField<Type, faPatchField, areaMesh>& af,
|
||||
Field<Type>& f
|
||||
) const
|
||||
{
|
||||
const labelList& faceLabels = mesh_.faceLabels();
|
||||
|
||||
const polyMesh& pMesh = mesh_();
|
||||
const polyBoundaryMesh& bm = pMesh.boundaryMesh();
|
||||
label patchID, faceID;
|
||||
|
||||
const Field<Type>& afi = af.internalField();
|
||||
|
||||
forAll(faceLabels, i)
|
||||
{
|
||||
if (faceLabels[i] < pMesh.nFaces())
|
||||
{
|
||||
patchID = bm.whichPatch(faceLabels[i]);
|
||||
faceID = bm[patchID].whichFace(faceLabels[i]);
|
||||
f[faceID] = afi[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (C) 2016-2017 Wikki Ltd
|
||||
Copyright (C) 2019 OpenCFD Ltd.
|
||||
Copyright (C) 2019-2020 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -56,21 +56,12 @@ template<class Type> class fvPatchField;
|
||||
|
||||
class volSurfaceMapping
|
||||
{
|
||||
// Private data
|
||||
// Private Data
|
||||
|
||||
//- Reference to mesh
|
||||
const faMesh& mesh_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- No copy construct
|
||||
volSurfaceMapping(const volSurfaceMapping&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const volSurfaceMapping&) = delete;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructors
|
||||
@ -81,6 +72,12 @@ public:
|
||||
mesh_(mesh)
|
||||
{}
|
||||
|
||||
//- No copy construct
|
||||
volSurfaceMapping(const volSurfaceMapping&) = delete;
|
||||
|
||||
//- No copy assignment
|
||||
void operator=(const volSurfaceMapping&) = delete;
|
||||
|
||||
|
||||
//- Destructor
|
||||
~volSurfaceMapping() = default;
|
||||
@ -96,6 +93,15 @@ public:
|
||||
GeometricField<Type, fvPatchField, volMesh>::Boundary& df
|
||||
) const;
|
||||
|
||||
|
||||
//- Map patch internal field to surface
|
||||
template<class Type>
|
||||
tmp<Field<Type>> mapInternalToSurface
|
||||
(
|
||||
const typename
|
||||
GeometricField<Type, fvPatchField, volMesh>::Boundary& df
|
||||
) const;
|
||||
|
||||
//- Map surface field to volume boundary field
|
||||
template<class Type>
|
||||
void mapToVolume
|
||||
@ -104,12 +110,22 @@ public:
|
||||
typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bf
|
||||
) const;
|
||||
|
||||
//- Map surface tmp field to volume boundary field
|
||||
template<class Type>
|
||||
void mapToVolume
|
||||
(
|
||||
const tmp<GeometricField<Type, faPatchField, areaMesh>>& taf,
|
||||
typename GeometricField<Type, fvPatchField, volMesh>::Boundary& bf
|
||||
) const;
|
||||
|
||||
//- Map surface field to field assumes Field
|
||||
//- faces in the same order as Boundary
|
||||
template<class Type>
|
||||
void mapToField
|
||||
(
|
||||
const GeometricField<Type, faPatchField, areaMesh>& af,
|
||||
Field<Type>& f
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user