Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
9beda11f
Commit
9beda11f
authored
Feb 10, 2016
by
Henry Weller
Browse files
translatingWallVelocityFvPatchVectorField: Changed the translation velocity to a Function1
to support time-variation
parent
5c6b3783
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
View file @
9beda11f
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2016
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -26,7 +26,6 @@ License
#include
"translatingWallVelocityFvPatchVectorField.H"
#include
"addToRunTimeSelectionTable.H"
#include
"volFields.H"
#include
"surfaceFields.H"
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
...
...
@@ -38,38 +37,38 @@ translatingWallVelocityFvPatchVectorField
)
:
fixedValueFvPatchField
<
vector
>
(
p
,
iF
),
U_
(
vector
::
zero
)
U_
(
0
)
{}
Foam
::
translatingWallVelocityFvPatchVectorField
::
translatingWallVelocityFvPatchVectorField
(
const
translatingWallVelocityFvPatchVectorField
&
ptf
,
const
fvPatch
&
p
,
const
DimensionedField
<
vector
,
volMesh
>&
iF
,
const
fvPatchFieldMapper
&
mapper
const
dictionary
&
dict
)
:
fixedValueFvPatchField
<
vector
>
(
ptf
,
p
,
iF
,
mapper
),
U_
(
ptf
.
U_
)
{}
fixedValueFvPatchField
<
vector
>
(
p
,
iF
),
U_
(
Function1
<
vector
>::
New
(
"U"
,
dict
))
{
// Evaluate the wall velocity
updateCoeffs
();
}
Foam
::
translatingWallVelocityFvPatchVectorField
::
translatingWallVelocityFvPatchVectorField
(
const
translatingWallVelocityFvPatchVectorField
&
ptf
,
const
fvPatch
&
p
,
const
DimensionedField
<
vector
,
volMesh
>&
iF
,
const
dictionary
&
dict
const
fvPatchFieldMapper
&
mapper
)
:
fixedValueFvPatchField
<
vector
>
(
p
,
iF
),
U_
(
dict
.
lookup
(
"U"
))
{
// Evaluate the wall velocity
updateCoeffs
();
}
fixedValueFvPatchField
<
vector
>
(
ptf
,
p
,
iF
,
mapper
),
U_
(
ptf
.
U_
,
false
)
{}
Foam
::
translatingWallVelocityFvPatchVectorField
::
...
...
@@ -79,7 +78,7 @@ translatingWallVelocityFvPatchVectorField
)
:
fixedValueFvPatchField
<
vector
>
(
twvpvf
),
U_
(
twvpvf
.
U_
)
U_
(
twvpvf
.
U_
,
false
)
{}
...
...
@@ -91,7 +90,7 @@ translatingWallVelocityFvPatchVectorField
)
:
fixedValueFvPatchField
<
vector
>
(
twvpvf
,
iF
),
U_
(
twvpvf
.
U_
)
U_
(
twvpvf
.
U_
,
false
)
{}
...
...
@@ -104,9 +103,12 @@ void Foam::translatingWallVelocityFvPatchVectorField::updateCoeffs()
return
;
}
const
scalar
t
=
this
->
db
().
time
().
timeOutputValue
();
const
vector
U
=
U_
->
value
(
t
);
// Remove the component of U normal to the wall in case the wall is not flat
const
vectorField
n
(
patch
().
nf
());
vectorField
::
operator
=
(
U
_
-
n
*
(
n
&
U
_
));
vectorField
::
operator
=
(
U
-
n
*
(
n
&
U
));
fixedValueFvPatchVectorField
::
updateCoeffs
();
}
...
...
@@ -115,7 +117,7 @@ void Foam::translatingWallVelocityFvPatchVectorField::updateCoeffs()
void
Foam
::
translatingWallVelocityFvPatchVectorField
::
write
(
Ostream
&
os
)
const
{
fvPatchVectorField
::
write
(
os
);
os
.
write
Keyword
(
"U"
)
<<
U_
<<
token
::
END_STATEMENT
<<
nl
;
U_
->
write
Data
(
os
)
;
writeEntry
(
"value"
,
os
);
}
...
...
src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.H
View file @
9beda11f
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
6
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -35,7 +35,7 @@ Description
\table
Property | Description | Required | Default value
U | translational velocity | yes|
U | translational velocity | yes
|
\endtable
Example of the boundary condition specification:
...
...
@@ -47,9 +47,12 @@ Description
}
\endverbatim
The \c U entry is a Function1 of time, see Foam::Function1Types.
SeeAlso
Foam::fixedValueFvPatchField
Foam::Function1Types
SourceFiles
translatingWallVelocityFvPatchVectorField.C
...
...
@@ -60,6 +63,7 @@ SourceFiles
#define translatingWallVelocityFvPatchVectorField_H
#include
"fixedValueFvPatchFields.H"
#include
"Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
...
@@ -77,7 +81,7 @@ class translatingWallVelocityFvPatchVectorField
// Private data
//- Translational velocity
vector
U_
;
autoPtr
<
Function1
<
vector
>>
U_
;
public:
...
...
@@ -150,19 +154,11 @@ public:
// Member functions
// Access functions
//- Return the velocity
const
vector
&
U
()
const
{
return
U_
;
}
//- Update the coefficients associated with the patch field
virtual
void
updateCoeffs
();
//- Update the coefficients associated with the patch field
virtual
void
updateCoeffs
();
//- Write
virtual
void
write
(
Ostream
&
)
const
;
//- Write
virtual
void
write
(
Ostream
&
)
const
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment