noSlip: New wall boundary condition for velocity

noSlip is equivalent to fixedValue with a value of (0 0 0) but is
simpler to specify e.g.

     upperWall
     {
         type            noSlip;
     }
This commit is contained in:
Henry Weller 2016-02-09 18:45:13 +00:00
parent 905eaa01e6
commit 9233361899
8 changed files with 328 additions and 29 deletions

View File

@ -156,6 +156,7 @@ $(derivedFvPatchFields)/mappedFixedPushedInternalValue/mappedFixedPushedInternal
$(derivedFvPatchFields)/mappedFixedValue/mappedFixedValueFvPatchFields.C
$(derivedFvPatchFields)/mappedFlowRate/mappedFlowRateFvPatchVectorField.C
$(derivedFvPatchFields)/mappedVelocityFluxFixedValue/mappedVelocityFluxFixedValueFvPatchField.C
$(derivedFvPatchFields)/noSlip/noSlipFvPatchVectorField.C
$(derivedFvPatchFields)/movingWallVelocity/movingWallVelocityFvPatchVectorField.C
$(derivedFvPatchFields)/outletInlet/outletInletFvPatchFields.C
$(derivedFvPatchFields)/outletMappedUniformInlet/outletMappedUniformInletFvPatchFields.C

View File

@ -38,6 +38,18 @@ Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
{}
template<class Type>
Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const Type& value
)
:
fvPatchField<Type>(p, iF, value)
{}
template<class Type>
Foam::fixedValueFvPatchField<Type>::fixedValueFvPatchField
(

View File

@ -87,6 +87,14 @@ public:
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and value
fixedValueFvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const Type& value
);
//- Construct from patch, internal field and dictionary
fixedValueFvPatchField
(

View File

@ -0,0 +1,102 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 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 "noSlipFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(p, iF, vector::zero)
{}
Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
(
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
)
:
fixedValueFvPatchVectorField(p, iF, vector::zero)
{}
Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
(
const noSlipFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchVectorField(p, iF, vector::zero)
{}
Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
(
const noSlipFvPatchVectorField& mwvpvf
)
:
fixedValueFvPatchVectorField(mwvpvf)
{}
Foam::noSlipFvPatchVectorField::noSlipFvPatchVectorField
(
const noSlipFvPatchVectorField& mwvpvf,
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(mwvpvf, iF)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::noSlipFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
makePatchTypeField
(
fvPatchVectorField,
noSlipFvPatchVectorField
);
}
// ************************************************************************* //

View File

@ -0,0 +1,153 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 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::noSlipFvPatchVectorField
Group
grpWallBoundaryConditions
Description
This boundary condition fixes the velocity to zero at walls.
\heading Patch usage
Example of the boundary condition specification:
\verbatim
myPatch
{
type noSlip;
}
\endverbatim
SeeAlso
Foam::fixedValueFvPatchVectorField
SourceFiles
noSlipFvPatchVectorField.C
\*---------------------------------------------------------------------------*/
#ifndef noSlipFvPatchVectorField_H
#define noSlipFvPatchVectorField_H
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class noSlipFvPatchVectorField Declaration
\*---------------------------------------------------------------------------*/
class noSlipFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
public:
//- Runtime type information
TypeName("noSlip");
// Constructors
//- Construct from patch and internal field
noSlipFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&
);
//- Construct from patch, internal field and dictionary
noSlipFvPatchVectorField
(
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const dictionary&
);
//- Construct by mapping given noSlipFvPatchVectorField
// onto a new patch
noSlipFvPatchVectorField
(
const noSlipFvPatchVectorField&,
const fvPatch&,
const DimensionedField<vector, volMesh>&,
const fvPatchFieldMapper&
);
//- Construct as copy
noSlipFvPatchVectorField
(
const noSlipFvPatchVectorField&
);
//- Construct and return a clone
virtual tmp<fvPatchVectorField> clone() const
{
return tmp<fvPatchVectorField>
(
new noSlipFvPatchVectorField(*this)
);
}
//- Construct as copy setting internal field reference
noSlipFvPatchVectorField
(
const noSlipFvPatchVectorField&,
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 noSlipFvPatchVectorField(*this, iF)
);
}
// Member functions
//- Write
virtual void write(Ostream&) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -47,6 +47,23 @@ Foam::fvPatchField<Type>::fvPatchField
{}
template<class Type>
Foam::fvPatchField<Type>::fvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const Type& value
)
:
Field<Type>(p.size(), value),
patch_(p),
internalField_(iF),
updated_(false),
manipulatedMatrix_(false),
patchType_(word::null)
{}
template<class Type>
Foam::fvPatchField<Type>::fvPatchField
(
@ -81,31 +98,6 @@ Foam::fvPatchField<Type>::fvPatchField
{}
template<class Type>
Foam::fvPatchField<Type>::fvPatchField
(
const fvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
Field<Type>(p.size()),
patch_(p),
internalField_(iF),
updated_(false),
manipulatedMatrix_(false),
patchType_(ptf.patchType_)
{
// For unmapped faces set to internal field value (zero-gradient)
if (notNull(iF) && iF.size())
{
fvPatchField<Type>::operator=(this->patchInternalField());
}
this->map(ptf, mapper);
}
template<class Type>
Foam::fvPatchField<Type>::fvPatchField
(
@ -144,6 +136,31 @@ Foam::fvPatchField<Type>::fvPatchField
}
template<class Type>
Foam::fvPatchField<Type>::fvPatchField
(
const fvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
)
:
Field<Type>(p.size()),
patch_(p),
internalField_(iF),
updated_(false),
manipulatedMatrix_(false),
patchType_(ptf.patchType_)
{
// For unmapped faces set to internal field value (zero-gradient)
if (notNull(iF) && iF.size())
{
fvPatchField<Type>::operator=(this->patchInternalField());
}
this->map(ptf, mapper);
}
template<class Type>
Foam::fvPatchField<Type>::fvPatchField
(

View File

@ -166,6 +166,14 @@ public:
const DimensionedField<Type, volMesh>&
);
//- Construct from patch, internal field and value
fvPatchField
(
const fvPatch&,
const DimensionedField<Type, volMesh>&,
const Type& value
);
//- Construct from patch and internal field and patch type
fvPatchField
(

View File

@ -33,14 +33,12 @@ boundaryField
upperWall
{
type fixedValue;
value uniform (0 0 0);
type noSlip;
}
lowerWall
{
type fixedValue;
value uniform (0 0 0);
type noSlip;
}
frontAndBack