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
5651a0e2
Commit
5651a0e2
authored
5 years ago
by
Alexander Jaust
Browse files
Options
Downloads
Plain Diff
merged with feature/t-reconstruction
parents
8ee4d2fb
3eb310fe
No related branches found
No related tags found
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
+61
-0
61 additions, 0 deletions
appl/conjugateheattransfer/iterative/main_solidenergy.cc
with
61 additions
and
0 deletions
appl/conjugateheattransfer/iterative/main_solidenergy.cc
+
61
−
0
View file @
5651a0e2
...
@@ -47,6 +47,64 @@
...
@@ -47,6 +47,64 @@
#include
"../monolithic/problem_heat.hh"
#include
"../monolithic/problem_heat.hh"
#include
"precicewrapper.hh"
#include
"precicewrapper.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
int
main
(
int
argc
,
char
**
argv
)
try
{
{
using
namespace
Dumux
;
using
namespace
Dumux
;
...
@@ -187,6 +245,9 @@ int main(int argc, char** argv) try
...
@@ -187,6 +245,9 @@ int main(int argc, char** argv) try
using
NewtonSolver
=
NewtonSolver
<
Assembler
,
LinearSolver
>
;
using
NewtonSolver
=
NewtonSolver
<
Assembler
,
LinearSolver
>
;
NewtonSolver
nonLinearSolver
(
assembler
,
linearSolver
);
NewtonSolver
nonLinearSolver
(
assembler
,
linearSolver
);
// TODO resize
std
::
vector
<
Scalar
>
boundaryTemperature
;
//Checkpointing variable for preCICE
//Checkpointing variable for preCICE
auto
sol_checkpoint
=
sol
;
auto
sol_checkpoint
=
sol
;
...
...
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