Skip to content
GitLab
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
e3008553
Commit
e3008553
authored
Feb 07, 2019
by
mattijs
Committed by
Andrew Heather
Feb 07, 2019
Browse files
ENH: uniformFixedValue: adapt point bc. See
#1046
.
parent
078e3474
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/Make/files
View file @
e3008553
...
...
@@ -699,7 +699,6 @@ $(constraintPointPatchFields)/wedge/wedgePointPatchFields.C
derivedPointPatchFields = $(pointPatchFields)/derived
$(derivedPointPatchFields)/slip/slipPointPatchFields.C
$(derivedPointPatchFields)/fixedNormalSlip/fixedNormalSlipPointPatchFields.C
$(derivedPointPatchFields)/uniformFixedValue/uniformFixedValuePointPatchFields.C
$(derivedPointPatchFields)/timeVaryingUniformFixedValue/timeVaryingUniformFixedValuePointPatchFields.C
$(derivedPointPatchFields)/codedFixedValue/codedFixedValuePointPatchFields.C
...
...
src/fvMotionSolver/Make/files
View file @
e3008553
...
...
@@ -37,6 +37,7 @@ $(derivedPoint)/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorF
$(derivedPoint)/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C
$(derivedPoint)/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
$(derivedPoint)/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
$(derivedPoint)/uniformFixedValue/uniformFixedValuePointPatchFields.C
$(derivedPoint)/waveDisplacement/waveDisplacementPointPatchVectorField.C
$(derivedPoint)/timeVaryingMappedFixedValue/timeVaryingMappedFixedValuePointPatchFields.C
...
...
src/
OpenFOAM/fields
/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchField.C
→
src/
fvMotionSolver
/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchField.C
View file @
e3008553
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
...
...
@@ -26,6 +26,27 @@ License
\*---------------------------------------------------------------------------*/
#include
"uniformFixedValuePointPatchField.H"
#include
"SubField.H"
#include
"polyPatch.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
template
<
class
Type
>
const
Foam
::
polyPatch
&
Foam
::
uniformFixedValuePointPatchField
<
Type
>::
getPatch
(
const
pointPatch
&
p
)
{
const
polyMesh
&
mesh
=
p
.
boundaryMesh
().
mesh
()();
label
patchi
=
mesh
.
boundaryMesh
().
findPatchID
(
p
.
name
());
if
(
patchi
==
-
1
)
{
FatalErrorInFunction
<<
"Cannot use uniformFixedValue on patch "
<<
p
.
name
()
<<
" since there is no underlying mesh patch"
<<
exit
(
FatalError
);
}
return
mesh
.
boundaryMesh
()[
patchi
];
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
...
...
@@ -52,7 +73,16 @@ uniformFixedValuePointPatchField
)
:
fixedValuePointPatchField
<
Type
>
(
p
,
iF
,
dict
,
false
),
uniformValue_
(
Function1
<
Type
>::
New
(
"uniformValue"
,
dict
))
uniformValue_
(
PatchFunction1
<
Type
>::
New
(
this
->
getPatch
(
p
),
"uniformValue"
,
dict
,
false
// generate point values
)
)
{
if
(
dict
.
found
(
"value"
))
{
...
...
@@ -63,8 +93,7 @@ uniformFixedValuePointPatchField
}
else
{
const
scalar
t
=
this
->
db
().
time
().
timeOutputValue
();
fixedValuePointPatchField
<
Type
>::
operator
=
(
uniformValue_
->
value
(
t
));
this
->
evaluate
();
}
}
...
...
@@ -80,11 +109,18 @@ uniformFixedValuePointPatchField
)
:
fixedValuePointPatchField
<
Type
>
(
ptf
,
p
,
iF
,
mapper
),
uniformValue_
(
ptf
.
uniformValue_
.
clone
())
uniformValue_
(
ptf
.
uniformValue_
.
clone
(
this
->
getPatch
(
p
)
))
{
// For safety re-evaluate
const
scalar
t
=
this
->
db
().
time
().
timeOutputValue
();
fixedValuePointPatchField
<
Type
>::
operator
=
(
uniformValue_
->
value
(
t
));
if
(
mapper
.
direct
()
&&
!
mapper
.
hasUnmapped
())
{
// Use mapping instead of re-evaluation
this
->
map
(
ptf
,
mapper
);
}
else
{
// Evaluate since value not mapped
this
->
evaluate
();
}
}
...
...
@@ -96,7 +132,7 @@ uniformFixedValuePointPatchField
)
:
fixedValuePointPatchField
<
Type
>
(
ptf
),
uniformValue_
(
ptf
.
uniformValue_
.
clone
())
uniformValue_
(
ptf
.
uniformValue_
.
clone
(
this
->
getPatch
(
this
->
patch
())
))
{}
...
...
@@ -109,15 +145,44 @@ uniformFixedValuePointPatchField
)
:
fixedValuePointPatchField
<
Type
>
(
ptf
,
iF
),
uniformValue_
(
ptf
.
uniformValue_
.
clone
())
uniformValue_
(
ptf
.
uniformValue_
.
clone
(
this
->
getPatch
(
this
->
patch
())))
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
uniformFixedValuePointPatchField
<
Type
>::
autoMap
(
const
pointPatchFieldMapper
&
mapper
)
{
// For safety re-evaluate
const
scalar
t
=
this
->
db
().
time
().
timeOutputValue
();
fixedValuePointPatchField
<
Type
>::
operator
==
(
uniformValue_
->
value
(
t
));
fixedValuePointPatchField
<
Type
>::
autoMap
(
mapper
);
uniformValue_
().
autoMap
(
mapper
);
if
(
uniformValue_
().
constant
())
{
// If mapper is not dependent on time we're ok to evaluate
this
->
evaluate
();
}
}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
<
class
Type
>
void
Foam
::
uniformFixedValuePointPatchField
<
Type
>::
rmap
(
const
pointPatchField
<
Type
>&
ptf
,
const
labelList
&
addr
)
{
fixedValuePointPatchField
<
Type
>::
rmap
(
ptf
,
addr
);
const
uniformFixedValuePointPatchField
&
tiptf
=
refCast
<
const
uniformFixedValuePointPatchField
>
(
ptf
);
uniformValue_
().
rmap
(
tiptf
.
uniformValue_
(),
addr
);
}
template
<
class
Type
>
void
Foam
::
uniformFixedValuePointPatchField
<
Type
>::
updateCoeffs
()
...
...
@@ -126,10 +191,8 @@ void Foam::uniformFixedValuePointPatchField<Type>::updateCoeffs()
{
return
;
}
const
scalar
t
=
this
->
db
().
time
().
timeOutputValue
();
fixedValuePointPatchField
<
Type
>::
operator
==
(
uniformValue_
->
value
(
t
));
fixedValuePointPatchField
<
Type
>::
updateCoeffs
();
}
...
...
src/
OpenFOAM/fields
/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchField.H
→
src/
fvMotionSolver
/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchField.H
View file @
e3008553
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
...
...
@@ -51,13 +51,15 @@ SourceFiles
#define uniformFixedValuePointPatchField_H
#include
"fixedValuePointPatchField.H"
#include
"Function1.H"
#include
"
Patch
Function1.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
class
polyPatch
;
/*---------------------------------------------------------------------------*\
Class uniformFixedValuePointPatchField Declaration
\*---------------------------------------------------------------------------*/
...
...
@@ -67,9 +69,14 @@ class uniformFixedValuePointPatchField
:
public
fixedValuePointPatchField
<
Type
>
{
// Private Member Functions
static
const
polyPatch
&
getPatch
(
const
pointPatch
&
);
// Private data
autoPtr
<
Function1
<
Type
>>
uniformValue_
;
autoPtr
<
Patch
Function1
<
Type
>>
uniformValue_
;
public:
...
...
@@ -157,6 +164,23 @@ public:
return
uniformValue_
;
}
// Mapping functions
//- Map (and resize as needed) from self given a mapping object
virtual
void
autoMap
(
const
pointPatchFieldMapper
&
);
//- Reverse map the given fvPatchField onto this fvPatchField
virtual
void
rmap
(
const
pointPatchField
<
Type
>&
,
const
labelList
&
);
// Evaluation functions
//- Update the coefficients associated with the patch field
...
...
src/
OpenFOAM/fields
/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchFields.C
→
src/
fvMotionSolver
/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchFields.C
View file @
e3008553
File moved
src/
OpenFOAM/fields
/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchFields.H
→
src/
fvMotionSolver
/pointPatchFields/derived/uniformFixedValue/uniformFixedValuePointPatchFields.H
View file @
e3008553
File moved
src/meshTools/PatchFunction1/PatchFunction1New.C
View file @
e3008553
...
...
@@ -102,7 +102,8 @@ Foam::autoPtr<Foam::PatchFunction1<Type>> Foam::PatchFunction1<Type>::New
pp
,
PatchFunction1Types
::
ConstantField
<
Type
>::
typeName
,
entryName
,
dict
dict
,
faceValues
)
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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