Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
pugs
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
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
Show more breadcrumbs
code
pugs
Commits
983b408a
Commit
983b408a
authored
6 years ago
by
Fanny CHOPOT
Browse files
Options
Downloads
Patches
Plain Diff
corrections de E et G pour point fixe ur
parent
63712a38
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.cpp
+4
-4
4 additions, 4 deletions
src/main.cpp
src/scheme/NoSplitting.hpp
+52
-21
52 additions, 21 deletions
src/scheme/NoSplitting.hpp
with
56 additions
and
25 deletions
src/main.cpp
+
4
−
4
View file @
983b408a
...
@@ -148,7 +148,7 @@ int main(int argc, char *argv[])
...
@@ -148,7 +148,7 @@ int main(int argc, char *argv[])
double
t
=
0.
;
double
t
=
0.
;
int
itermax
=
std
::
numeric_limits
<
int
>::
max
();
int
itermax
=
std
::
numeric_limits
<
int
>::
max
();
//int itermax =
500
;
//int itermax =
202
;
int
iteration
=
0
;
int
iteration
=
0
;
Kokkos
::
View
<
double
*>
rhoj
=
unknowns
.
rhoj
();
Kokkos
::
View
<
double
*>
rhoj
=
unknowns
.
rhoj
();
...
@@ -341,7 +341,7 @@ int main(int argc, char *argv[])
...
@@ -341,7 +341,7 @@ int main(int argc, char *argv[])
double
dt
=
0.1
*
acoustic_solver
.
acoustic_dt
(
Vj
,
cj
);
// pour le cas xi = 0
double
dt
=
0.1
*
acoustic_solver
.
acoustic_dt
(
Vj
,
cj
);
// pour le cas xi = 0
//double dt_diff = 0.9*finite_volumes_diffusion.diffusion_dt(rhoj, kj,nuj, cj, nuL, nuR, kL,kR);
//double dt_diff = 0.9*finite_volumes_diffusion.diffusion_dt(rhoj, kj,nuj, cj, nuL, nuR, kL,kR);
double
dt_diff
=
0.
1
*
no_splitting
.
nosplitting_dt
(
Vj
,
cj
,
rhoj
,
kj
);
double
dt_diff
=
0.
9
*
no_splitting
.
nosplitting_dt
(
Vj
,
cj
,
rhoj
,
kj
);
if
(
dt_diff
<
dt
)
{
if
(
dt_diff
<
dt
)
{
dt
=
dt_diff
;
dt
=
dt_diff
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/scheme/NoSplitting.hpp
+
52
−
21
View file @
983b408a
...
@@ -248,6 +248,7 @@ private:
...
@@ -248,6 +248,7 @@ private:
Kokkos
::
View
<
Rdd
*>
m_inv_Ar
;
Kokkos
::
View
<
Rdd
*>
m_inv_Ar
;
Kokkos
::
View
<
Rd
**>
m_Fjr
;
Kokkos
::
View
<
Rd
**>
m_Fjr
;
Kokkos
::
View
<
Rd
*>
m_ur
;
Kokkos
::
View
<
Rd
*>
m_ur
;
Kokkos
::
View
<
Rd
*>
m_ur0
;
Kokkos
::
View
<
double
*>
m_rhocj
;
Kokkos
::
View
<
double
*>
m_rhocj
;
Kokkos
::
View
<
double
*>
m_Vj_over_cj
;
Kokkos
::
View
<
double
*>
m_Vj_over_cj
;
...
@@ -263,6 +264,7 @@ public:
...
@@ -263,6 +264,7 @@ public:
m_inv_Ar
(
"inv_Ar"
,
m_mesh
.
numberOfNodes
()),
m_inv_Ar
(
"inv_Ar"
,
m_mesh
.
numberOfNodes
()),
m_Fjr
(
"Fjr"
,
m_mesh
.
numberOfCells
(),
m_connectivity
.
maxNbNodePerCell
()),
m_Fjr
(
"Fjr"
,
m_mesh
.
numberOfCells
(),
m_connectivity
.
maxNbNodePerCell
()),
m_ur
(
"ur"
,
m_mesh
.
numberOfNodes
()),
m_ur
(
"ur"
,
m_mesh
.
numberOfNodes
()),
m_ur0
(
"ur0"
,
m_mesh
.
numberOfNodes
()),
m_rhocj
(
"rho_c"
,
m_mesh
.
numberOfCells
()),
m_rhocj
(
"rho_c"
,
m_mesh
.
numberOfCells
()),
m_Vj_over_cj
(
"Vj_over_cj"
,
m_mesh
.
numberOfCells
())
m_Vj_over_cj
(
"Vj_over_cj"
,
m_mesh
.
numberOfCells
())
{
{
...
@@ -320,6 +322,7 @@ public:
...
@@ -320,6 +322,7 @@ public:
const
Kokkos
::
View
<
const
Rd
**>
Fjr
=
m_Fjr
;
const
Kokkos
::
View
<
const
Rd
**>
Fjr
=
m_Fjr
;
const
Kokkos
::
View
<
const
Rd
*>
ur
=
m_ur
;
const
Kokkos
::
View
<
const
Rd
*>
ur
=
m_ur
;
const
Kokkos
::
View
<
const
Rd
*>
ur0
=
m_ur0
;
/*
/*
// Calcul de PT (1er essai)
// Calcul de PT (1er essai)
...
@@ -342,7 +345,6 @@ public:
...
@@ -342,7 +345,6 @@ public:
});
});
*/
*/
/*
/*
// Calcul de PT (2eme essai, symetrisation)
// Calcul de PT (2eme essai, symetrisation)
const Kokkos::View<const unsigned int**>& face_cells = m_connectivity.faceCells();
const Kokkos::View<const unsigned int**>& face_cells = m_connectivity.faceCells();
...
@@ -377,7 +379,7 @@ public:
...
@@ -377,7 +379,7 @@ public:
}
}
});
});
*/
std::ofstream fout2("pj");
std::ofstream fout2("pj");
fout2.precision(15);
fout2.precision(15);
...
@@ -389,37 +391,54 @@ public:
...
@@ -389,37 +391,54 @@ public:
for (size_t j=0; j<m_mesh.numberOfCells(); ++j) {
for (size_t j=0; j<m_mesh.numberOfCells(); ++j) {
fout3 << xj[j][0] << ' ' << PTj[j] << '\n';
fout3 << xj[j][0] << ' ' << PTj[j] << '\n';
}
}
*/
// Calcul de PT (3eme essai, avec uR du solveur de Riemann)
// Calcul de PT (3eme essai, avec uR du solveur de Riemann)
computeExplicitFluxes
(
xr
,
xj
,
rhoj
,
kj
,
uj
,
pj
,
cj
,
Vj
,
Cjr
,
t
);
for
(
int
itconv
=
0
;
itconv
<
100
;
++
itconv
){
// computeExplicitFluxes(xr, xj, rhoj, kj, uj, pj, cj, Vj, Cjr, t);
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
)
{
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
)
{
if
(
j
==
0
)
{
//
if (j == 0) {
PTj
(
j
)
=
pj
(
j
)
-
kj
(
j
)
*
(
uj
[
j
][
0
]
-
uL
[
0
][
0
])
/
Vl
(
0
);
//
PTj(j) = pj(j) - kj(j)*(uj[j][0]-uL[0][0])/Vl(0);
//PTj(j) = pj(j) + kj(j)*(t/((50./9.)-t*t));
//
//PTj(j) = pj(j) + kj(j)*(t/((50./9.)-t*t));
//PTj(j) = pj(j) - kj(j)*(ur[cell_nodes(j,1)][0])/Vj(j);
//
//PTj(j) = pj(j) - kj(j)*(ur[cell_nodes(j,1)][0])/Vj(j);
}
else
if
(
j
==
m_mesh
.
numberOfCells
()
-
1
)
{
//
} else if (j == m_mesh.numberOfCells()-1) {
PTj
(
j
)
=
pj
(
j
)
-
kj
(
j
)
*
(
uR
[
0
][
0
]
-
uj
[
j
][
0
])
/
Vl
(
m_mesh
.
numberOfFaces
()
-
1
);
//
PTj(j) = pj(j) - kj(j)*(uR[0][0]-uj[j][0])/Vl(m_mesh.numberOfFaces()-1);
//PTj(j) = pj(j) + kj(j)*(t/((50./9.)-t*t));
//
//PTj(j) = pj(j) + kj(j)*(t/((50./9.)-t*t));
//PTj(j) = pj(j) - kj(j)*(-ur[cell_nodes(j,0)][0])/Vj(j);
//
//PTj(j) = pj(j) - kj(j)*(-ur[cell_nodes(j,0)][0])/Vj(j);
}
else
{
//
} else {
double
sum
=
0
;
double
sum
=
0
;
for
(
int
k
=
0
;
k
<
cell_nb_nodes
(
j
);
++
k
)
{
for
(
int
k
=
0
;
k
<
cell_nb_nodes
(
j
);
++
k
)
{
int
node_here
=
cell_nodes
(
j
,
k
);
int
node_here
=
cell_nodes
(
j
,
k
);
sum
+=
(
ur
(
node_here
),
Cjr
(
j
,
k
));
sum
+=
(
ur
(
node_here
),
Cjr
(
j
,
k
));
}
}
PTj
(
j
)
=
pj
(
j
)
-
kj
(
j
)
*
sum
/
Vj
(
j
);
PTj
(
j
)
=
pj
(
j
)
-
kj
(
j
)
*
sum
/
Vj
(
j
);
//std::cout << PTj(j) << std::endl;
// }
//PTj(j) = pj(j) - kj(j)*(ur[cell_nodes(j,0)][0]-ur[cell_nodes(j,1)][0])/Vj(j);
}
});
});
// jespere que ca copie, ca...
for
(
int
inode
=
0
;
inode
<
m_mesh
.
numberOfNodes
();
++
inode
){
m_ur0
[
inode
][
0
]
=
m_ur
[
inode
][
0
];
}
// m_ur0=m_ur;
// Kokkos::parallel_for(m_mesh.numberOfCells(), KOKKOS_LAMBDA(const int& j) {
// });
// Calcule les flux
// Calcule les flux
computeExplicitFluxes
(
xr
,
xj
,
rhoj
,
kj
,
uj
,
PTj
,
cj
,
Vj
,
Cjr
,
t
);
computeExplicitFluxes
(
xr
,
xj
,
rhoj
,
kj
,
uj
,
PTj
,
cj
,
Vj
,
Cjr
,
t
);
for
(
int
inode
=
0
;
inode
<
m_mesh
.
numberOfNodes
();
++
inode
){
m_ur
[
inode
][
0
]
=
0.7
*
m_ur
[
inode
][
0
]
+
0.3
*
m_ur0
[
inode
][
0
];
}
double
sum
=
0.
;
for
(
int
inode
=
0
;
inode
<
m_mesh
.
numberOfNodes
();
++
inode
){
sum
+=
std
::
abs
(
m_ur0
[
inode
][
0
]
-
m_ur
[
inode
][
0
]);
}
sum
/=
double
(
m_mesh
.
numberOfNodes
());
std
::
cout
<<
" it "
<<
itconv
<<
" sum "
<<
sum
<<
std
::
endl
;
if
(
sum
<
1.e-6
)
break
;
}
// Mise a jour de la vitesse et de l'energie totale specifique
// Mise a jour de la vitesse et de l'energie totale specifique
const
Kokkos
::
View
<
const
double
*>
inv_mj
=
unknowns
.
invMj
();
const
Kokkos
::
View
<
const
double
*>
inv_mj
=
unknowns
.
invMj
();
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
)
{
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
)
{
...
@@ -468,7 +487,7 @@ public:
...
@@ -468,7 +487,7 @@ public:
}
}
// gnuplot output for vitesse riemann
// gnuplot output for vitesse riemann
std
::
ofstream
fout1
(
"ur"
);
std
::
ofstream
fout1
(
"ur
202
"
);
fout1
.
precision
(
15
);
fout1
.
precision
(
15
);
for
(
size_t
j
=
0
;
j
<
m_mesh
.
numberOfNodes
();
++
j
)
{
for
(
size_t
j
=
0
;
j
<
m_mesh
.
numberOfNodes
();
++
j
)
{
fout1
<<
xr
[
j
][
0
]
<<
' '
<<
ur
[
j
][
0
]
<<
'\n'
;
fout1
<<
xr
[
j
][
0
]
<<
' '
<<
ur
[
j
][
0
]
<<
'\n'
;
...
@@ -481,6 +500,18 @@ public:
...
@@ -481,6 +500,18 @@ public:
});
});
*/
*/
// stocke la vitesse pour la prochaine iteration
// Kokkos::parallel_for(m_mesh.numberOfNodes(), KOKKOS_LAMBDA(const int& r){
// ur0[r][0] = ur[r][0];
// });
/*
// gnuplot output for vitesse riemann
std::ofstream fout1("ur0");
fou.precision(15);
for (size_t j=0; j<m_mesh.numberOfNodes(); ++j) {
fou << xr[j][0] << ' ' << ur0[j][0] << '\n';
}
*/
}
}
};
};
...
...
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