Skip to content
Snippets Groups Projects
Commit 54b2d0b4 authored by Henry Weller's avatar Henry Weller
Browse files

movingWallVelocityFvPatchVectorField: Updated to obtain the velocity field...

movingWallVelocityFvPatchVectorField: Updated to obtain the velocity field from the dimensionedInteralField
rather than by "lookup" from the database.
parent 79a18f8b
Branches
Tags
1 merge request!33Merge foundation
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -24,11 +24,10 @@ License
\*---------------------------------------------------------------------------*/
#include "movingWallVelocityFvPatchVectorField.H"
#include "addToRunTimeSelectionTable.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "fvcMeshPhi.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
......@@ -39,38 +38,35 @@ movingWallVelocityFvPatchVectorField
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(p, iF),
UName_("U")
fixedValueFvPatchVectorField(p, iF)
{}
Foam::movingWallVelocityFvPatchVectorField::
movingWallVelocityFvPatchVectorField
(
const movingWallVelocityFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const fvPatchFieldMapper& mapper
const dictionary& dict
)
:
fixedValueFvPatchVectorField(ptf, p, iF, mapper),
UName_(ptf.UName_)
{}
fixedValueFvPatchVectorField(p, iF)
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
Foam::movingWallVelocityFvPatchVectorField::
movingWallVelocityFvPatchVectorField
(
const movingWallVelocityFvPatchVectorField& ptf,
const fvPatch& p,
const DimensionedField<vector, volMesh>& iF,
const dictionary& dict
const fvPatchFieldMapper& mapper
)
:
fixedValueFvPatchVectorField(p, iF),
UName_(dict.lookupOrDefault<word>("U", "U"))
{
fvPatchVectorField::operator=(vectorField("value", dict, p.size()));
}
fixedValueFvPatchVectorField(ptf, p, iF, mapper)
{}
Foam::movingWallVelocityFvPatchVectorField::
......@@ -79,8 +75,7 @@ movingWallVelocityFvPatchVectorField
const movingWallVelocityFvPatchVectorField& mwvpvf
)
:
fixedValueFvPatchVectorField(mwvpvf),
UName_(mwvpvf.UName_)
fixedValueFvPatchVectorField(mwvpvf)
{}
......@@ -91,8 +86,7 @@ movingWallVelocityFvPatchVectorField
const DimensionedField<vector, volMesh>& iF
)
:
fixedValueFvPatchVectorField(mwvpvf, iF),
UName_(mwvpvf.UName_)
fixedValueFvPatchVectorField(mwvpvf, iF)
{}
......@@ -124,7 +118,9 @@ void Foam::movingWallVelocityFvPatchVectorField::updateCoeffs()
const vectorField Up((pp.faceCentres() - oldFc)/deltaT);
const volVectorField& U = db().lookupObject<volVectorField>(UName_);
const volVectorField& U =
static_cast<const volVectorField&>(dimensionedInternalField());
scalarField phip
(
p.patchField<surfaceScalarField, scalar>(fvc::meshPhi(U))
......@@ -145,7 +141,6 @@ void Foam::movingWallVelocityFvPatchVectorField::updateCoeffs()
void Foam::movingWallVelocityFvPatchVectorField::write(Ostream& os) const
{
fvPatchVectorField::write(os);
writeEntryIfDifferent<word>(os, "U", "U", UName_);
writeEntry("value", os);
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -32,21 +32,14 @@ Description
moving walls. In addition, it should also be applied to 'moving' walls
for moving reference frame (MRF) calculations.
\heading Patch usage
\table
Property | Description | Required | Default value
U | velociy field name | no | U
\endtable
Example of the boundary condition specification:
\verbatim
myPatch
{
type movingWallVelocity;
U U;
value uniform 0; // initial value
value uniform (0 0 0); // Initial value
}
\endverbatim
......@@ -62,7 +55,6 @@ SourceFiles
#ifndef movingWallVelocityFvPatchVectorField_H
#define movingWallVelocityFvPatchVectorField_H
#include "fvPatchFields.H"
#include "fixedValueFvPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
......@@ -78,11 +70,6 @@ class movingWallVelocityFvPatchVectorField
:
public fixedValueFvPatchVectorField
{
// Private data
//- Name of velocity field
word UName_;
public:
......
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