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
6d71a38e
Commit
6d71a38e
authored
Apr 15, 2010
by
mattijs
Browse files
ENH: Allow tensorial K
parent
2de3c0d2
Changes
2
Hide whitespace changes
Inline
Side-by-side
applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
View file @
6d71a38e
...
...
@@ -124,6 +124,41 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap
}
Foam
::
tmp
<
Foam
::
scalarField
>
Foam
::
solidWallHeatFluxTemperatureFvPatchScalarField
::
K
()
const
{
const
fvMesh
&
mesh
=
patch
().
boundaryMesh
().
mesh
();
if
(
mesh
.
objectRegistry
::
foundObject
<
volScalarField
>
(
KName_
))
{
return
patch
().
lookupPatchField
<
volScalarField
,
scalar
>
(
KName_
);
}
else
if
(
mesh
.
objectRegistry
::
foundObject
<
volSymmTensorField
>
(
KName_
))
{
const
symmTensorField
&
KWall
=
patch
().
lookupPatchField
<
volSymmTensorField
,
scalar
>
(
KName_
);
vectorField
n
=
patch
().
nf
();
return
n
&
KWall
&
n
;
}
else
{
FatalErrorIn
(
"solidWallHeatFluxTemperatureFvPatchScalarField::K()"
" const"
)
<<
"Did not find field "
<<
KName_
<<
" on mesh "
<<
mesh
.
name
()
<<
" patch "
<<
patch
().
name
()
<<
endl
<<
"Please set 'K' to a valid volScalarField"
<<
" or a valid volSymmTensorField."
<<
exit
(
FatalError
);
return
scalarField
(
0
);
}
}
void
Foam
::
solidWallHeatFluxTemperatureFvPatchScalarField
::
updateCoeffs
()
{
if
(
updated
())
...
...
@@ -131,12 +166,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
return
;
}
const
scalarField
&
Kw
=
patch
().
lookupPatchField
<
volScalarField
,
scalar
>
(
KName_
);
gradient
()
=
q_
/
Kw
;
gradient
()
=
q_
/
K
();
fixedGradientFvPatchScalarField
::
updateCoeffs
();
}
...
...
applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H
View file @
6d71a38e
...
...
@@ -31,9 +31,10 @@ Description
myWallPatch
{
type solidWallHeatFluxTemperature;
K K; // Name of K field
q uniform 1000; // Heat flux / [W/m2]
value 300.0; // Initial temperature / [K]
K K; // Name of K field
q uniform 1000; // Heat flux / [W/m2]
value uniform 300.0; // Initial temperature / [K]
gradient uniform 0.0; // Initial gradient / [K/m]
}
...
...
@@ -140,6 +141,11 @@ public:
// Member functions
// Helper
//- Get K field on this patch
tmp
<
scalarField
>
K
()
const
;
// Evaluation functions
//- Update the coefficients associated with the patch field
...
...
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