Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Sten Delos
Gadget4
Commits
1aa9092e
Commit
1aa9092e
authored
Nov 09, 2020
by
Oliver Zier
Browse files
Add new swtich for entropy in ICs
parent
e1df7dda
Changes
5
Hide whitespace changes
Inline
Side-by-side
Template-Config.sh
View file @
1aa9092e
...
...
@@ -109,6 +109,7 @@ DOUBLEPRECISION=1 # if activated and set to 1, use d
#---------------------------------------- Output/Input options
INITIAL_CONDITIONS_CONTAIN_ENTROPY
#OUTPUT_VELOCITY_GRADIENT # output velocity gradients
#OUTPUT_PRESSURE # output gas pressure
#OUTPUT_ENTROPY # output gas entropy
...
...
documentation/04_config-options.md
View file @
1aa9092e
...
...
@@ -598,6 +598,12 @@ formulation. This is only useful if `PRESSURE_ENTROPY_SPH` is used.
-------
**INITIAL_CONDITIONS_CONTAIN_ENTROPY**
The intial conditions file contains entropy instead of the thermal energy.
------
**GAMMA**
= 1.4
Sets the equation of state index in the ideal gas law that is normally
...
...
@@ -871,7 +877,6 @@ you need to increase `NUMBER_OF_MPI_LISTENERS_PER_NODE`.
Output/Input options {#io}
====================
**POWERSPEC_ON_OUTPUT**
Creates a power spectrum measurement for every output time, i.e. for
...
...
src/data/allvars.h
View file @
1aa9092e
...
...
@@ -97,7 +97,6 @@ struct global_data_all_processes : public parameters
double
InitGasU
;
/**< the same, but converted to thermal energy per unit mass */
double
MinEgySpec
;
/**< the minimum allowed temperature expressed as energy per unit mass */
int
FlagICsContainedEntropy
;
/* some force counters */
...
...
src/io/snap_io.cc
View file @
1aa9092e
...
...
@@ -415,11 +415,14 @@ void snap_io::read_ic(const char *fname)
Sp
->
NumPart
+=
add_numpart
;
#endif
All
.
FlagICsContainedEntropy
=
0
;
#ifdef GADGET2_HEADER
if
(
header
.
flag_entropy_instead_u
)
All
.
FlagICsContainedEntropy
=
1
;
#ifndef INITIAL_CONDITIONS_CONTAIN_ENTROPY
if
(
header
.
flag_entropy_instead_u
)
Terminate
(
"Initial condition file contains entropy, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is not set
\n
"
);
#else
if
(
!
header
.
flag_entropy_instead_u
)
Terminate
(
"Initial condition file contains uthermal, but INITIAL_CONDITIONS_CONTAIN_ENTROPY is set
\n
"
);
#endif
#endif
TIMER_STOP
(
CPU_SNAPSHOT
);
...
...
src/main/init.cc
View file @
1aa9092e
...
...
@@ -129,7 +129,6 @@ void sim::init(int RestartSnapNum)
Mem
.
myfree
(
tmp
);
All
.
FlagICsContainedEntropy
=
0
;
int
count
=
0
;
for
(
int
i
=
0
;
i
<
Sp
.
NumPart
;
i
++
)
...
...
@@ -477,15 +476,16 @@ void sim::init(int RestartSnapNum)
* Once the density has been computed, we can convert to entropy.
*/
#ifdef PRESSURE_ENTROPY_SPH
if
(
All
.
FlagICsContainedEntropy
==
0
)
#ifndef INITIAL_CONDITIONS_CONTAIN_ENTROPY
NgbTree
.
setup_entropy_to_invgamma
();
#endif
#endif
double
mass
=
0
;
for
(
int
i
=
0
;
i
<
Sp
.
NumGas
;
i
++
)
{
if
(
All
.
FlagICsContainedEntropy
==
0
)
{
#ifndef INITIAL_CONDITIONS_CONTAIN_ENTROPY
if
(
ThisTask
==
0
&&
i
==
0
)
printf
(
"INIT: Converting u -> entropy
\n
"
);
...
...
@@ -493,8 +493,8 @@ void sim::init(int RestartSnapNum)
Sp
.
SphP
[
i
].
Entropy
=
GAMMA_MINUS1
*
Sp
.
SphP
[
i
].
Entropy
/
pow
(
Sp
.
SphP
[
i
].
Density
*
All
.
cf_a3inv
,
GAMMA_MINUS1
);
#endif
Sp
.
SphP
[
i
].
EntropyPred
=
Sp
.
SphP
[
i
].
Entropy
;
}
#endif
/* The predicted entropy values have been already set for all SPH formulation */
/* so it should be ok computing pressure and csound now */
Sp
.
SphP
[
i
].
set_thermodynamic_variables
();
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment