SPH
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
m
o
p
q
r
s
t
v
y
Functions
a
c
e
f
g
i
k
m
o
p
q
r
s
t
v
Variables
Typedefs
Enumerations
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
h
i
p
r
s
t
v
Enumerations
Enumerator
Related Functions
a
b
c
d
g
i
j
l
m
n
o
p
s
t
v
w
Files
File List
File Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
b
c
d
e
f
g
h
i
l
m
n
p
r
s
u
v
Typedefs
a
b
c
d
e
f
g
h
m
n
o
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
y
Enumerator
Macros
b
c
d
i
m
n
p
s
t
u
v
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
src
cli
problems
wave
SoundWave.cpp
Go to the documentation of this file.
1
#include "catch.hpp"
2
#include "
objects/geometry/Domain.h
"
3
#include "
io/Logger.h
"
4
#include "
io/Output.h
"
5
#include "
run/IRun.h
"
6
#include "
sph/initial/Initial.h
"
7
#include "
system/Factory.h
"
8
#include "
system/Settings.h
"
9
#include "
timestepping/TimeStepping.h
"
10
11
using namespace
Sph
;
12
13
/*
14
TEST_CASE("StressForce Soundwave", "[stressforce]") {
15
RunSettings settings;
16
settings.set(RunSettingsId::DOMAIN_BOUNDARY, BoundaryEnum::GHOST_PARTICLES);
17
18
settings.set(RunSettingsId::DOMAIN_TYPE, DomainEnum::CYLINDER);
19
settings.set(RunSettingsId::DOMAIN_HEIGHT, 20._f);
20
settings.set(RunSettingsId::DOMAIN_RADIUS, 0.5_f);
21
settings.set(RunSettingsId::SPH_FINDER, FinderEnum::VOXEL);
22
settings.set(RunSettingsId::MODEL_FORCE_DIV_S, false);
23
settings.set(RunSettingsId::TIMESTEPPING_INITIAL_TIMESTEP, 1.e-6_f);
24
settings.set(RunSettingsId::TIMESTEPPING_MAX_TIMESTEP, 1.e-4_f);
25
Problem p(settings, makeShared<Storage>());
26
InitialConditions conds(p.storage, settings);
27
28
BodySettings bodySettings;
29
bodySettings.set(BodySettingsId::PARTICLE_COUNT, 10000);
30
bodySettings.set(BodySettingsId::DENSITY, 1000._f);
31
bodySettings.set(BodySettingsId::DENSITY_MIN, 1._f);
32
bodySettings.set(BodySettingsId::DENSITY_RANGE, Range(10._f, INFTY));
33
const Float u0 = 1.e4_f;
34
bodySettings.set(BodySettingsId::ENERGY, u0);
35
bodySettings.set(BodySettingsId::ENERGY_RANGE, Range(10._f, INFTY));
36
bodySettings.set(BodySettingsId::ENERGY_MIN, 1._f);
37
// conds.addBody(BlockDomain(Vector(0._f), Vector(1._f, 1._f, 20._f)), bodySettings);
38
conds.addBody(CylindricalDomain(Vector(0._f), 0.5_f, 20._f, true), bodySettings);
39
p.output =
40
makeAuto<GnuplotOutput>("out_%d.txt", "wave", "wave.plt", GnuplotOutput::Options::SCIENTIFIC);
41
42
StdOutLogger logger;
43
44
const Float gamma = bodySettings.get<Float>(BodySettingsId::ADIABATIC_INDEX);
45
const Float cs = Sph::sqrt(gamma * (gamma - 1._f) * u0);
46
logger.write("Sound speed = ", cs);
47
// find equilibrium state - in 0.1s, soundwave should propagate at least 5 times across the cylinder
48
p.run();
49
}
50
*/
Domain.h
Object defining computational domain.
IRun.h
Basic interface defining a single run.
Initial.h
Generating initial conditions of SPH particles.
Logger.h
Logging routines of the run.
Output.h
Saving and loading particle data.
TimeStepping.h
Algorithms for temporal evolution of the physical model.
Factory.h
Creating code components based on values from settings.
Settings.h
Generic storage and input/output routines of settings.
Sph
Definition:
MemoryPool.h:5
Generated by
1.9.1