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
ce7b8dc2
Commit
ce7b8dc2
authored
Apr 03, 2013
by
andy
Browse files
ENH: Updated externalWallHeatFlux BC
parent
e63b58b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.C
View file @
ce7b8dc2
...
...
@@ -65,7 +65,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
:
mixedFvPatchScalarField
(
p
,
iF
),
temperatureCoupledBase
(
patch
(),
"undefined"
,
"undefined-K"
),
oldM
ode_
(
unknown
),
m
ode_
(
unknown
),
q_
(
p
.
size
(),
0
.
0
),
h_
(
p
.
size
(),
0
.
0
),
Ta_
(
p
.
size
(),
0
.
0
)
...
...
@@ -87,7 +87,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
:
mixedFvPatchScalarField
(
ptf
,
p
,
iF
,
mapper
),
temperatureCoupledBase
(
patch
(),
ptf
.
KMethod
(),
ptf
.
kappaName
()),
oldM
ode_
(
ptf
.
oldM
ode_
),
m
ode_
(
ptf
.
m
ode_
),
q_
(
ptf
.
q_
,
mapper
),
h_
(
ptf
.
h_
,
mapper
),
Ta_
(
ptf
.
Ta_
,
mapper
)
...
...
@@ -104,19 +104,19 @@ externalWallHeatFluxTemperatureFvPatchScalarField
:
mixedFvPatchScalarField
(
p
,
iF
),
temperatureCoupledBase
(
patch
(),
dict
),
oldM
ode_
(
unknown
),
m
ode_
(
unknown
),
q_
(
p
.
size
(),
0
.
0
),
h_
(
p
.
size
(),
0
.
0
),
Ta_
(
p
.
size
(),
0
.
0
)
{
if
(
dict
.
found
(
"q"
)
&&
!
dict
.
found
(
"h"
)
&&
!
dict
.
found
(
"Ta"
))
{
oldM
ode_
=
fixedHeatFlux
;
m
ode_
=
fixedHeatFlux
;
q_
=
scalarField
(
"q"
,
dict
,
p
.
size
());
}
else
if
(
dict
.
found
(
"h"
)
&&
dict
.
found
(
"Ta"
)
&&
!
dict
.
found
(
"q"
))
{
oldM
ode_
=
fixedHeatTransferCoeff
;
m
ode_
=
fixedHeatTransferCoeff
;
h_
=
scalarField
(
"h"
,
dict
,
p
.
size
());
Ta_
=
scalarField
(
"Ta"
,
dict
,
p
.
size
());
}
...
...
@@ -166,7 +166,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
:
mixedFvPatchScalarField
(
tppsf
),
temperatureCoupledBase
(
tppsf
),
oldM
ode_
(
tppsf
.
oldM
ode_
),
m
ode_
(
tppsf
.
m
ode_
),
q_
(
tppsf
.
q_
),
h_
(
tppsf
.
h_
),
Ta_
(
tppsf
.
Ta_
)
...
...
@@ -182,7 +182,7 @@ externalWallHeatFluxTemperatureFvPatchScalarField
:
mixedFvPatchScalarField
(
tppsf
,
iF
),
temperatureCoupledBase
(
patch
(),
tppsf
.
KMethod
(),
tppsf
.
kappaName
()),
oldM
ode_
(
tppsf
.
oldM
ode_
),
m
ode_
(
tppsf
.
m
ode_
),
q_
(
tppsf
.
q_
),
h_
(
tppsf
.
h_
),
Ta_
(
tppsf
.
Ta_
)
...
...
@@ -228,39 +228,45 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
}
scalarField
q
(
size
(),
0
.
0
);
scalarField
KWall
(
kappa
(
*
this
));
scalarField
KDelta
(
KWall
*
patch
().
deltaCoeffs
());
const
scalarField
Tc
(
patchInternalField
());
const
scalarField
KWall
(
kappa
(
Tc
));
const
scalarField
KDelta
(
KWall
*
patch
().
deltaCoeffs
());
if
(
oldMode_
==
fixedHeatFlux
)
switch
(
mode_
)
{
q
=
q_
;
}
else
if
(
oldMode_
==
fixedHeatTransferCoeff
)
{
q
=
(
Ta_
-
*
this
)
*
h_
;
}
else
{
FatalErrorIn
(
"externalWallHeatFluxTemperatureFvPatchScalarField"
"::updateCoeffs()"
)
<<
"Illegal heat flux mode "
<<
operationModeNames
[
oldMode_
]
<<
exit
(
FatalError
);
case
fixedHeatFlux
:
{
q
=
q_
;
break
;
}
case
fixedHeatTransferCoeff
:
{
q
=
(
Ta_
-
Tc
)
*
h_
;
break
;
}
default:
{
FatalErrorIn
(
"externalWallHeatFluxTemperatureFvPatchScalarField"
"::updateCoeffs()"
)
<<
"Illegal heat flux mode "
<<
operationModeNames
[
mode_
]
<<
exit
(
FatalError
);
}
}
forAll
(
*
this
,
i
)
forAll
(
*
this
,
i
)
{
if
(
q
[
i
]
>
0
)
//in
{
this
->
refGrad
()[
i
]
=
q
[
i
]
/
kappa
(
*
this
)()
[
i
];
this
->
refGrad
()[
i
]
=
q
[
i
]
/
KWall
[
i
];
this
->
refValue
()[
i
]
=
0
.
0
;
this
->
valueFraction
()[
i
]
=
0
.
0
;
}
else
//out
{
this
->
refGrad
()[
i
]
=
0
.
0
;
this
->
refValue
()[
i
]
=
q
[
i
]
/
KDelta
[
i
]
+
patchInternalField
()()
[
i
];
this
->
refValue
()[
i
]
=
q
[
i
]
/
KDelta
[
i
]
+
Tc
[
i
];
this
->
valueFraction
()[
i
]
=
1
.
0
;
}
}
...
...
@@ -291,7 +297,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
{
mixedFvPatchScalarField
::
write
(
os
);
temperatureCoupledBase
::
write
(
os
);
switch
(
oldM
ode_
)
switch
(
m
ode_
)
{
case
fixedHeatFlux
:
{
...
...
@@ -312,7 +318,7 @@ void Foam::externalWallHeatFluxTemperatureFvPatchScalarField::write
"("
"Ostream& os"
") const"
)
<<
"Illegal heat flux mode "
<<
operationModeNames
[
oldM
ode_
]
)
<<
"Illegal heat flux mode "
<<
operationModeNames
[
m
ode_
]
<<
abort
(
FatalError
);
}
}
...
...
src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/externalWallHeatFluxTemperature/externalWallHeatFluxTemperatureFvPatchScalarField.H
View file @
ce7b8dc2
...
...
@@ -102,7 +102,7 @@ private:
// Private data
//- Operation mode
operationMode
oldM
ode_
;
operationMode
m
ode_
;
//- Heat flux / [W/m2]
scalarField
q_
;
...
...
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