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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWIFT
SWIFTsim
Commits
471cf039
Commit
471cf039
authored
8 months ago
by
Orestis Karapiperis
Browse files
Options
Downloads
Patches
Plain Diff
Von Neumann & Richtmyer like term in viscosity
parent
67805481
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/hydro/SPHENIX/hydro_iact.h
+5
-6
5 additions, 6 deletions
src/hydro/SPHENIX/hydro_iact.h
src/signal_velocity_VNR.h
+93
-0
93 additions, 0 deletions
src/signal_velocity_VNR.h
with
98 additions
and
6 deletions
src/hydro/SPHENIX/hydro_iact.h
+
5
−
6
View file @
471cf039
...
@@ -32,6 +32,7 @@
...
@@ -32,6 +32,7 @@
#include
"hydro_parameters.h"
#include
"hydro_parameters.h"
#include
"minmax.h"
#include
"minmax.h"
#include
"signal_velocity.h"
#include
"signal_velocity.h"
#include
"signal_velocity_VNR.h"
/**
/**
* @brief Density interaction between two particles.
* @brief Density interaction between two particles.
...
@@ -417,7 +418,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
...
@@ -417,7 +418,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
/* Compute sound speeds and signal velocity */
/* Compute sound speeds and signal velocity */
const
float
v_sig
=
const
float
v_sig
=
signal_velocity
(
dx
,
pi
,
pj
,
mu_ij
,
const_viscosity_beta
);
signal_velocity
_VNR
(
dx
,
pi
,
pj
,
mu_ij
,
const_viscosity_beta
);
/* Variable smoothing length term */
/* Variable smoothing length term */
const
float
f_ij
=
1
.
f
-
pi
->
force
.
f
/
mj
;
const
float
f_ij
=
1
.
f
-
pi
->
force
.
f
/
mj
;
...
@@ -429,9 +430,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
...
@@ -429,9 +430,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_force(
/* Construct the full viscosity term */
/* Construct the full viscosity term */
const
float
rho_ij
=
rhoi
+
rhoj
;
const
float
rho_ij
=
rhoi
+
rhoj
;
const
float
alpha
=
pi
->
viscosity
.
alpha
+
pj
->
viscosity
.
alpha
;
const
float
visc
=
const
float
visc
=
-
0
.
2
5
f
*
alpha
*
v_sig
*
mu_ij
*
(
balsara_i
+
balsara_j
)
/
rho_ij
;
-
0
.
5
f
*
v_sig
*
mu_ij
*
(
balsara_i
+
balsara_j
)
/
rho_ij
;
/* Convolve with the kernel */
/* Convolve with the kernel */
const
float
visc_acc_term
=
const
float
visc_acc_term
=
...
@@ -569,7 +569,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
...
@@ -569,7 +569,7 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
/* Compute sound speeds and signal velocity */
/* Compute sound speeds and signal velocity */
const
float
v_sig
=
const
float
v_sig
=
signal_velocity
(
dx
,
pi
,
pj
,
mu_ij
,
const_viscosity_beta
);
signal_velocity
_VNR
(
dx
,
pi
,
pj
,
mu_ij
,
const_viscosity_beta
);
/* Variable smoothing length term */
/* Variable smoothing length term */
const
float
f_ij
=
1
.
f
-
pi
->
force
.
f
/
mj
;
const
float
f_ij
=
1
.
f
-
pi
->
force
.
f
/
mj
;
...
@@ -581,9 +581,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
...
@@ -581,9 +581,8 @@ __attribute__((always_inline)) INLINE static void runner_iact_nonsym_force(
/* Construct the full viscosity term */
/* Construct the full viscosity term */
const
float
rho_ij
=
rhoi
+
rhoj
;
const
float
rho_ij
=
rhoi
+
rhoj
;
const
float
alpha
=
pi
->
viscosity
.
alpha
+
pj
->
viscosity
.
alpha
;
const
float
visc
=
const
float
visc
=
-
0
.
2
5
f
*
alpha
*
v_sig
*
mu_ij
*
(
balsara_i
+
balsara_j
)
/
rho_ij
;
-
0
.
5
f
*
v_sig
*
mu_ij
*
(
balsara_i
+
balsara_j
)
/
rho_ij
;
/* Convolve with the kernel */
/* Convolve with the kernel */
const
float
visc_acc_term
=
const
float
visc_acc_term
=
...
...
This diff is collapsed.
Click to expand it.
src/signal_velocity_VNR.h
0 → 100644
+
93
−
0
View file @
471cf039
/*******************************************************************************
* This file is part of SWIFT.
* Coypright (c) 2022 Matthieu Schaller (schaller@strw.leidenuniv.nl)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
******************************************************************************/
#ifndef SWIFT_SIGNAL_VELOCITY_VNR_H
#define SWIFT_SIGNAL_VELOCITY_VNR_H
/* Config parameters. */
#include
<config.h>
#ifndef NONE_MHD
/* Include MHD definition of signal velocity */
#include
"mhd.h"
/**
* @brief Compute the signal velocity between two gas particles,
* MHD case.
*
* Warning ONLY to be called just after preparation of the force loop.
*
* @param dx Comoving vector separating both particles (pi - pj).
* @brief pi The first #part.
* @brief pj The second #part.
* @brief mu_ij The velocity on the axis linking the particles, or zero if the
* particles are moving away from each other,
* @brief beta The non-linear viscosity constant.
*/
__attribute__
((
always_inline
))
INLINE
static
float
signal_velocity_VNR
(
const
float
dx
[
3
],
const
struct
part
*
restrict
pi
,
const
struct
part
*
restrict
pj
,
const
float
mu_ij
,
const
float
beta
)
{
const
float
alpha
=
0
.
5
f
*
(
pi
->
viscosity
.
alpha
+
pj
->
viscosity
.
alpha
);
const
float
v_sigi
=
pi
->
mhd_data
.
c_fms
;
const
float
v_sigj
=
pj
->
mhd_data
.
c_fms
;
const
float
v_sig
=
alpha
*
(
v_sigi
+
v_sigj
)
-
beta
*
mu_ij
;
return
v_sig
;
}
#else
/* Include hydro definition of signal velocity */
#include
"hydro.h"
/**
* @brief Compute the signal velocity between two gas particles,
* Non-MHD case.
*
* Warning: Can ONLY to be called just after preparation of the force loop.
*
* @param dx Comoving vector separating both particles (pi - pj).
* @brief pi The first #part.
* @brief pj The second #part.
* @brief mu_ij The velocity on the axis linking the particles, or zero if the
* particles are moving away from each other,
* @brief beta The non-linear viscosity constant.
*/
__attribute__
((
always_inline
))
INLINE
static
float
signal_velocity_VNR
(
const
float
dx
[
3
],
const
struct
part
*
restrict
pi
,
const
struct
part
*
restrict
pj
,
const
float
mu_ij
,
const
float
beta
)
{
const
float
alpha
=
0
.
5
f
*
(
pi
->
viscosity
.
alpha
+
pj
->
viscosity
.
alpha
);
const
float
v_sigi
=
pi
->
force
.
soundspeed
;
const
float
v_sigj
=
pj
->
force
.
soundspeed
;
const
float
v_sig
=
alpha
*
(
v_sigi
+
v_sigj
)
-
beta
*
mu_ij
;
return
v_sig
;
}
#endif
#endif
/* SWIFT_SIGNAL_VELOCITY_VNR_H */
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