Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux-preCICE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
dumux-appl
dumux-preCICE
Commits
3eb310fe
Commit
3eb310fe
authored
5 years ago
by
Kilian Weishaupt
Browse files
Options
Downloads
Patches
Plain Diff
[iterative] Reconstruct temperature at solid boundary
parent
396168fa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!2
[WIP] [iterative] Reconstruct temperature at solid boundary
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
appl/conjugateheattransfer/iterative/main_solidenergy.cc
+66
-0
66 additions, 0 deletions
appl/conjugateheattransfer/iterative/main_solidenergy.cc
with
66 additions
and
0 deletions
appl/conjugateheattransfer/iterative/main_solidenergy.cc
+
66
−
0
View file @
3eb310fe
...
...
@@ -46,6 +46,64 @@
#include
"../monolithic/problem_heat.hh"
template
<
class
ThermalConductivityModel
,
class
Problem
,
class
FVElementGeometry
,
class
ElementVolumeVariables
>
auto
recontructBoundaryTemperature
(
const
Problem
&
problem
,
const
typename
FVElementGeometry
::
FVGridGeometry
::
GridView
::
template
Codim
<
0
>
::
Entity
&
element
,
const
FVElementGeometry
&
fvGeometry
,
const
ElementVolumeVariables
&
elemVolVars
,
const
typename
FVElementGeometry
::
SubControlVolumeFace
&
scvf
)
{
using
Scalar
=
typename
ElementVolumeVariables
::
VolumeVariables
::
PrimaryVariables
::
value_type
;
const
auto
&
scv
=
fvGeometry
.
scv
(
scvf
.
insideScvIdx
());
const
auto
&
volVars
=
elemVolVars
[
scv
];
const
Scalar
cellCenterTemperature
=
volVars
.
temperature
();
const
Scalar
distance
=
(
scvf
.
center
()
-
scv
.
center
()).
two_norm
();
const
Scalar
insideLambda
=
ThermalConductivityModel
::
effectiveThermalConductivity
(
volVars
,
problem
.
spatialParams
(),
element
,
fvGeometry
,
scv
);
const
Scalar
qHeat
=
problem
.
neumann
(
element
,
fvGeometry
,
elemVolVars
,
scvf
);
// q = -lambda * (t_face - t_cc) / dx
// t_face = -q * dx / lambda + t_cc
return
-
qHeat
*
distance
/
insideLambda
+
cellCenterTemperature
;
}
template
<
class
ThermalConductivityModel
,
class
TemperatureVector
,
class
Problem
,
class
GridVariables
,
class
SolutionVector
>
void
getBoundaryTemperatures
(
TemperatureVector
&
boundaryTemperature
,
const
Problem
&
problem
,
const
GridVariables
&
gridVars
,
const
SolutionVector
&
sol
)
{
const
auto
&
fvGridGeometry
=
problem
.
fvGridGeometry
();
auto
fvGeometry
=
localView
(
fvGridGeometry
);
auto
elemVolVars
=
localView
(
gridVars
.
curGridVolVars
());
for
(
const
auto
&
element
:
elements
(
fvGridGeometry
.
gridView
()))
{
fvGeometry
.
bindElement
(
element
);
elemVolVars
.
bindElement
(
element
,
fvGeometry
,
sol
);
for
(
const
auto
&
scvf
:
scvfs
(
fvGeometry
))
{
if
(
scvf
.
center
()[
1
]
>
fvGridGeometry
.
bBoxMax
()[
1
]
-
1e-7
)
// TODO find correct faces
{
std
::
cout
<<
recontructBoundaryTemperature
<
ThermalConductivityModel
>
(
problem
,
element
,
fvGeometry
,
elemVolVars
,
scvf
)
<<
std
::
endl
;
// TODO fill vector
// const auto scvfIdx = scvf.index();
// if (scvfIdx == ?? )
// {
// auto coupledScvfMap = ... ;
// boundaryTemperature[coupledScvfMap[scvfIdx]] = recontructBoundaryTemperature<ThermalConductivityModel>(problem, element, fvGeometry, elemVolVars, scvf);
// }
}
}
}
}
int
main
(
int
argc
,
char
**
argv
)
try
{
using
namespace
Dumux
;
...
...
@@ -119,6 +177,9 @@ int main(int argc, char** argv) try
using
NewtonSolver
=
NewtonSolver
<
Assembler
,
LinearSolver
>
;
NewtonSolver
nonLinearSolver
(
assembler
,
linearSolver
);
// TODO resize
std
::
vector
<
Scalar
>
boundaryTemperature
;
// time loop
timeLoop
->
start
();
do
{
...
...
@@ -138,6 +199,11 @@ int main(int argc, char** argv) try
// write vtk output
solidEnergyVtkWriter
.
write
(
timeLoop
->
time
());
getBoundaryTemperatures
<
GetPropType
<
SolidEnergyTypeTag
,
Properties
::
ThermalConductivityModel
>>
(
boundaryTemperature
,
*
solidEnergyProblem
,
*
solidEnergyGridVariables
,
sol
);
// report statistics of this time step
timeLoop
->
reportTimeStep
();
...
...
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