SPH
SoundWave.cpp
Go to the documentation of this file.
1 #include "catch.hpp"
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"
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 */
Object defining computational domain.
Basic interface defining a single run.
Generating initial conditions of SPH particles.
Logging routines of the run.
Saving and loading particle data.
Algorithms for temporal evolution of the physical model.
Creating code components based on values from settings.
Generic storage and input/output routines of settings.
Definition: MemoryPool.h:5