Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
a5fb2fca
Commit
a5fb2fca
authored
12 years ago
by
andy
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Cache kappa for directionalSolidThermo instead of creating field on each pass of face loop
parent
76da0462
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
+31
-32
31 additions, 32 deletions
...tchFields/temperatureCoupledBase/temperatureCoupledBase.C
with
31 additions
and
32 deletions
src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/temperatureCoupledBase/temperatureCoupledBase.C
+
31
−
32
View file @
a5fb2fca
...
@@ -99,66 +99,58 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
...
@@ -99,66 +99,58 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
);
);
return
model
.
kappaEff
(
patch_
.
index
());
return
model
.
kappaEff
(
patch_
.
index
());
break
;
}
}
break
;
case
SOLIDTHERMO
:
case
SOLIDTHERMO
:
{
{
const
solidThermo
&
thermo
=
const
solidThermo
&
thermo
=
mesh
.
lookupObject
<
solidThermo
>
mesh
.
lookupObject
<
solidThermo
>
(
"thermophysicalProperties"
);
(
"thermophysicalProperties"
);
return
thermo
.
kappa
(
patch_
.
index
());
return
thermo
.
kappa
(
patch_
.
index
());
break
;
}
}
break
;
case
DIRECTIONALSOLIDTHERMO
:
case
DIRECTIONALSOLIDTHERMO
:
{
{
const
solidThermo
&
thermo
=
const
solidThermo
&
thermo
=
mesh
.
lookupObject
<
solidThermo
>
mesh
.
lookupObject
<
solidThermo
>
(
"thermophysicalProperties"
);
(
"thermophysicalProperties"
const
vectorField
kappa
(
thermo
.
Kappa
(
patch_
.
index
()));
);
tmp
<
scalarField
>
tmeanKappa
(
Tp
);
tmp
<
scalarField
>
tmeanKappa
(
Tp
);
scalarField
&
meanKappa
=
tmeanKappa
();
scalarField
&
meanKappa
=
tmeanKappa
();
forAll
(
meanKappa
,
i
)
forAll
(
meanKappa
,
i
)
{
{
meanKappa
[
i
]
=
meanKappa
[
i
]
=
(
kappa
[
i
].
x
()
+
kappa
[
i
].
y
()
+
kappa
[
i
].
z
())
/
3
.
0
;
(
thermo
.
Kappa
(
patch_
.
index
())()[
i
].
x
()
+
thermo
.
Kappa
(
patch_
.
index
())()[
i
].
y
()
+
thermo
.
Kappa
(
patch_
.
index
())()[
i
].
z
()
)
/
3
.
0
;
}
}
return
meanKappa
;
return
meanKappa
;
break
;
}
}
break
;
case
LOOKUP
:
case
LOOKUP
:
{
{
if
(
mesh
.
objectRegistry
::
foundObject
<
volScalarField
>
(
kappaName_
))
if
(
mesh
.
objectRegistry
::
foundObject
<
volScalarField
>
(
kappaName_
))
{
{
return
patch_
.
lookupPatchField
return
patch_
.
lookupPatchField
<
volScalarField
,
scalar
>
<
(
volScalarField
,
scalar
kappaName_
>
(
kappaName_
);
);
}
}
else
if
else
if
(
(
mesh
.
objectRegistry
::
foundObject
mesh
.
objectRegistry
::
foundObject
<
volSymmTensorField
>
<
(
volSymmTensorField
kappaName_
>
(
kappaName_
)
)
)
)
{
{
const
symmTensorField
&
KWall
=
const
symmTensorField
&
KWall
=
patch_
.
lookupPatchField
patch_
.
lookupPatchField
<
volSymmTensorField
,
scalar
>
<
(
volSymmTensorField
,
scalar
kappaName_
>
(
kappaName_
);
);
const
vectorField
n
(
patch_
.
nf
());
const
vectorField
n
(
patch_
.
nf
());
...
@@ -166,7 +158,10 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
...
@@ -166,7 +158,10 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
}
}
else
else
{
{
FatalErrorIn
(
"temperatureCoupledBase::K() const"
)
FatalErrorIn
(
"temperatureCoupledBase::kappa(const scalarField&) const"
)
<<
"Did not find field "
<<
kappaName_
<<
"Did not find field "
<<
kappaName_
<<
" on mesh "
<<
mesh
.
name
()
<<
" patch "
<<
patch_
.
name
()
<<
" on mesh "
<<
mesh
.
name
()
<<
" patch "
<<
patch_
.
name
()
<<
endl
<<
endl
...
@@ -178,12 +173,16 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
...
@@ -178,12 +173,16 @@ Foam::tmp<Foam::scalarField> Foam::temperatureCoupledBase::kappa
return
scalarField
(
0
);
return
scalarField
(
0
);
}
}
break
;
}
}
default:
default:
{
{
FatalErrorIn
(
"temperatureCoupledBase::kappa() const"
)
FatalErrorIn
<<
"Unimplemented method "
<<
method_
<<
endl
(
"temperatureCoupledBase::kappa(const scalarField&) const"
)
<<
"Unimplemented method "
<<
method_
<<
nl
<<
"Please set 'kappa' to one of "
<<
KMethodTypeNames_
.
toc
()
<<
"Please set 'kappa' to one of "
<<
KMethodTypeNames_
.
toc
()
<<
" and 'kappaName' to the name of the volScalar"
<<
" and 'kappaName' to the name of the volScalar"
<<
" or volSymmTensor field (if kappa=lookup)"
<<
" or volSymmTensor field (if kappa=lookup)"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment