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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
code
pugs
Commits
ddc586e5
Commit
ddc586e5
authored
Aug 3, 2018
by
Fanny CHOPOT
Browse files
Options
Downloads
Patches
Plain Diff
ajout rho pour splot
parent
7143feb8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main.cpp
+15
-13
15 additions, 13 deletions
src/main.cpp
src/mesh/Mesh.hpp
+4
-4
4 additions, 4 deletions
src/mesh/Mesh.hpp
src/scheme/FiniteVolumesEulerUnknowns.hpp
+12
-12
12 additions, 12 deletions
src/scheme/FiniteVolumesEulerUnknowns.hpp
with
31 additions
and
29 deletions
src/main.cpp
+
15
−
13
View file @
ddc586e5
...
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
...
@@ -142,7 +142,7 @@ int main(int argc, char *argv[])
const
Kokkos
::
View
<
const
double
*>
Vj
=
mesh_data
.
Vj
();
const
Kokkos
::
View
<
const
double
*>
Vj
=
mesh_data
.
Vj
();
const
Kokkos
::
View
<
const
Rd
**>
Cjr
=
mesh_data
.
Cjr
();
const
Kokkos
::
View
<
const
Rd
**>
Cjr
=
mesh_data
.
Cjr
();
const
double
tmax
=
0.
2
;
const
double
tmax
=
0.
8
;
double
t
=
0.
;
double
t
=
0.
;
int
itermax
=
std
::
numeric_limits
<
int
>::
max
();
int
itermax
=
std
::
numeric_limits
<
int
>::
max
();
...
@@ -169,6 +169,7 @@ int main(int argc, char *argv[])
...
@@ -169,6 +169,7 @@ int main(int argc, char *argv[])
const
Kokkos
::
View
<
const
Rd
*>
xj
=
mesh_data
.
xj
();
const
Kokkos
::
View
<
const
Rd
*>
xj
=
mesh_data
.
xj
();
int
size
=
3000
;
int
size
=
3000
;
std
::
vector
<
std
::
vector
<
double
>>
x
(
size
,
std
::
vector
<
double
>
(
mesh
.
numberOfCells
()));
std
::
vector
<
std
::
vector
<
double
>>
x
(
size
,
std
::
vector
<
double
>
(
mesh
.
numberOfCells
()));
std
::
vector
<
std
::
vector
<
double
>>
rho_marche
(
size
,
std
::
vector
<
double
>
(
mesh
.
numberOfCells
()));
std
::
vector
<
double
>
tempo
(
size
);
std
::
vector
<
double
>
tempo
(
size
);
int
i
=
0
;
int
i
=
0
;
...
@@ -274,7 +275,7 @@ int main(int argc, char *argv[])
...
@@ -274,7 +275,7 @@ int main(int argc, char *argv[])
while
((
t
<
tmax
)
and
(
iteration
<
itermax
))
{
while
((
t
<
tmax
)
and
(
iteration
<
itermax
))
{
/*
// ETAPE 1 DU SPLITTING - EULER
// ETAPE 1 DU SPLITTING - EULER
double
dt_euler
=
0.9
*
acoustic_solver
.
acoustic_dt
(
Vj
,
cj
);
double
dt_euler
=
0.9
*
acoustic_solver
.
acoustic_dt
(
Vj
,
cj
);
...
@@ -287,7 +288,7 @@ int main(int argc, char *argv[])
...
@@ -287,7 +288,7 @@ int main(int argc, char *argv[])
// ETAPE 2 DU SPLITTING - DIFFUSION
// ETAPE 2 DU SPLITTING - DIFFUSION
double dt_diff = 0.9*finite_volumes_diffusion.diffusion_dt(rhoj, kj,nuj, cj);
double
dt_diff
=
0.9
*
finite_volumes_diffusion
.
diffusion_dt
(
rhoj
,
kj
,
nuj
,
cj
,
nuL
,
nuR
,
kL
,
kR
);
double
t_diff
=
t
-
dt_euler
;
double
t_diff
=
t
-
dt_euler
;
if
(
dt_euler
<=
dt_diff
)
{
if
(
dt_euler
<=
dt_diff
)
{
...
@@ -295,7 +296,7 @@ int main(int argc, char *argv[])
...
@@ -295,7 +296,7 @@ int main(int argc, char *argv[])
finite_volumes_diffusion
.
computeNextStep
(
t_diff
,
dt_diff
,
unknowns
);
finite_volumes_diffusion
.
computeNextStep
(
t_diff
,
dt_diff
,
unknowns
);
}
else
{
}
else
{
while
(
t
>
t_diff
)
{
while
(
t
>
t_diff
)
{
dt_diff = 0.9*finite_volumes_diffusion.diffusion_dt(rhoj, kj, nuj,cj);
dt_diff
=
0.9
*
finite_volumes_diffusion
.
diffusion_dt
(
rhoj
,
kj
,
nuj
,
cj
,
nuL
,
nuR
,
kL
,
kR
);
if
(
t_diff
+
dt_diff
>
t
)
{
if
(
t_diff
+
dt_diff
>
t
)
{
dt_diff
=
t
-
t_diff
;
dt_diff
=
t
-
t_diff
;
}
}
...
@@ -303,9 +304,9 @@ int main(int argc, char *argv[])
...
@@ -303,9 +304,9 @@ int main(int argc, char *argv[])
t_diff
+=
dt_diff
;
t_diff
+=
dt_diff
;
}
}
}
}
*/
/*
// DIFFUSION PURE
// DIFFUSION PURE
double dt = 0.9*finite_volumes_diffusion.diffusion_dt(rhoj,kj,nuj,cj,nuL,nuR,kL,kR);
double dt = 0.9*finite_volumes_diffusion.diffusion_dt(rhoj,kj,nuj,cj,nuL,nuR,kL,kR);
...
@@ -314,7 +315,7 @@ int main(int argc, char *argv[])
...
@@ -314,7 +315,7 @@ int main(int argc, char *argv[])
}
}
finite_volumes_diffusion.computeNextStep(t, dt, unknowns);
finite_volumes_diffusion.computeNextStep(t, dt, unknowns);
t += dt;
t += dt;
*/
block_eos
.
updatePandCFromRhoE
();
block_eos
.
updatePandCFromRhoE
();
...
@@ -545,14 +546,15 @@ int main(int argc, char *argv[])
...
@@ -545,14 +546,15 @@ int main(int argc, char *argv[])
// ENTROPY TEST
// ENTROPY TEST
//finite_volumes_diffusion.entropie(unknowns);
//finite_volumes_diffusion.entropie(unknowns);
/*
// STOCKAGE COORDONNES ET TEMPS
// STOCKAGE COORDONNES ET TEMPS
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOfCells
();
++
j
)
{
for
(
size_t
j
=
0
;
j
<
mesh
.
numberOfCells
();
++
j
)
{
x
[
i
][
j
]
=
xj
[
j
][
0
];
x
[
i
][
j
]
=
xj
[
j
][
0
];
rho_marche
[
i
][
j
]
=
rhoj
[
j
];
}
}
tempo
[
i
]
=
t
;
tempo
[
i
]
=
t
;
i
=
i
+
1
;
i
=
i
+
1
;
*/
}
}
...
@@ -572,21 +574,21 @@ int main(int argc, char *argv[])
...
@@ -572,21 +574,21 @@ int main(int argc, char *argv[])
fout << ' ' << '\n';
fout << ' ' << '\n';
}
}
*/
*/
/*
std::ofstream fout("cara
1
");
std
::
ofstream
fout
(
"cara
rho
"
);
fout
.
precision
(
15
);
fout
.
precision
(
15
);
for
(
int
j
=
0
;
j
<
mesh
.
numberOfCells
();
++
j
)
{
for
(
int
j
=
0
;
j
<
mesh
.
numberOfCells
();
++
j
)
{
if
(
j
%
10
==
0
)
{
if
(
j
%
10
==
0
)
{
for
(
int
k
=
0
;
k
<
i
;
++
k
)
{
for
(
int
k
=
0
;
k
<
i
;
++
k
)
{
if
(
(
k
%
10
==
0
)
or
(
k
==
i
-
1
)
)
{
if
(
(
k
%
10
==
0
)
or
(
k
==
i
-
1
)
)
{
fout << tempo[k] << ' ' << x[k][j] << '\n';
fout
<<
tempo
[
k
]
<<
' '
<<
x
[
k
][
j
]
<<
' '
<<
rho_marche
[
k
][
j
]
<<
'\n'
;
}
}
}
}
fout
<<
' '
<<
'\n'
;
fout
<<
' '
<<
'\n'
;
fout
<<
' '
<<
'\n'
;
fout
<<
' '
<<
'\n'
;
}
}
}
}
*/
/*
/*
double error1 = 0.;
double error1 = 0.;
...
...
This diff is collapsed.
Click to expand it.
src/mesh/Mesh.hpp
+
4
−
4
View file @
ddc586e5
...
@@ -76,7 +76,7 @@ public:
...
@@ -76,7 +76,7 @@ public:
// pas constant
// pas constant
/*
Mesh
(
const
Connectivity
&
connectivity
)
Mesh
(
const
Connectivity
&
connectivity
)
:
m_connectivity
(
connectivity
),
:
m_connectivity
(
connectivity
),
m_xr
(
"xr"
,
connectivity
.
numberOfNodes
()),
m_xr
(
"xr"
,
connectivity
.
numberOfNodes
()),
...
@@ -92,7 +92,7 @@ public:
...
@@ -92,7 +92,7 @@ public:
m_xr
[
r
][
0
]
=
a
+
r
*
delta_x
;
m_xr
[
r
][
0
]
=
a
+
r
*
delta_x
;
});
});
}
}
*/
// pas non constant
// pas non constant
...
@@ -128,7 +128,7 @@ public:
...
@@ -128,7 +128,7 @@ public:
// pas aleatoire
// pas aleatoire
/*
Mesh(const Connectivity& connectivity)
Mesh(const Connectivity& connectivity)
: m_connectivity(connectivity),
: m_connectivity(connectivity),
m_xr("xr", connectivity.numberOfNodes()),
m_xr("xr", connectivity.numberOfNodes()),
...
@@ -160,7 +160,7 @@ public:
...
@@ -160,7 +160,7 @@ public:
std::exit(0);
std::exit(0);
}
}
*/
...
...
This diff is collapsed.
Click to expand it.
src/scheme/FiniteVolumesEulerUnknowns.hpp
+
12
−
12
View file @
ddc586e5
...
@@ -276,7 +276,7 @@ public:
...
@@ -276,7 +276,7 @@ public:
}
}
/*
// --- Acoustic Solver ---
// --- Acoustic Solver ---
void
initializeSod
()
void
initializeSod
()
...
@@ -338,7 +338,7 @@ public:
...
@@ -338,7 +338,7 @@ public:
//m_kj[j] = 0.;
//m_kj[j] = 0.;
/*
// Sod
// Sod
// k non regulier
// k non regulier
...
@@ -373,12 +373,12 @@ public:
...
@@ -373,12 +373,12 @@ public:
m_kj[j]=0. ;
m_kj[j]=0. ;
}
}
}
}
*/
// k regulier
// k regulier
int
n
=
1
;
int
n
=
1
;
m_kj
[
j
]
=
std
::
exp
(
1.
)
*
std
::
exp
(
-
1.
/
(
1.
-
(
(
xj
[
j
][
0
]
-
(
0.7
+
0.1
/
n
))
/
(
0.1
/
n
)
)
*
(
(
xj
[
j
][
0
]
-
(
0.7
+
0.1
/
n
))
/
(
0.1
/
n
)
)))
*
(
xj
[
j
][
0
]
>
0.7
)
*
(
xj
[
j
][
0
]
<
0.7
+
0.1
/
n
)
+
std
::
exp
(
1.
)
*
std
::
exp
(
-
1.
/
(
1.
-
(
(
xj
[
j
][
0
]
-
(
0.9
-
0.1
/
n
))
/
(
0.1
/
n
)
)
*
(
(
xj
[
j
][
0
]
-
(
0.9
-
0.1
/
n
))
/
(
0.1
/
n
)
)))
*
(
xj
[
j
][
0
]
>
0.9
-
0.1
/
n
)
*
(
xj
[
j
][
0
]
<
0.9
)
+
(
xj
[
j
][
0
]
>
0.7
+
0.1
/
n
)
*
(
xj
[
j
][
0
]
<
0.9
-
0.1
/
n
);
m_kj
[
j
]
=
std
::
exp
(
1.
)
*
std
::
exp
(
-
1.
/
(
1.
-
(
(
xj
[
j
][
0
]
-
(
0.7
+
0.1
/
n
))
/
(
0.1
/
n
)
)
*
(
(
xj
[
j
][
0
]
-
(
0.7
+
0.1
/
n
))
/
(
0.1
/
n
)
)))
*
(
xj
[
j
][
0
]
>
0.7
)
*
(
xj
[
j
][
0
]
<
0.7
+
0.1
/
n
)
+
std
::
exp
(
1.
)
*
std
::
exp
(
-
1.
/
(
1.
-
(
(
xj
[
j
][
0
]
-
(
0.9
-
0.1
/
n
))
/
(
0.1
/
n
)
)
*
(
(
xj
[
j
][
0
]
-
(
0.9
-
0.1
/
n
))
/
(
0.1
/
n
)
)))
*
(
xj
[
j
][
0
]
>
0.9
-
0.1
/
n
)
*
(
xj
[
j
][
0
]
<
0.9
)
+
(
xj
[
j
][
0
]
>
0.7
+
0.1
/
n
)
*
(
xj
[
j
][
0
]
<
0.9
-
0.1
/
n
);
m_kj[j] = 0.
0
14*m_kj[j];
m_kj
[
j
]
=
0.14
*
m_kj
[
j
];
});
});
...
@@ -397,8 +397,8 @@ public:
...
@@ -397,8 +397,8 @@ public:
});
});
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
){
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
){
//m_nuj(j) = 0.5*(1.+xj[j][0]);
//m_nuj(j) = 0.5*(1.+xj[j][0]);
m_nuj(j) = 0.
0005
;
m_nuj
(
j
)
=
0.
;
/*
if (xj[j][0]<0.7) {
if (xj[j][0]<0.7) {
m_nuj[j]=0.;
m_nuj[j]=0.;
} else {
} else {
...
@@ -408,7 +408,7 @@ public:
...
@@ -408,7 +408,7 @@ public:
m_nuj[j]=0. ;
m_nuj[j]=0. ;
}
}
}
}
*/
});
});
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
){
Kokkos
::
parallel_for
(
m_mesh
.
numberOfCells
(),
KOKKOS_LAMBDA
(
const
int
&
j
){
...
@@ -419,14 +419,14 @@ public:
...
@@ -419,14 +419,14 @@ public:
m_TL
[
0
]
=
m_ej
[
0
];
m_TL
[
0
]
=
m_ej
[
0
];
m_TR
[
0
]
=
m_ej
[
m_mesh
.
numberOfCells
()
-
1
];
m_TR
[
0
]
=
m_ej
[
m_mesh
.
numberOfCells
()
-
1
];
m_nuL[0] = 0.
0005
;
m_nuL
[
0
]
=
0.
;
m_nuR[0] = 0.
0005
;
m_nuR
[
0
]
=
0.
;
}
}
*/
/*
// DIFFUSION PURE
// DIFFUSION PURE
void initializeSod()
void initializeSod()
...
@@ -499,7 +499,7 @@ public:
...
@@ -499,7 +499,7 @@ public:
m_nuR[0] = 0.;
m_nuR[0] = 0.;
}
}
*/
FiniteVolumesEulerUnknowns
(
const
MeshDataType
&
mesh_data
)
FiniteVolumesEulerUnknowns
(
const
MeshDataType
&
mesh_data
)
...
...
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
sign in
to comment