Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
465c48b9
Commit
465c48b9
authored
6 months ago
by
Orestis Karapiperis
Committed by
Matthieu Schaller
6 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Variable h in physical resistivity
parent
80e8d0ae
Branches
Branches containing commit
No related tags found
4 merge requests
!2180
Mhd canvas into MHD_FS
,
!2119
Mhd canvas
,
!2105
Variable h in physical resistivity
,
!1530
SPMHD implementations on top of SPHENIX and SPMHD examples
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/mhd/DirectInduction/mhd_iact.h
+26
-18
26 additions, 18 deletions
src/mhd/DirectInduction/mhd_iact.h
with
26 additions
and
18 deletions
src/mhd/DirectInduction/mhd_iact.h
+
26
−
18
View file @
465c48b9
...
@@ -479,16 +479,19 @@ __attribute__((always_inline)) INLINE static void runner_iact_mhd_force(
...
@@ -479,16 +479,19 @@ __attribute__((always_inline)) INLINE static void runner_iact_mhd_force(
/* Physical resistivity */
/* Physical resistivity */
const
float
resistive_eta_i
=
pi
->
mhd_data
.
resistive_eta
;
const
float
resistive_eta_i
=
pi
->
mhd_data
.
resistive_eta
;
const
float
resistive_eta_j
=
pj
->
mhd_data
.
resistive_eta
;
const
float
resistive_eta_j
=
pj
->
mhd_data
.
resistive_eta
;
const
float
dB_dt_pref_PR_i
=
2
.
0
f
*
resistive_eta_i
*
r_inv
/
(
rhoi
*
rhoj
);
const
float
dB_dt_pref_PR_j
=
2
.
0
f
*
resistive_eta_j
*
r_inv
/
(
rhoi
*
rhoj
);
pi
->
mhd_data
.
B_over_rho_dt
[
0
]
+=
mj
*
dB_dt_pref_PR_i
*
wi_dr
*
dB
[
0
];
const
float
rho_term_PR
=
1
.
0
f
/
(
rhoi
*
rhoj
);
pi
->
mhd_data
.
B_over_rho_dt
[
1
]
+=
mj
*
dB_dt_pref_PR_i
*
wi_dr
*
dB
[
1
];
const
float
grad_term_PR
=
f_ij
*
wi_dr
+
f_ji
*
wj_dr
;
pi
->
mhd_data
.
B_over_rho_dt
[
2
]
+=
mj
*
dB_dt_pref_PR_i
*
wi_dr
*
dB
[
2
];
pj
->
mhd_data
.
B_over_rho_dt
[
0
]
-=
mi
*
dB_dt_pref_PR_j
*
wj_dr
*
dB
[
0
];
const
float
dB_dt_pref_PR
=
rho_term_PR
*
grad_term_PR
*
r_inv
;
pj
->
mhd_data
.
B_over_rho_dt
[
1
]
-=
mi
*
dB_dt_pref_PR_j
*
wj_dr
*
dB
[
1
];
pj
->
mhd_data
.
B_over_rho_dt
[
2
]
-=
mi
*
dB_dt_pref_PR_j
*
wj_dr
*
dB
[
2
];
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
pi
->
mhd_data
.
B_over_rho_dt
[
k
]
+=
resistive_eta_i
*
mj
*
dB_dt_pref_PR
*
dB
[
k
];
pj
->
mhd_data
.
B_over_rho_dt
[
k
]
-=
resistive_eta_j
*
mi
*
dB_dt_pref_PR
*
dB
[
k
];
}
pi
->
u_dt
-=
0
.
5
f
*
permeability_inv
*
resistive_eta_i
*
mj
*
dB_dt_pref_PR
*
dB_2
;
pj
->
u_dt
-=
0
.
5
f
*
permeability_inv
*
resistive_eta_j
*
mi
*
dB_dt_pref_PR
*
dB_2
;
/* Artificial resistivity */
/* Artificial resistivity */
const
float
art_diff_beta_i
=
pi
->
mhd_data
.
art_diff_beta
;
const
float
art_diff_beta_i
=
pi
->
mhd_data
.
art_diff_beta
;
...
@@ -560,8 +563,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_mhd_force(
...
@@ -560,8 +563,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_mhd_force(
pj
->
mhd_data
.
Adv_B_source
[
i
]
+=
mi
*
dB_dt_pref_j
*
dB_dt_j
[
i
];
pj
->
mhd_data
.
Adv_B_source
[
i
]
+=
mi
*
dB_dt_pref_j
*
dB_dt_j
[
i
];
pi
->
mhd_data
.
Adv_B_source
[
i
]
-=
mj
*
grad_psi_i
*
dx
[
i
];
pi
->
mhd_data
.
Adv_B_source
[
i
]
-=
mj
*
grad_psi_i
*
dx
[
i
];
pj
->
mhd_data
.
Adv_B_source
[
i
]
-=
mi
*
grad_psi_j
*
dx
[
i
];
pj
->
mhd_data
.
Adv_B_source
[
i
]
-=
mi
*
grad_psi_j
*
dx
[
i
];
pi
->
mhd_data
.
Diff_B_source
[
i
]
+=
mj
*
dB_dt_pref_PR
_i
*
wi_dr
*
dB
[
i
];
pi
->
mhd_data
.
Diff_B_source
[
i
]
+=
resistive_eta_i
*
mj
*
dB_dt_pref_PR
*
dB
[
i
];
pj
->
mhd_data
.
Diff_B_source
[
i
]
-=
mi
*
dB_dt_pref_PR
_j
*
wj_dr
*
dB
[
i
];
pj
->
mhd_data
.
Diff_B_source
[
i
]
-=
resistive_eta_j
*
mi
*
dB_dt_pref_PR
*
dB
[
i
];
pi
->
mhd_data
.
Diff_B_source
[
i
]
+=
mj
*
art_diff_pref_i
*
dB
[
i
];
pi
->
mhd_data
.
Diff_B_source
[
i
]
+=
mj
*
art_diff_pref_i
*
dB
[
i
];
pj
->
mhd_data
.
Diff_B_source
[
i
]
-=
mi
*
art_diff_pref_j
*
dB
[
i
];
pj
->
mhd_data
.
Diff_B_source
[
i
]
-=
mi
*
art_diff_pref_j
*
dB
[
i
];
pi
->
mhd_data
.
Delta_B
[
i
]
+=
mj
*
dB_dt_pref_Lap_i
*
wi_dr
*
dB
[
i
];
pi
->
mhd_data
.
Delta_B
[
i
]
+=
mj
*
dB_dt_pref_Lap_i
*
wi_dr
*
dB
[
i
];
...
@@ -757,13 +760,18 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_mhd_force(
...
@@ -757,13 +760,18 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_mhd_force(
pi
->
mhd_data
.
B_over_rho_dt
[
2
]
+=
mj
*
dB_dt_pref_i
*
dB_dt_i
[
2
];
pi
->
mhd_data
.
B_over_rho_dt
[
2
]
+=
mj
*
dB_dt_pref_i
*
dB_dt_i
[
2
];
/* Physical resistivity */
/* Physical resistivity */
const
float
resistive_eta
=
pi
->
mhd_data
.
resistive_eta
;
const
float
resistive_eta
_i
=
pi
->
mhd_data
.
resistive_eta
;
const
float
dB_dt_pref_PR
=
2
.
0
f
*
resistive_eta
*
r_inv
/
(
rhoi
*
rhoj
);
const
float
rho_term_PR
=
1
.
0
f
/
(
rhoi
*
rhoj
);
const
float
grad_term_PR
=
f_ij
*
wi_dr
+
f_ji
*
wj_dr
;
const
float
dB_dt_pref_PR
=
rho_term_PR
*
grad_term_PR
*
r_inv
;
for
(
int
k
=
0
;
k
<
3
;
k
++
)
{
pi
->
mhd_data
.
B_over_rho_dt
[
k
]
+=
resistive_eta_i
*
mj
*
dB_dt_pref_PR
*
dB
[
k
];
}
pi
->
mhd_data
.
B_over_rho_dt
[
0
]
+=
mj
*
dB_dt_pref_PR
*
wi_dr
*
dB
[
0
];
pi
->
u_dt
-=
0
.
5
f
*
permeability_inv
*
resistive_eta_i
*
mj
*
dB_dt_pref_PR
*
dB_2
;
pi
->
mhd_data
.
B_over_rho_dt
[
1
]
+=
mj
*
dB_dt_pref_PR
*
wi_dr
*
dB
[
1
];
pi
->
mhd_data
.
B_over_rho_dt
[
2
]
+=
mj
*
dB_dt_pref_PR
*
wi_dr
*
dB
[
2
];
/* Artificial resistivity */
/* Artificial resistivity */
const
float
art_diff_beta
=
pi
->
mhd_data
.
art_diff_beta
;
const
float
art_diff_beta
=
pi
->
mhd_data
.
art_diff_beta
;
...
@@ -813,7 +821,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_mhd_force(
...
@@ -813,7 +821,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_mhd_force(
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
i
=
0
;
i
<
3
;
i
++
)
{
pi
->
mhd_data
.
Adv_B_source
[
i
]
+=
mj
*
dB_dt_pref_i
*
dB_dt_i
[
i
];
pi
->
mhd_data
.
Adv_B_source
[
i
]
+=
mj
*
dB_dt_pref_i
*
dB_dt_i
[
i
];
pi
->
mhd_data
.
Adv_B_source
[
i
]
-=
mj
*
grad_psi_i
*
dx
[
i
];
pi
->
mhd_data
.
Adv_B_source
[
i
]
-=
mj
*
grad_psi_i
*
dx
[
i
];
pi
->
mhd_data
.
Diff_B_source
[
i
]
+=
mj
*
dB_dt_pref_PR
*
wi_dr
*
dB
[
i
];
pi
->
mhd_data
.
Diff_B_source
[
i
]
+=
resistive_eta_i
*
mj
*
dB_dt_pref_PR
*
dB
[
i
];
pi
->
mhd_data
.
Diff_B_source
[
i
]
+=
mj
*
art_diff_pref
*
dB
[
i
];
pi
->
mhd_data
.
Diff_B_source
[
i
]
+=
mj
*
art_diff_pref
*
dB
[
i
];
pi
->
mhd_data
.
Delta_B
[
i
]
+=
mj
*
dB_dt_pref_Lap
*
wi_dr
*
dB
[
i
];
pi
->
mhd_data
.
Delta_B
[
i
]
+=
mj
*
dB_dt_pref_Lap
*
wi_dr
*
dB
[
i
];
}
}
...
...
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