Commit 92333618 authored by Henry Weller's avatar Henry Weller
Browse files

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;
     }
parent 905eaa01
......@@ -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
......
......@@ -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
(
......
......@@ -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
(
......
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
);
}
// ************************************************************************* //
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
// ************************************************************************* //
......@@ -52,15 +52,15 @@ Foam::fvPatchField<Type>::fvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const word& patchType
const Type& value
)
:
Field<Type>(p.size()),
Field<Type>(p.size(), value),
patch_(p),
internalField_(iF),
updated_(false),
manipulatedMatrix_(false),
patchType_(patchType)
patchType_(word::null)
{}
......@@ -69,41 +69,33 @@ Foam::fvPatchField<Type>::fvPatchField
(
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const Field<Type>& f
const word& patchType
)
:
Field<Type>(f),
Field<Type>(p.size()),
patch_(p),
internalField_(iF),
updated_(false),
manipulatedMatrix_(false),
patchType_(word::null)
patchType_(patchType)
{}
template<class Type>
Foam::fvPatchField<Type>::fvPatchField
(
const fvPatchField<Type>& ptf,
const fvPatch& p,
const DimensionedField<Type, volMesh>& iF,
const fvPatchFieldMapper& mapper
const Field<Type>& f
)
:
Field<Type>(p.size()),
Field<Type>(f),
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);
}
patchType_(word::null)
{}
template<class Type>
......@@ -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
(
......
......@@ -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
(
......
......@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment