29 const int hydroDimensions = localParticle->getHydroDimensions();
30 const double timeStepSize = localParticle->getSpecies().getMinTimeStepSize();
34 const double dt_kick_hydro = timeStepSize;
35 const double dt_drift = timeStepSize;
36 const double dt_therm = timeStepSize;
41 localParticle->getV() + localParticle->getA() * dt_kick_hydro
48 localParticle->getU() + localParticle->getUDot() *
dt_therm
52 const double h_inv = 1.0 / localParticle->getSmoothingLength();
53 const double w1 = localParticle->getHDot() *
h_inv * dt_drift;
54 localParticle->setSmoothingLength(
55 localParticle->getSmoothingLength() * std::exp(w1)
59 const double w2 = -hydroDimensions * w1;
60 localParticle->setDensity(localParticle->getDensity() * std::exp(w2));
62 localParticle->setU(std::max(localParticle->getU(), 0.0));
65 const double pressure = eos::gas_pressure_from_internal_energy(
66 localParticle->getDensity(),
71 const double soundspeed = eos::gas_soundspeed_from_pressure(
72 localParticle->getDensity(),
76 localParticle->setPressure(
pressure);
78 localParticle->setV_sig_AV(
79 std::max(localParticle->getV_sig_AV(), 2.0 *
soundspeed)
83 localParticle->setSmlIterLeftBound(Particle::getSmlMin());
84 localParticle->setSmlIterRightBound(Particle::getSmlMax());
106 Particle* localParticle
110 localParticle->setV(localParticle->getV_full());
113 localParticle->setU(localParticle->getU_full());
116 const double pressure = eos::gas_pressure_from_internal_energy(
117 localParticle->getDensity(),
118 localParticle->getU()
122 const double soundspeed = eos::gas_soundspeed_from_pressure(
123 localParticle->getDensity(),
128 localParticle->setPressure(
pressure);
130 localParticle->setV_sig_AV(
131 std::max(localParticle->getV_sig_AV(), 2.0 *
soundspeed)
138 Particle* localParticle
142 double dt_kick_therm = 0.5 * localParticle->getSpecies().getMinTimeStepSize();
145 const double delta_u = localParticle->getUDot() *
dt_kick_therm;
148 localParticle->setU_full(std::max(
149 localParticle->getU_full() + delta_u,
150 localParticle->getU_full() * 0.5
155 if (localParticle->getU_full() < 0.0) {
156 localParticle->setU_full(0.0);
157 localParticle->setUDot(0.0);