Added block-coupled form of symmetry plane
This commit is contained in:
parent
e8615a3ce9
commit
28a3c54b9b
3 changed files with 412 additions and 0 deletions
|
@ -188,6 +188,8 @@ $(derivedFvPatchFields)/waveTransmissiveInlet/waveTransmissiveInletFvPatchFields
|
|||
$(derivedFvPatchFields)/noSlipWall/noSlipWallFvPatchVectorField.C
|
||||
$(derivedFvPatchFields)/noSlipMovingWall/noSlipMovingWallFvPatchVectorField.C
|
||||
|
||||
$(derivedFvPatchFields)/blockSymmPlane/blockSymmPlaneFvPatchVectorField.C
|
||||
|
||||
fvsPatchFields = fields/fvsPatchFields
|
||||
$(fvsPatchFields)/fvsPatchField/fvsPatchFields.C
|
||||
|
||||
|
|
|
@ -0,0 +1,208 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 3.2
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend 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.
|
||||
|
||||
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "blockSymmPlaneFvPatchVectorField.H"
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "fvPatchFieldMapper.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
basicSymmetryFvPatchVectorField(p, iF)
|
||||
{}
|
||||
|
||||
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const dictionary& dict
|
||||
)
|
||||
:
|
||||
basicSymmetryFvPatchVectorField(p, iF, dict)
|
||||
{}
|
||||
|
||||
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const blockSymmPlaneFvPatchVectorField& ptf,
|
||||
const fvPatch& p,
|
||||
const DimensionedField<vector, volMesh>& iF,
|
||||
const fvPatchFieldMapper& mapper
|
||||
)
|
||||
:
|
||||
basicSymmetryFvPatchVectorField(ptf, p, iF, mapper)
|
||||
{}
|
||||
|
||||
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const blockSymmPlaneFvPatchVectorField& ptf
|
||||
)
|
||||
:
|
||||
basicSymmetryFvPatchVectorField(ptf)
|
||||
{}
|
||||
|
||||
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const blockSymmPlaneFvPatchVectorField& ptf,
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
)
|
||||
:
|
||||
basicSymmetryFvPatchVectorField(ptf, iF)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
// Disabled: see coupled coefficient
|
||||
Foam::tmp<Foam::vectorField>
|
||||
Foam::blockSymmPlaneFvPatchVectorField::valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
return tmp<vectorField>(new vectorField(this->size(), vector::zero));
|
||||
}
|
||||
|
||||
|
||||
// Disabled: see coupled coefficient
|
||||
Foam::tmp<Foam::vectorField>
|
||||
Foam::blockSymmPlaneFvPatchVectorField::valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
return tmp<vectorField>(new vectorField(this->size(), vector::zero));
|
||||
}
|
||||
|
||||
|
||||
// Disabled: see coupled coefficient
|
||||
Foam::tmp<Foam::vectorField>
|
||||
Foam::blockSymmPlaneFvPatchVectorField::gradientInternalCoeffs() const
|
||||
{
|
||||
return tmp<vectorField>(new vectorField(this->size(), vector::zero));
|
||||
}
|
||||
|
||||
|
||||
// Disabled: see coupled coefficient
|
||||
Foam::tmp<Foam::vectorField>
|
||||
Foam::blockSymmPlaneFvPatchVectorField::gradientBoundaryCoeffs() const
|
||||
{
|
||||
return tmp<vectorField>(new vectorField(this->size(), vector::zero));
|
||||
}
|
||||
|
||||
|
||||
// Coupled coefficient
|
||||
Foam::tmp<Foam::vectorCoeffField>
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockValueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
tmp<vectorCoeffField> tcoeff
|
||||
(
|
||||
new vectorCoeffField(this->size())
|
||||
);
|
||||
|
||||
tcoeff().asSquare() = I - this->patch().nf()*this->patch().nf();
|
||||
|
||||
return tcoeff;
|
||||
}
|
||||
|
||||
|
||||
// Coupled coefficient
|
||||
Foam::tmp<Foam::vectorField>
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockValueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const
|
||||
{
|
||||
return
|
||||
*this
|
||||
- transform
|
||||
(
|
||||
I - sqr(this->patch().nf()),
|
||||
this->patchInternalField()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Coupled coefficient
|
||||
Foam::tmp<Foam::vectorCoeffField>
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockGradientInternalCoeffs() const
|
||||
{
|
||||
tmp<vectorCoeffField> tcoeff
|
||||
(
|
||||
new vectorCoeffField(this->size())
|
||||
);
|
||||
|
||||
tcoeff().asSquare() =
|
||||
-this->patch().deltaCoeffs()*this->patch().nf()*this->patch().nf();
|
||||
|
||||
return tcoeff;
|
||||
}
|
||||
|
||||
|
||||
// Coupled coefficient
|
||||
Foam::tmp<Foam::vectorField>
|
||||
Foam::blockSymmPlaneFvPatchVectorField::blockGradientBoundaryCoeffs() const
|
||||
{
|
||||
return
|
||||
(
|
||||
sqr(this->patch().nf())
|
||||
& (
|
||||
this->snGrad()
|
||||
- transform
|
||||
(
|
||||
-this->patch().deltaCoeffs()*sqr(this->patch().nf()),
|
||||
this->patchInternalField()
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
makePatchTypeField
|
||||
(
|
||||
fvPatchVectorField,
|
||||
blockSymmPlaneFvPatchVectorField
|
||||
);
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
|
@ -0,0 +1,202 @@
|
|||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | foam-extend: Open Source CFD
|
||||
\\ / O peration | Version: 3.2
|
||||
\\ / A nd | Web: http://www.foam-extend.org
|
||||
\\/ M anipulation | For copyright notice see file Copyright
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of foam-extend.
|
||||
|
||||
foam-extend 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.
|
||||
|
||||
foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::blockSymmPlaneFvPatchVectorField
|
||||
|
||||
Description
|
||||
Block-coupled symmetry plane. Experimental
|
||||
|
||||
Author
|
||||
Hrvoje Jasak, Wikki Ltd, All rights reserved
|
||||
|
||||
SourceFiles
|
||||
blockSymmPlaneFvPatchVectorField.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef blockSymmPlaneFvPatchVectorField_H
|
||||
#define blockSymmPlaneFvPatchVectorField_H
|
||||
|
||||
#include "fvPatchFields.H"
|
||||
#include "basicSymmetryFvPatchFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class blockSymmPlaneFvPatchVectorField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class blockSymmPlaneFvPatchVectorField
|
||||
:
|
||||
public basicSymmetryFvPatchVectorField
|
||||
{
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("blockSymmPlane");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from patch and internal field
|
||||
blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct from patch, internal field and dictionary
|
||||
blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
//- Construct by mapping given
|
||||
// blockSymmPlaneFvPatchVectorField onto a new patch
|
||||
blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const blockSymmPlaneFvPatchVectorField&,
|
||||
const fvPatch&,
|
||||
const DimensionedField<vector, volMesh>&,
|
||||
const fvPatchFieldMapper&
|
||||
);
|
||||
|
||||
//- Construct as copy
|
||||
blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const blockSymmPlaneFvPatchVectorField&
|
||||
);
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual tmp<fvPatchVectorField> clone() const
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new blockSymmPlaneFvPatchVectorField(*this)
|
||||
);
|
||||
}
|
||||
|
||||
//- Construct as copy setting internal field reference
|
||||
blockSymmPlaneFvPatchVectorField
|
||||
(
|
||||
const blockSymmPlaneFvPatchVectorField&,
|
||||
const DimensionedField<vector, volMesh>&
|
||||
);
|
||||
|
||||
//- Construct and return a clone setting internal field reference
|
||||
virtual tmp<fvPatchVectorField> clone
|
||||
(
|
||||
const DimensionedField<vector, volMesh>& iF
|
||||
) const
|
||||
{
|
||||
return tmp<fvPatchVectorField>
|
||||
(
|
||||
new blockSymmPlaneFvPatchVectorField(*this, iF)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return true if this patch field is block-coupled in the
|
||||
// boundary condition, ie. if the coupling coefficient is a
|
||||
// rank x rank implicit block
|
||||
virtual bool blockCoupled() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
// evaluation of the value of this patchField with given weights
|
||||
// Disabled. HJ, 28/Mar/2016
|
||||
virtual tmp<vectorField> valueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
// evaluation of the value of this patchField with given weights
|
||||
// Disabled. HJ, 28/Mar/2016
|
||||
virtual tmp<vectorField> valueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
// evaluation of the gradient of this patchField
|
||||
// Disabled. HJ, 28/Mar/2016
|
||||
virtual tmp<vectorField> gradientInternalCoeffs() const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
// evaluation of the gradient of this patchField
|
||||
// Disabled. HJ, 28/Mar/2016
|
||||
virtual tmp<vectorField> gradientBoundaryCoeffs() const;
|
||||
|
||||
|
||||
// Block-coupled coefficients
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
// evaluation of the value of this patchField with given weights
|
||||
virtual tmp<vectorCoeffField> blockValueInternalCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
// evaluation of the value of this patchField with given weights
|
||||
virtual tmp<vectorField> blockValueBoundaryCoeffs
|
||||
(
|
||||
const tmp<scalarField>&
|
||||
) const;
|
||||
|
||||
//- Return the matrix diagonal coefficients corresponding to the
|
||||
// evaluation of the gradient of this patchField
|
||||
virtual tmp<vectorCoeffField>
|
||||
blockGradientInternalCoeffs() const;
|
||||
|
||||
//- Return the matrix source coefficients corresponding to the
|
||||
// evaluation of the gradient of this patchField
|
||||
virtual tmp<vectorField> blockGradientBoundaryCoeffs() const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
Reference in a new issue