From e061712ec5c811ae3db62d07bc61a3d7aa9a1fd5 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 3 Dec 2024 23:17:20 -0700 Subject: [PATCH 01/38] merge with the develop branch --- src/CMakeLists.txt | 2 + src/artemis.cpp | 27 ++ src/artemis.hpp | 13 +- src/artemis_driver.cpp | 23 +- src/artemis_driver.hpp | 5 +- src/dust/dust.cpp | 794 +++++++++++++++++++++++++++++++++- src/dust/dust.hpp | 59 +++ src/pgen/pgen.hpp | 6 + src/pgen/problem_modifier.hpp | 2 + 9 files changed, 919 insertions(+), 12 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 238c5ace..6055a757 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -27,6 +27,8 @@ set (SRC_LIST dust/dust.cpp dust/dust.hpp + dust/coagulation/coagulation.cpp + dust/coagulation/coagulation.hpp gas/gas.cpp gas/gas.hpp diff --git a/src/artemis.cpp b/src/artemis.cpp index f99db52f..63f72972 100644 --- a/src/artemis.cpp +++ b/src/artemis.cpp @@ -15,6 +15,7 @@ #include "artemis.hpp" #include "artemis_driver.hpp" #include "drag/drag.hpp" +#include "dust/coagulation/coagulation.hpp" #include "dust/dust.hpp" #include "gas/cooling/cooling.hpp" #include "gas/gas.hpp" @@ -30,6 +31,8 @@ namespace artemis { +std::vector OperatorSplitTasks; + //---------------------------------------------------------------------------------------- //! \fn Packages_t Artemis::ProcessPackages //! \brief Process and initialize relevant packages @@ -63,6 +66,7 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { const bool do_viscosity = pin->GetOrAddBoolean("physics", "viscosity", false); const bool do_conduction = pin->GetOrAddBoolean("physics", "conduction", false); const bool do_radiation = pin->GetOrAddBoolean("physics", "radiation", false); + const bool do_coagulation = pin->GetOrAddBoolean("physics", "coagulation", false); artemis->AddParam("do_gas", do_gas); artemis->AddParam("do_dust", do_dust); artemis->AddParam("do_gravity", do_gravity); @@ -74,6 +78,7 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { artemis->AddParam("do_conduction", do_conduction); artemis->AddParam("do_diffusion", do_conduction || do_viscosity); artemis->AddParam("do_radiation", do_radiation); + artemis->AddParam("do_coagulation", do_coagulation); PARTHENON_REQUIRE(!(do_cooling) || (do_cooling && do_gas), "Cooling requires the gas package, but there is not gas!"); PARTHENON_REQUIRE(!(do_viscosity) || (do_viscosity && do_gas), @@ -82,6 +87,8 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { "Conduction requires the gas package, but there is not gas!"); PARTHENON_REQUIRE(!(do_radiation) || (do_radiation && do_gas), "Radiation requires the gas package, but there is not gas!"); + PARTHENON_REQUIRE(!(do_coagulation) || (do_coagulation && do_dust), + "Coagulation requires the dust package, but there is not dust!"); // Set coordinate system const int ndim = ProblemDimension(pin.get()); @@ -98,6 +105,7 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { if (do_cooling) packages.Add(Gas::Cooling::Initialize(pin.get())); if (do_drag) packages.Add(Drag::Initialize(pin.get())); if (do_nbody) packages.Add(NBody::Initialize(pin.get())); + if (do_coagulation) packages.Add(Dust::Coagulation::Initialize(pin.get())); if (do_radiation) { auto eos_h = packages.Get("gas")->Param("eos_h"); auto opacity_h = packages.Get("gas")->Param("opacity_h"); @@ -138,6 +146,25 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { parthenon::MetadataFlag MetadataOperatorSplit = parthenon::Metadata::AddUserFlag("OperatorSplit"); + if (do_coagulation) { + typedef Coordinates C; + if (coords == C::cartesian) { + OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); + } else if (coords == C::spherical1D) { + OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); + } else if (coords == C::spherical2D) { + OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); + } else if (coords == C::spherical3D) { + OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); + } else if (coords == C::cylindrical) { + OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); + } else if (coords == C::axisymmetric) { + OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); + } else { + PARTHENON_FAIL("Invalid artemis/coordinate system!"); + } + } + // Add in user-defined AMR criterion callback const bool amr_user = pin->GetOrAddBoolean("artemis", "amr_user", false); if (amr_user) artemis->CheckRefinementBlock = artemis::ProblemCheckRefinementBlock; diff --git a/src/artemis.hpp b/src/artemis.hpp index 5dc7d4a9..1350768e 100644 --- a/src/artemis.hpp +++ b/src/artemis.hpp @@ -67,11 +67,13 @@ namespace prim { ARTEMIS_VARIABLE(dust.prim, density); ARTEMIS_VARIABLE(dust.prim, velocity); } // namespace prim +ARTEMIS_VARIABLE(dust, stopping_time); } // namespace dust #undef ARTEMIS_VARIABLE // TaskCollection function pointer for operator split tasks -using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, const Real time, const Real dt); +using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, parthenon::SimTime &tm, + const Real dt); // Constants that enumerate... // ...Coordinate systems @@ -90,6 +92,14 @@ enum class RSolver { hllc, hlle, llf, null }; enum class ReconstructionMethod { pcm, plm, ppm, null }; // ...Fluid types enum class Fluid { gas, dust, null }; +// constants that enumerate dust drag method +enum class DragMethod { + explicitNoFeedback, + explicitFeedback, + implicitNoFeedback, + implicitFeedback, + null +}; // ...Boundary conditions enum class ArtemisBC { reflect, @@ -148,6 +158,7 @@ inline int ProblemDimension(parthenon::ParameterInput *pin) { namespace artemis { extern std::function *mbd)> ProblemCheckRefinementBlock; +extern std::vector OperatorSplitTasks; } // namespace artemis #endif // ARTEMIS_ARTEMIS_HPP_ diff --git a/src/artemis_driver.cpp b/src/artemis_driver.cpp index 1c6d45ab..2c0d1174 100644 --- a/src/artemis_driver.cpp +++ b/src/artemis_driver.cpp @@ -66,6 +66,7 @@ ArtemisDriver::ArtemisDriver(ParameterInput *pin, ApplicationInput *app_in do_nbody = artemis_pkg->template Param("do_nbody"); do_diffusion = do_viscosity || do_conduction; do_radiation = artemis_pkg->template Param("do_radiation"); + do_coagulation = artemis_pkg->template Param("do_coagulation"); // NBody initialization tasks if (do_nbody) { @@ -111,6 +112,12 @@ TaskListStatus ArtemisDriver::Step() { if (do_radiation) status = IMC::JaybenneIMC(pmesh, tm.time, tm.dt); if (status != TaskListStatus::complete) return status; + // Execute operator split physics + for (auto &fn : OperatorSplitTasks) { + status = fn(pmesh, tm, integrator->dt).Execute(); + if (status != TaskListStatus::complete) return status; + } + // Compute new dt, (de)refine, and handle sparse (if enabled) status = PostStepTasks().Execute(); @@ -182,7 +189,13 @@ TaskCollection ArtemisDriver::StepTasks() { const bool do_pcm = ((stage == 1) && (integrator->GetName() == "vl2")); TaskID gas_flx = none, dust_flx = none; if (do_gas) gas_flx = tl.AddTask(none, Gas::CalculateFluxes, u0.get(), do_pcm); - if (do_dust) dust_flx = tl.AddTask(none, Dust::CalculateFluxes, u0.get(), do_pcm); + if (do_dust) { + // update dust stopping time and dust diffusivity + TaskID dust_stopping_time = + tl.AddTask(none, Dust::UpdateDustStoppingTime, u0.get()); + dust_flx = + tl.AddTask(dust_stopping_time, Dust::CalculateFluxes, u0.get(), do_pcm); + } // Compute (gas) diffusive fluxes TaskID diff_flx = none; @@ -247,9 +260,15 @@ TaskCollection ArtemisDriver::StepTasks() { tl.AddTask(drag_src, Gas::Cooling::CoolingSource, u0.get(), time, bdt); } + // Add dust drag force + TaskID dust_drag_src = cooling_src; + if (do_dust) { + dust_drag_src = tl.AddTask(cooling_src, Dust::ApplyDragForce, u0.get(), bdt); + } + // Set auxillary fields auto set_aux = - tl.AddTask(cooling_src, ArtemisDerived::SetAuxillaryFields, u0.get()); + tl.AddTask(dust_drag_src, ArtemisDerived::SetAuxillaryFields, u0.get()); // Set (remaining) fields to be communicated auto pre_comm = tl.AddTask(set_aux, PreCommFillDerived>, u0.get()); diff --git a/src/artemis_driver.hpp b/src/artemis_driver.hpp index f3116a38..5d412381 100644 --- a/src/artemis_driver.hpp +++ b/src/artemis_driver.hpp @@ -53,11 +53,12 @@ class ArtemisDriver : public EvolutionDriver { IntegratorPtr_t integrator, nbody_integrator; StateDescriptor *artemis_pkg; bool do_gas, do_dust, do_gravity, do_rotating_frame, do_cooling, do_drag, do_viscosity, - do_nbody, do_conduction, do_diffusion, do_radiation; + do_nbody, do_conduction, do_diffusion, do_radiation, do_coagulation; const bool is_restart; }; -using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, const Real time, const Real dt); +// using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, const Real time, const Real +// dt); Packages_t ProcessPackages(std::unique_ptr &pin); diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index dfaa916e..b17f16d8 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -20,6 +20,7 @@ // Artemis includes #include "artemis.hpp" +#include "dust/coagulation/coagulation.hpp" #include "dust/dust.hpp" #include "geometry/geometry.hpp" #include "utils/artemis_utils.hpp" @@ -29,6 +30,7 @@ using ArtemisUtils::VI; namespace Dust { +CGSUnit *cgsunit = NULL; //---------------------------------------------------------------------------------------- //! \fn StateDescriptor Dust::Initialize //! \brief Adds intialization function for dust hydrodynamics package @@ -86,6 +88,10 @@ std::shared_ptr Initialize(ParameterInput *pin) { const Real cfl_number = pin->GetOrAddReal("dust", "cfl", 0.8); params.Add("cfl", cfl_number); + // possible user_dt + const Real user_dt = pin->GetOrAddReal("dust", "user_dt", 1.0e10); + params.Add("user_dt", user_dt); + // Floors const Real dfloor = pin->GetOrAddReal("dust", "dfloor", 1.0e-20); params.Add("dfloor", dfloor); @@ -97,8 +103,46 @@ std::shared_ptr Initialize(ParameterInput *pin) { for (int n = 0; n < nspecies; ++n) dustids.push_back(n); + // dust stopping time flag + bool const_stopping_time = pin->GetOrAddBoolean("dust", "const_stopping_time", true); + params.Add("const_stopping_time", const_stopping_time); + + bool enable_dust_drag = pin->GetOrAddBoolean("dust", "enable_dust_drag", false); + params.Add("enable_dust_drag", enable_dust_drag); + + bool hst_out_d2g = pin->GetOrAddBoolean("dust", "hst_out_d2g", false); + params.Add("hst_out_d2g", hst_out_d2g); + + // coagulation flag + bool enable_dust_coagulation = pin->GetOrAddBoolean("physics", "coagulation", false); + + DragMethod drag_method = DragMethod::null; + if (enable_dust_drag) { + bool enable_dust_feedback = pin->GetBoolean("dust", "enable_dust_feedback"); + std::string drag_method1 = pin->GetOrAddString("dust", "drag_method", "implicit"); + + if (drag_method1 == "implicit") { + if (enable_dust_feedback) { + drag_method = DragMethod::implicitFeedback; + } else { + drag_method = DragMethod::implicitNoFeedback; + } + } else { + if (enable_dust_feedback) { + drag_method = DragMethod::explicitFeedback; + } else { + drag_method = DragMethod::explicitNoFeedback; + } + } + + params.Add("drag_method", drag_method); + } // end if (enable_dust_drag) + // Dust sizes - const auto size_dist = pin->GetOrAddString("dust", "size_input", "direct"); + auto size_dist = pin->GetOrAddString("dust", "size_input", "direct"); + if (enable_dust_coagulation) size_dist = "logspace"; + params.Add("enable_coagulation", enable_dust_coagulation); + if (size_dist == "linspace") { // uniform auto min_size = pin->GetReal("dust", "min_size"); @@ -131,6 +175,11 @@ std::shared_ptr Initialize(ParameterInput *pin) { params.Add("sizes", sizes); params.Add("h_sizes", h_sizes); + if (parthenon::Globals::my_rank == 0) { + for (int n = 0; n < nspecies; n++) { + std::cout << "dust_size(" << n << ")=" << h_sizes(n) << std::endl; + } + } } else if (size_dist == "direct") { // specify them directly auto sizes_v = pin->GetVector("dust", "sizes"); @@ -163,13 +212,51 @@ std::shared_ptr Initialize(ParameterInput *pin) { sizes.DeepCopy(h_sizes); params.Add("sizes", sizes); params.Add("h_sizes", h_sizes); - } else { + } else if (!const_stopping_time) { PARTHENON_FAIL("dust/size_input not recognized!"); } // Dust density - params.Add("grain_density", pin->GetOrAddReal("dust", "grain_density", 1.0)); + const Real rho_p_orig = pin->GetOrAddReal("dust", "grain_density", 1.0); + params.Add("grain_density", rho_p_orig); + + if (const_stopping_time) { + if (enable_dust_drag) { + ParArray1D stopping_time("dust_stopping_time", nspecies); + auto stopping_time_host = stopping_time.GetHostMirror(); + auto stopping_v = pin->GetVector("dust", "stopping_time"); + for (int n = 0; n < nspecies; ++n) { + stopping_time_host(n) = stopping_v[n]; + } + stopping_time.DeepCopy(stopping_time_host); + params.Add("stopping_time", stopping_time); + } + } else { + if (cgsunit == NULL) { + cgsunit = new CGSUnit; + } + if (!cgsunit->isSet()) { + cgsunit->SetCGSUnit(pin); + } + params.Add("cgs_unit", cgsunit); + + Real rho_p = rho_p_orig; + // density in physical unit correspinding to code unit 1. + // const Real rho_g0 = pin->GetOrAddReal("dust", "rho_g0", 1.0); + const Real rho_g0 = cgsunit->mass0 / cgsunit->vol0; + // re-scale rho_p to account for rho_g0 for stopping_time calculation + rho_p /= rho_g0; + + // re-scale rho_p by prefactor coefficient + if (cgsunit->isurface_den) { + rho_p *= 0.5 * M_PI; + } else { + rho_p *= std::sqrt(M_PI / 8.); + rho_p /= cgsunit->length0; + } + params.Add("rho_p", rho_p); + } // Scratch for dust flux const int scr_level = pin->GetOrAddInteger("dust", "scr_level", 0); params.Add("scr_level", scr_level); @@ -207,6 +294,14 @@ std::shared_ptr Initialize(ParameterInput *pin) { m.SetSparseThresholds(0.0, 0.0, 0.0); dust->AddSparsePool(m, control_field, dustids); + // dust stopping-time + m = Metadata({Metadata::Cell, Metadata::Derived, Metadata::Intensive, Metadata::OneCopy, + Metadata::Sparse}); + m.SetSparseThresholds(0.0, 0.0, 0.0); + dust->AddSparsePool(m, control_field, dustids); + // std::vector stopping_id = {0}; + // dust->AddSparsePool(m, control_field, stopping_id); + // Dust hydrodynamics timestep if (coords == Coordinates::cartesian) { dust->EstimateTimestepMesh = EstimateTimestepMesh; @@ -227,6 +322,97 @@ std::shared_ptr Initialize(ParameterInput *pin) { return dust; } +//---------------------------------------------------------------------------------------- +//! \fn TaskStatus Dust::UpdateDustStoppingTime +// \brief Wrapper function for update dust stopping time +template +TaskStatus UpdateDustStoppingTime(MeshData *md) { + + using parthenon::MakePackDescriptor; + + auto pm = md->GetParentPointer(); + + auto &dust_pkg = pm->packages.Get("dust"); + if ((!dust_pkg->template Param("enable_dust_drag")) && + (!dust_pkg->template Param("enable_coagulation"))) { + return TaskStatus::complete; + } + + auto &resolved_pkgs = pm->resolved_packages; + + IndexRange ib = md->GetBoundsI(IndexDomain::interior); + IndexRange jb = md->GetBoundsJ(IndexDomain::interior); + IndexRange kb = md->GetBoundsK(IndexDomain::interior); + + const int nspecies = dust_pkg->template Param("nspecies"); + + const bool const_stopping_time = dust_pkg->template Param("const_stopping_time"); + + if (const_stopping_time) { + ParArray1D stoppingTime = + dust_pkg->template Param>("stopping_time"); + static auto desc = MakePackDescriptor(resolved_pkgs.get()); + + auto vmesh = desc.GetPack(md); + parthenon::par_for( + DEFAULT_LOOP_PATTERN, "Dust::DustStoppingTime", parthenon::DevExecSpace(), 0, + md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { + // usually the stopping time depends gas density, unless constant is used + // constant stopping time + for (int n = 0; n < nspecies; ++n) { + vmesh(b, dust::stopping_time(n), k, j, i) = stoppingTime(n); + } + }); + } else { + const bool isurf_den = cgsunit->isurface_den; + ParArray1D dust_size = dust_pkg->template Param>("sizes"); + static auto desc = + MakePackDescriptor( + resolved_pkgs.get()); + + auto vmesh = desc.GetPack(md); + + auto &gas_pkg = pm->packages.Get("gas"); + + const Real gamma = gas_pkg->template Param("adiabatic_index"); + const Real rho_p = dust_pkg->template Param("rho_p"); + + parthenon::par_for( + DEFAULT_LOOP_PATTERN, "Dust::DustStoppingTime2", parthenon::DevExecSpace(), 0, + md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { + const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); + // usually the Stokes number depends gas density, unless constant is used + // stopping_time = Stokes_number/Omega_k + + if (isurf_den) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + // for surface denstiy, Stokes number = Pi/2*rho_p*s_p/sigma_g + // calculate the Keplerian Omega at mid-plane + Real rad = coords.x1v(); + Real Omega_k = 1.0 / std::sqrt(rad) / rad; + for (int n = 0; n < nspecies; ++n) { + const Real St = rho_p * dust_size(n) / dens_g; + vmesh(b, dust::stopping_time(n), k, j, i) = St / Omega_k; + } + + } else { + + // for density (g/cc), Stokes number = sqrt(Pi/8)*rho_p*s_p*Omega_k/rho_g/Cs + const Real pres = vmesh(b, gas::prim::pressure(0), k, j, i); + const Real cs = std::sqrt(gamma * pres / dens_g); + for (int n = 0; n < nspecies; ++n) { + const Real StOme = rho_p * dust_size(n) / dens_g; + vmesh(b, dust::stopping_time(n), k, j, i) = StOme / cs; + } + } + }); + } + + return TaskStatus::complete; +} + //---------------------------------------------------------------------------------------- //! \fn Real Dust::EstimateTimestepMesh //! \brief Compute dust hydrodynamics timestep @@ -239,8 +425,24 @@ Real EstimateTimestepMesh(MeshData *md) { auto &dust_pkg = pm->packages.Get("dust"); auto ¶ms = dust_pkg->AllParams(); + auto dragDt = params.template Get("user_dt"); + auto nspecies = params.template Get("nspecies"); + + bool dt_stoppingTime = false; + if (params.template Get("enable_dust_drag")) { + UpdateDustStoppingTime(md); + if ((params.template Get("drag_method") == + DragMethod::explicitFeedback) || + (params.template Get("drag_method") == + DragMethod::explicitNoFeedback)) { + dt_stoppingTime = true; + } + } + + const auto cfl_number = params.template Get("cfl"); static auto desc = - MakePackDescriptor(resolved_pkgs.get()); + MakePackDescriptor( + resolved_pkgs.get()); auto vmesh = desc.GetPack(md); IndexRange ib = md->GetBoundsI(IndexDomain::interior); IndexRange jb = md->GetBoundsJ(IndexDomain::interior); @@ -261,13 +463,17 @@ Real EstimateTimestepMesh(MeshData *md) { for (int d = 0; d < ndim; d++) { denom += std::abs(vmesh(b, dust::prim::velocity(VI(n, d)), k, j, i)) / dx[d]; } - ldt = std::min(ldt, 1.0 / denom); + ldt = std::min(ldt, 1.0 / denom * cfl_number); + } + if (dt_stoppingTime) { + for (int n = 0; n < nspecies; ++n) { + ldt = std::min(ldt, vmesh(b, dust::stopping_time(n), k, j, i)); + } } }, Kokkos::Min(min_dt)); - const auto cfl_number = params.template Get("cfl"); - return cfl_number * min_dt; + return std::min(dragDt, min_dt); } //---------------------------------------------------------------------------------------- @@ -320,6 +526,535 @@ TaskStatus FluxSource(MeshData *md, const Real dt) { return TaskStatus::complete; } +//---------------------------------------------------------------------------------------- +//! \fn TaskStatus Dust::ApplyDragForceSelect +// \brief Wrapper function for dust-drag froce based on different drag-method +template +TaskStatus ApplyDragForceSelect(MeshData *md, const Real dt) { + + using parthenon::MakePackDescriptor; + + auto pm = md->GetParentPointer(); + auto &dust_pkg = pm->packages.Get("dust"); + IndexRange ib = md->GetBoundsI(IndexDomain::interior); + IndexRange jb = md->GetBoundsJ(IndexDomain::interior); + IndexRange kb = md->GetBoundsK(IndexDomain::interior); + + auto &resolved_pkgs = pm->resolved_packages; + auto &DUST_DRAG = dust_pkg->template Param("drag_method"); + + static auto desc = + MakePackDescriptor(resolved_pkgs.get()); + + auto vmesh = desc.GetPack(md); + + if ((DUST_DRAG == DragMethod::explicitFeedback) || + (DUST_DRAG == DragMethod::explicitNoFeedback)) { + parthenon::par_for( + DEFAULT_LOOP_PATTERN, "Dust::DustDrag", parthenon::DevExecSpace(), 0, + md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { + const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); + const int nspecies = vmesh.GetUpperBound(b, dust::prim::density()) - + vmesh.GetLowerBound(b, dust::prim::density()) + 1; + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const auto &hx = coords.GetScaleFactors(); + + for (int n = 0; n < nspecies; ++n) { + const Real dens_d = vmesh(b, dust::prim::density(n), k, j, i); + const Real tst = vmesh(b, dust::stopping_time(n), k, j, i); + const Real cj = dt * dens_d / tst; + + vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i) += + cj * hx[0] * + (vmesh(b, gas::prim::velocity(0), k, j, i) - + vmesh(b, dust::prim::velocity(VI(n, 0)), k, j, i)); + + vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i) += + cj * hx[1] * + (vmesh(b, gas::prim::velocity(1), k, j, i) - + vmesh(b, dust::prim::velocity(VI(n, 1)), k, j, i)); + + vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i) += + cj * hx[2] * + (vmesh(b, gas::prim::velocity(2), k, j, i) - + vmesh(b, dust::prim::velocity(VI(n, 2)), k, j, i)); + } + if (DUST_DRAG == DragMethod::explicitFeedback) { + const Real dens_g = vmesh(b, gas::cons::density(0), k, j, i); + Real delta_mom1 = 0.0; + Real delta_mom2 = 0.0; + Real delta_mom3 = 0.0; + for (int n = 0; n < nspecies; ++n) { + const Real dens_d = vmesh(b, dust::prim::density(n), k, j, i); + const Real tst = vmesh(b, dust::stopping_time(n), k, j, i); + Real cj = dt * dens_d / tst; + delta_mom1 -= cj * (vmesh(b, gas::prim::velocity(0), k, j, i) - + vmesh(b, dust::prim::velocity(VI(n, 0)), k, j, i)); + delta_mom2 -= cj * (vmesh(b, gas::prim::velocity(1), k, j, i) - + vmesh(b, dust::prim::velocity(VI(n, 1)), k, j, i)); + delta_mom3 -= cj * (vmesh(b, gas::prim::velocity(2), k, j, i) - + vmesh(b, dust::prim::velocity(VI(n, 2)), k, j, i)); + } + vmesh(b, gas::cons::momentum(0), k, j, i) += delta_mom1 * hx[0]; + vmesh(b, gas::cons::momentum(1), k, j, i) += delta_mom2 * hx[1]; + vmesh(b, gas::cons::momentum(2), k, j, i) += delta_mom3 * hx[2]; + + // gas energy update: delta_E = delta_mom*(M_new - 0.5*delta_mom)/rho_g + // delta_E = 0.5*rhog*(V_new^2 - V_old^2) + + vmesh(b, gas::cons::total_energy(0), k, j, i) += + (delta_mom1 * (vmesh(b, gas::cons::momentum(0), k, j, i) / hx[0] - + delta_mom1 * 0.5) + + delta_mom2 * (vmesh(b, gas::cons::momentum(1), k, j, i) / hx[1] - + delta_mom2 * 0.5) + + delta_mom3 * (vmesh(b, gas::cons::momentum(2), k, j, i) / hx[2] - + delta_mom3 * 0.5)) / + dens_g; + } + }); + + } else if ((DUST_DRAG == DragMethod::implicitFeedback) || + (DUST_DRAG == DragMethod::implicitNoFeedback)) { + auto &dfloor = dust_pkg->template Param("dfloor"); + parthenon::par_for( + DEFAULT_LOOP_PATTERN, "Dust::DustDragImp", parthenon::DevExecSpace(), 0, + md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const auto &hx = coords.GetScaleFactors(); + const int nspecies = vmesh.GetUpperBound(b, dust::prim::density()) - + vmesh.GetLowerBound(b, dust::prim::density()) + 1; + + const Real dens_g = vmesh(b, gas::cons::density(0), k, j, i); + Real mom1_g = vmesh(b, gas::cons::momentum(0), k, j, i); + Real mom2_g = vmesh(b, gas::cons::momentum(1), k, j, i); + Real mom3_g = vmesh(b, gas::cons::momentum(2), k, j, i); + + Real vel1_g = mom1_g / (dens_g * hx[0]); + Real vel2_g = mom2_g / (dens_g * hx[1]); + Real vel3_g = mom3_g / (dens_g * hx[2]); + const Real coef1 = dens_g / vmesh(b, gas::prim::density(0), k, j, i); + + if (DUST_DRAG == DragMethod::implicitFeedback) { + + Real tmp1 = dens_g; + const Real vel1_go = vel1_g; + const Real vel2_go = vel2_g; + const Real vel3_go = vel3_g; + for (int n = 0; n < nspecies; ++n) { + const Real dens_d = vmesh(b, dust::cons::density(n), k, j, i); + const Real tst = vmesh(b, dust::stopping_time(n), k, j, i); + const Real cj = dt * dens_d / tst * coef1; // use updated dens_g + const Real bj1 = vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i); + const Real bj2 = vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i); + const Real bj3 = vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i); + const Real dj = dens_d + cj; + + const Real cjOdj = cj / dj; + tmp1 += (cj - cj * cjOdj); + mom1_g += bj1 * cjOdj; + mom2_g += bj2 * cjOdj; + mom3_g += bj3 * cjOdj; + } + + vel1_g = mom1_g / (tmp1 * hx[0]); + vel2_g = mom2_g / (tmp1 * hx[1]); + vel3_g = mom3_g / (tmp1 * hx[2]); + vmesh(b, gas::cons::momentum(0), k, j, i) = dens_g * vel1_g * hx[0]; + vmesh(b, gas::cons::momentum(1), k, j, i) = dens_g * vel2_g * hx[1]; + vmesh(b, gas::cons::momentum(2), k, j, i) = dens_g * vel3_g * hx[2]; + + // gas energy update: delta_E = 0.5*(v_new^2 - v_old^2)*rho_g + vmesh(b, gas::cons::total_energy(0), k, j, i) += + 0.5 * + (SQR(vel1_g) - SQR(vel1_go) + SQR(vel2_g) - SQR(vel2_go) + SQR(vel3_g) - + SQR(vel3_go)) * + dens_g; + } // end if (DUST_DRAG == DragMethod::implicitFeedback) + + // update the dust + for (int n = 0; n < nspecies; ++n) { + const Real dens_d = + std::max(dfloor, vmesh(b, dust::cons::density(n), k, j, i)); + const Real tst = vmesh(b, dust::stopping_time(n), k, j, i); + const Real cj = dt * dens_d / tst * coef1; // use updated dens_g + const Real bj1 = vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i); + const Real bj2 = vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i); + const Real bj3 = vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i); + const Real dj = dens_d + cj; + vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i) = + dens_d * (bj1 + cj * vel1_g * hx[0]) / dj; + vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i) = + dens_d * (bj2 + cj * vel2_g * hx[1]) / dj; + vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i) = + dens_d * (bj3 + cj * vel3_g * hx[2]) / dj; + } + }); + } + + return TaskStatus::complete; +} + +//---------------------------------------------------------------------------------------- +//! \fn TaskStatus Dust::ApplyDragForce +// \brief Wrapper function for dust-drag froce +TaskStatus ApplyDragForce(MeshData *md, const Real dt) { + + using parthenon::MakePackDescriptor; + + auto pm = md->GetParentPointer(); + auto &dust_pkg = pm->packages.Get("dust"); + if (!dust_pkg->template Param("enable_dust_drag")) { + return TaskStatus::complete; + } + + const Coordinates GEOM = dust_pkg->template Param("coords"); + + if (GEOM == Coordinates::cartesian) { + return ApplyDragForceSelect(md, dt); + } else if (GEOM == Coordinates::spherical1D) { + return ApplyDragForceSelect(md, dt); + } else if (GEOM == Coordinates::spherical2D) { + return ApplyDragForceSelect(md, dt); + } else if (GEOM == Coordinates::spherical3D) { + return ApplyDragForceSelect(md, dt); + } else if (GEOM == Coordinates::cylindrical) { + return ApplyDragForceSelect(md, dt); + } else if (GEOM == Coordinates::axisymmetric) { + return ApplyDragForceSelect(md, dt); + } else { + PARTHENON_FAIL("Coordinate type not recognized!"); + } +} + +//#define COAG_DEBUG +//---------------------------------------------------------------------------------------- +//! \fn TaskStatus Dust::CoagulationOneStep +// \brief Wrapper function for coagulation procedure in one time step +template +TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt) { + + using parthenon::MakePackDescriptor; + auto pm = md->GetParentPointer(); + auto &dust_pkg = pm->packages.Get("dust"); + IndexRange ib = md->GetBoundsI(IndexDomain::interior); + IndexRange jb = md->GetBoundsJ(IndexDomain::interior); + IndexRange kb = md->GetBoundsK(IndexDomain::interior); + + auto &gas_pkg = pm->packages.Get("gas"); + const Real gamma = gas_pkg->template Param("adiabatic_index"); + + auto &resolved_pkgs = pm->resolved_packages; + const int nspecies = dust_pkg->template Param("nspecies"); + + auto &coag_pkg = pm->packages.Get("coagulation"); + auto &coag = coag_pkg->template Param("coag_pars"); + + PARTHENON_REQUIRE(cgsunit->isSet(), + "coagulation requires setting code-to-physical unit in user routine"); + + static auto desc = + MakePackDescriptor(resolved_pkgs.get()); + + auto vmesh = desc.GetPack(md); + + const Real alpha = coag_pkg->template Param("coag_alpha"); // 1e-3 + const int nvel = 3; + + const int scr_level = coag_pkg->template Param("coag_scr_level"); + size_t isize = (5 + nvel) * nspecies; + if (coag.integrator == 3 && coag.mom_coag) isize += nspecies; + size_t scr_size = ScratchPad1D::shmem_size(isize); + const Real den0 = cgsunit->mass0 / cgsunit->vol0; + const Real time0 = cgsunit->time0; + // const Real vol0 = cgsunit->vol0; + const Real vel0 = cgsunit->length0 / cgsunit->time0; + + auto pmb = md->GetBlockData(0)->GetBlockPointer(); + ParArray3D nCalls("nCalls", pmb->cellbounds.ncellsk(IndexDomain::entire), + pmb->cellbounds.ncellsj(IndexDomain::entire), + pmb->cellbounds.ncellsi(IndexDomain::entire)); + + int maxCalls = 0, maxSize = 1; + auto &dfloor = dust_pkg->template Param("dfloor"); + + int maxSize0 = 1; + Real massd = 0.0; + Kokkos::parallel_reduce( + "coag::maxSize0", + Kokkos::MDRangePolicy>( + {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, + int &lmax) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + for (int n = 0; n < nspecies; ++n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + lsum += dens_d * coords.Volume(); + } + for (int n = nspecies - 1; n >= 0; --n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + if (dens_d > dfloor) { + lmax = std::max(lmax, n); + break; + } + } + }, + massd, Kokkos::Max(maxSize0)); +#ifdef MPI_PARALLEL + // Sum the perturbations over all processors + MPI_Reduce(MPI_IN_PLACE, &maxSize0, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); + MPI_Reduce(MPI_IN_PLACE, &massd, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); +#endif // MPI_PARALLEL + + Real sumd1 = 0.0; +#ifdef COAG_DEBUG + ParArray3D floor_tmp("floor_tmp", 17, nspecies, 2); +#endif + for (int b = 0; b < md->NumBlocks(); b++) { + parthenon::par_for_outer( + DEFAULT_OUTER_LOOP_PATTERN, "Dust::Coagulation", parthenon::DevExecSpace(), + scr_size, scr_level, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(parthenon::team_mbr_t mbr, const int k, const int j, const int i) { + // code-to-physical unit + // one-cell coagulation + const int nDust_live = (vmesh.GetUpperBound(b, dust::prim::density()) - + vmesh.GetLowerBound(b, dust::prim::density()) + 1); + + const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i) * den0; + Real dt_sync = dt * time0; + const Real time1 = time * time0; + + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const auto &hx = coords.GetScaleFactors(); + const Real rad = hx[2]; // cylindrical R_cyl + const Real Omega_k = 1.0 / std::sqrt(rad) / rad; + // const Real vol1 = coords.Volume() * vol0; + + int nCall1 = 0; + + const Real pres = vmesh(b, gas::prim::pressure(0), k, j, i); + const Real cs = std::sqrt(gamma * pres / dens_g * den0) * vel0; + const Real omega1 = Omega_k / time0; + const int nm = nspecies; + + ScratchPad1D rhod(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D stime(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D vel(mbr.team_scratch(scr_level), nvel * nspecies); + ScratchPad1D source(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D Q(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D nQs(mbr.team_scratch(scr_level), nspecies); + [[maybe_unused]] ScratchPad1D Q2; + if (coag.integrator == 3 && coag.mom_coag) { + Q2 = ScratchPad1D(mbr.team_scratch(scr_level), nspecies); + } + + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { + // for (int n = 0; n < nm; ++n) { + stime(n) = vmesh(b, dust::stopping_time(n), k, j, i) * time0; + if (vmesh(b, dust::prim::density(n), k, j, i) > dfloor) { + rhod(n) = vmesh(b, dust::prim::density(n), k, j, i) * den0; + vel(0 + n * 3) = + vmesh(b, dust::prim::velocity(VI(n, 0)), k, j, i) * vel0; + vel(1 + n * 3) = + vmesh(b, dust::prim::velocity(VI(n, 1)), k, j, i) * vel0; + vel(2 + n * 3) = + vmesh(b, dust::prim::velocity(VI(n, 2)), k, j, i) * vel0; + } else { + rhod(n) = 0.0; + vel(0 + n * 3) = 0.0; + vel(1 + n * 3) = 0.0; + vel(2 + n * 3) = 0.0; + } + }); + + Coagulation::CoagulationOneCell(mbr, i, time1, dt_sync, dens_g, rhod, stime, + vel, nvel, Q, nQs, alpha, cs, omega1, coag, + source, nCall1, Q2); + + nCalls(k, j, i) = nCall1; + + // update dust density and velocity after coagulation + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { + // for (int n = 0; n < nspecies; ++n) { + if (rhod(n) > 0.0) { + const Real rhod1 = rhod(n) / den0; + vmesh(b, dust::cons::density(n), k, j, i) = rhod1; + vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i) = + rhod1 * vel(0 + n * 3) * hx[0] / vel0; + vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i) = + rhod1 * vel(1 + n * 3) * hx[1] / vel0; + vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i) = + rhod1 * vel(2 + n * 3) * hx[2] / vel0; + } else { + vmesh(b, dust::cons::density(n), k, j, i) = 0.0; + vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i) = 0.0; + vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i) = 0.0; + vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i) = 0.0; + } + }); +#ifdef COAG_DEBUG + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { + // for (int n = 0; n < nspecies; n++) { + floor_tmp(i - ib.s, n, 0) = source(n); + floor_tmp(i - ib.s, n, 1) = vmesh(b, dust::cons::density(n), k, j, i); + }); +#endif + }); + + Real sumd0 = 0.0; + Kokkos::parallel_reduce( + "coag::nCallsMaximum", + Kokkos::MDRangePolicy>({kb.s, jb.s, ib.s}, + {kb.e + 1, jb.e + 1, ib.e + 1}), + KOKKOS_LAMBDA(const int k, const int j, const int i, Real &lsum, int &lmax1, + int &lmax2) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const Real vol00 = coords.Volume(); + for (int n = 0; n < nspecies; ++n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + lsum += dens_d * vol00; + } + lmax1 = std::max(lmax1, nCalls(k, j, i)); + for (int n = nspecies - 1; n >= 0; --n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + if (dens_d > dfloor) { + lmax2 = std::max(lmax2, n); + break; + } + } + }, + Kokkos::Sum(sumd0), Kokkos::Max(maxCalls), Kokkos::Max(maxSize)); + sumd1 += sumd0; + } // loop of blocks + +#ifdef COAG_DEBUG + auto floor_h = + Kokkos::create_mirror_view_and_copy(parthenon::HostMemSpace(), floor_tmp); + for (int i = 0; i <= 0; i++) { + std::cout << "i=" << i << " "; + for (int n = 0; n < 20; n++) { + std::cout << floor_h(i, n, 0) << " "; + } + std::cout << std::endl; + + std::cout << "i=" << i << " "; + for (int n = 0; n < 20; n++) { + std::cout << floor_h(i, n, 1) << " "; + } + std::cout << std::endl; + } +#endif + +#ifdef MPI_PARALLEL + // over all processors + MPI_Reduce(MPI_IN_PLACE, &maxCalls, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); + MPI_Reduce(MPI_IN_PLACE, &maxSize, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); + MPI_Reduce(MPI_IN_PLACE, &sumd1, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); +#endif // MPI_PARALLEL + + if (parthenon::Globals::my_rank == 0) { + std::cout << "maxcalls,size= " << time << " " << maxCalls << " " << maxSize << " " + << maxSize0 << " " << time0 * dt << std::endl + << "total massd =" << time << " " << massd << " " << sumd1 << std::endl; + } + + return TaskStatus::complete; +} + +//---------------------------------------------------------------------------------------- +//! \fn TaskCollection Dust::OperatorSplitDust +//! \brief dust operator split task collection +template +TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt) { + TaskCollection tc; + auto &coag_pkg = pm->packages.Get("coagulation"); + auto *dtCoag = coag_pkg->MutableParam("dtCoag"); + int nstep1Coag = coag_pkg->template Param("nstep1Coag"); + if (tm.ncycle == 0) { + *dtCoag = 0.0; + } + + *dtCoag += dt; + if ((tm.ncycle + 1) % nstep1Coag != 0) { + return tc; + } + + const Real time_local = tm.time + dt - (*dtCoag); + const Real dt_local = (*dtCoag); + if (parthenon::Globals::my_rank == 0) { + std::cout << "coagulation at: time,dt,cycle=" << time_local << " " << dt_local << " " + << tm.ncycle << std::endl; + } + + TaskID none(0); + + // Assemble tasks + using namespace ::parthenon::Update; + const int num_partitions = pm->DefaultNumPartitions(); + TaskRegion &tr = tc.AddRegion(num_partitions); + for (int i = 0; i < num_partitions; i++) { + auto &tl = tr[i]; + auto &base = pm->mesh_data.GetOrAdd("base", i); + auto coag_step = + tl.AddTask(none, CoagulationOneStep, base.get(), time_local, dt_local); + + // Set (remaining) fields to be communicated + auto pre_comm = tl.AddTask(coag_step, PreCommFillDerived>, base.get()); + + // Set boundary conditions (both physical and logical) + auto bcs = parthenon::AddBoundaryExchangeTasks(pre_comm, tl, base, pm->multilevel); + + // Update primitive variables + auto c2p = tl.AddTask(bcs, FillDerived>, base.get()); + } + *dtCoag = 0.0; + + return tc; +} + +//---------------------------------------------------------------------------------------- +//! \fn void Dust::ReduceD2gMaximum +// \brief calculate dust-to-gas ratio maximum +std::vector ReduceD2gMaximum(MeshData *md) { + auto pm = md->GetParentPointer(); + auto &resolved_pkgs = pm->resolved_packages; + + const auto ib = md->GetBoundsI(IndexDomain::interior); + const auto jb = md->GetBoundsJ(IndexDomain::interior); + const auto kb = md->GetBoundsK(IndexDomain::interior); + + static auto desc = + MakePackDescriptor(resolved_pkgs.get()); + auto vmesh = desc.GetPack(md); + const int nblocks = md->NumBlocks(); + std::vector max_d2g(1, 0); + parthenon::par_reduce( + parthenon::loop_pattern_mdrange_tag, "ReduceD2gMaximum", parthenon::DevExecSpace(), + 0, md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lmax) { + const Real &rhog = vmesh(b, gas::prim::density(0), k, j, i); + const int nspecies = (vmesh.GetUpperBound(b, dust::prim::density()) - + vmesh.GetLowerBound(b, dust::prim::density())) + + 1; + Real rhod = 0.0; + for (int n = 0; n < nspecies; ++n) { + rhod += vmesh(b, dust::prim::density(n), k, j, i); + } + lmax = std::max(lmax, rhod / rhog); + }, + Kokkos::Max(max_d2g[0])); + return max_d2g; +} + //---------------------------------------------------------------------------------------- //! \fn void Dust::AddHistoryImpl //! \brief Add history outputs for dust quantities for generic coordinate system @@ -374,4 +1109,49 @@ template Real EstimateTimestepMesh(MeshData *md) template Real EstimateTimestepMesh(MeshData *md); template Real EstimateTimestepMesh(MeshData *md); +template TaskStatus UpdateDustStoppingTime(MeshData *md); +template TaskStatus UpdateDustStoppingTime(MeshData *md); +template TaskStatus UpdateDustStoppingTime(MeshData *md); +template TaskStatus UpdateDustStoppingTime(MeshData *md); +template TaskStatus UpdateDustStoppingTime(MeshData *md); +template TaskStatus UpdateDustStoppingTime(MeshData *md); + +template TaskStatus CoagulationOneStep(MeshData *md, + const Real time, + const Real dt); +template TaskStatus CoagulationOneStep(MeshData *md, + const Real time, + const Real dt); +template TaskStatus CoagulationOneStep(MeshData *md, + const Real time, + const Real dt); +template TaskStatus CoagulationOneStep(MeshData *md, + const Real time, + const Real dt); +template TaskStatus CoagulationOneStep(MeshData *md, + const Real time, + const Real dt); +template TaskStatus CoagulationOneStep(MeshData *md, + const Real time, + const Real dt); + +template TaskCollection OperatorSplitDust(Mesh *pm, + parthenon::SimTime &tm, + const Real dt); +template TaskCollection +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, + const Real dt); +template TaskCollection +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, + const Real dt); +template TaskCollection +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, + const Real dt); +template TaskCollection +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, + const Real dt); +template TaskCollection +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, + const Real dt); + } // namespace Dust diff --git a/src/dust/dust.hpp b/src/dust/dust.hpp index 72be4ee5..535240cc 100644 --- a/src/dust/dust.hpp +++ b/src/dust/dust.hpp @@ -33,6 +33,65 @@ TaskStatus FluxSource(MeshData *md, const Real dt); void AddHistory(Coordinates coords, Params ¶ms); +struct CGSUnit { + Real mass0 = 1.0; + Real time0 = 1.0; + Real length0 = 1.0; + Real vol0 = 1.0; + bool isurface_den = true; + bool Code2PhysicalUnit_Set = false; + + bool isSet() const { return Code2PhysicalUnit_Set; } + + void SetCGSUnit(const Real &mass0_in, const Real &length0_in, const Real &time0_in, + const int isurf) { + if (!Code2PhysicalUnit_Set) { + mass0 = mass0_in; + length0 = length0_in; + vol0 = SQR(length0_in); + if (isurf == 0) vol0 *= length0_in; // 3D volume + time0 = time0_in; + Code2PhysicalUnit_Set = true; + } + } + + void SetCGSUnit(ParameterInput *pin) { + if (!Code2PhysicalUnit_Set) { + const Real M_SUN = 1.988409870698051e33; // gram (sun) + const Real AU_LENGTH = 1.4959787070000e13; // cm + const Real GRAV_CONST = + 6.674299999999999e-8; // gravitational const in cm^3 g^-1 s^-2 + + Real mstar = pin->GetOrAddReal("problem", "mstar", 1.0) * M_SUN; + length0 = pin->GetOrAddReal("problem", "r0_length", 1.0) * AU_LENGTH; + const Real omega0 = std::sqrt(GRAV_CONST * mstar / pow(length0, 3)); + time0 = 1. / omega0; + + const Real rho0 = pin->GetReal("problem", "rho0"); + mass0 = rho0 * mstar; + + isurface_den = pin->GetOrAddBoolean("dust", "surface_density_flag", true); + vol0 = SQR(length0); + if (isurface_den == 0) vol0 *= length0; // 3D volume + Code2PhysicalUnit_Set = true; + } + } +}; + +extern CGSUnit *cgsunit; + +template +TaskStatus UpdateDustStoppingTime(MeshData *md); + +TaskStatus ApplyDragForce(MeshData *md, const Real dt); + +// OperatorSplit tasks +template +TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt); + +template +TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt); + } // namespace Dust #endif // DUST_DUST_HPP_ diff --git a/src/pgen/pgen.hpp b/src/pgen/pgen.hpp index abf5887e..37228c14 100644 --- a/src/pgen/pgen.hpp +++ b/src/pgen/pgen.hpp @@ -23,6 +23,8 @@ #include "conduction.hpp" #include "constant.hpp" #include "disk.hpp" +#include "dust_coagulation.hpp" +#include "dust_collision.hpp" #include "gaussian_bump.hpp" #include "linear_wave.hpp" #include "shock.hpp" @@ -58,6 +60,10 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { strat::ProblemGenerator(pmb, pin); } else if (name == "thermalization") { thermalization::ProblemGenerator(pmb, pin); + } else if (name == "dust_collision") { + dust_collision::ProblemGenerator(pmb, pin); + } else if (name == "dust_coagulation") { + dust_coagulation::ProblemGenerator(pmb, pin); } else { PARTHENON_FAIL("Invalid problem name!"); } diff --git a/src/pgen/problem_modifier.hpp b/src/pgen/problem_modifier.hpp index 1b93dee1..88f39564 100644 --- a/src/pgen/problem_modifier.hpp +++ b/src/pgen/problem_modifier.hpp @@ -126,6 +126,8 @@ void ProblemModifier(parthenon::ParthenonManager *pman) { strat::ExtrapInnerX3); pman->app_input->RegisterBoundaryCondition(BF::outer_x3, "extrap", strat::ExtrapOuterX3); + } else if (artemis_problem == "dust_collision") { + pman->app_input->PreStepMeshUserWorkInLoop = dust_collision::PreStepUserWorkInLoop; } // Register jaybenne swarm boundary conditions From b191975fc8b1c8708e09a5bdf3201e8ac19b516f Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 3 Dec 2024 23:19:41 -0700 Subject: [PATCH 02/38] add files from gitlab/sli/coagulation branch and merge with develop --- inputs/dust/SI_strat1_amr_BA.in | 146 ++++++ inputs/dust/SI_strat_AB.in | 135 +++++ inputs/dust/SI_strat_BA.in | 135 +++++ inputs/dust/disk_cyl_dust10.in | 105 ++++ inputs/dust/dust_coagulation.in | 109 ++++ inputs/dust/dust_coagulation_den.in | 108 ++++ inputs/dust/dust_collision.in | 86 ++++ src/dust/coagulation/coagulation.cpp | 308 ++++++++++++ src/dust/coagulation/coagulation.hpp | 719 +++++++++++++++++++++++++++ src/pgen/dust_coagulation.hpp | 190 +++++++ src/pgen/dust_collision.hpp | 239 +++++++++ 11 files changed, 2280 insertions(+) create mode 100644 inputs/dust/SI_strat1_amr_BA.in create mode 100644 inputs/dust/SI_strat_AB.in create mode 100644 inputs/dust/SI_strat_BA.in create mode 100644 inputs/dust/disk_cyl_dust10.in create mode 100644 inputs/dust/dust_coagulation.in create mode 100644 inputs/dust/dust_coagulation_den.in create mode 100644 inputs/dust/dust_collision.in create mode 100644 src/dust/coagulation/coagulation.cpp create mode 100644 src/dust/coagulation/coagulation.hpp create mode 100644 src/pgen/dust_coagulation.hpp create mode 100644 src/pgen/dust_collision.hpp diff --git a/inputs/dust/SI_strat1_amr_BA.in b/inputs/dust/SI_strat1_amr_BA.in new file mode 100644 index 00000000..8e3e24ba --- /dev/null +++ b/inputs/dust/SI_strat1_amr_BA.in @@ -0,0 +1,146 @@ +# ======================================================================================== +# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +# ======================================================================================== + + +problem = SI_strat # name of the pgen +coordinates = cartesian + + +problem_id = runBA # problem ID: basename of output filenames + + +file_type = hst +dt = 0.01 + + +variables = gas.prim.density, & + gas.prim.velocity, & + dust.prim.density, & + dust.prim.velocity + +file_type = hdf5 # HDF5 data dump +dt = 2.0 # time increment between outputs + + +file_type = rst +dt = 100.0 + + +nlim = -1 # cycle limit +tlim = 400.0 # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 100 # interval for stdout summary info + + +nx1 = 1024 # Number of zones in X1-direction +x1min = -0.4 # minimum value of X1 +x1max = 0.4 # maximum value of X1 +ix1_bc = extrapolate # Inner-X1 boundary condition flag +ox1_bc = extrapolate # Outer-X1 boundary condition flag + +nx2 = 512 # Number of zones in X2-direction +x2min = -0.2 # minimum value of X2 +x2max = 0.2 # maximum value of X2 +ix2_bc = extrapolate # Inner-X2 boundary condition flag +ox2_bc = extrapolate # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag + +# nghost = 2 +refinement = static +numlevel = 2 #3 + + +x1min = -0.3 +x1max = 0.3 +x2min = -0.02 +x2max = 0.02 +level = 1 + + + + +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 16 # Number of cells in each MeshBlock, X2-dir +nx3 = 16 # Number of cells in each MeshBlock, X3-dir + + +gas = true +gravity = false +rotating_frame = true +dust = true + + +cfl = 0.6 +gamma = 1.000001 +reconstruct = plm +riemann = hlle +dfloor = 1.0e-10 +siefloor = 1.0e-10 +refine_field = density +refine_type = magnitude +refine_thr = 3.0 +deref_thr = 0.8 + + +reconstruct = plm +riemann = hlle +nspecies = 1 +const_stopping_time = true +size_input = none +stopping_time = 0.3 +Hratio = 0.1 + +hst_out_d2g = true +Kai0 = 0.1 #2*etaVk*iso_cs + +enable_dust_drag = true +enable_dust_feedback = true +drag_method = implicit +#rho_p = 1.25 +#rho_g0 = 0.3555 #g/cm^2, code-to-physical convert +#user_input_size = true +#Size_1 = 10.0 # dust size + + + +#type = uniform +#gx1 = 0.1 # 2*etaVk*Ome0 +#gx2 = 0.0 +#gx3 = 0.0 + +#type = point +#gm = 1e-5 +#soft = .03 +#x = 0 +#y = 0 +#z = 0 + + +omega = 1.0 +qshear = 1.5 +shboxcoord = 2 # 1=xy; 2=xz +stratified_flag = true + + +rho0 = 0.3989422804 #1.0/sqrt(2*pi) +dens_min = 1.0e-10 +pres_min = 1.0e-13 +h = 1.0 +etaVk = 0.05 +amp = 0.1 +dust_to_gas = 0.04 diff --git a/inputs/dust/SI_strat_AB.in b/inputs/dust/SI_strat_AB.in new file mode 100644 index 00000000..0cd69530 --- /dev/null +++ b/inputs/dust/SI_strat_AB.in @@ -0,0 +1,135 @@ +# ======================================================================================== +# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +# ======================================================================================== + + +problem = SI_strat # name of the pgen +coordinates = cartesian + + +problem_id = runAB # problem ID: basename of output filenames + + +file_type = hst +dt = 0.01 + + +variables = gas.prim.density, & + gas.prim.velocity, & + dust.prim.density, & + dust.prim.velocity + +file_type = hdf5 # HDF5 data dump +dt = 0.5 # time increment between outputs + + +file_type = rst +dt = 20.0 + + +nlim = -1 # cycle limit +tlim = 40.0 # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 20 # interval for stdout summary info + + +nx1 = 512 # Number of zones in X1-direction +x1min = -0.05 # minimum value of X1 +x1max = 0.05 # maximum value of X1 +ix1_bc = extrapolate # Inner-X1 boundary condition flag +ox1_bc = extrapolate # Outer-X1 boundary condition flag + +nx2 = 512 # Number of zones in X2-direction +x2min = -0.05 # minimum value of X2 +x2max = 0.05 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag + +# nghost = 2 +# refinement = adaptive +# numlevel = 4 + + +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 16 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir + + +gas = true +gravity = false +rotating_frame = true +dust = true + + +cfl = 0.6 +gamma = 1.000001 +reconstruct = plm +riemann = hlle +dfloor = 1.0e-10 +siefloor = 1.0e-10 +refine_field = density +refine_type = magnitude +refine_thr = 3.0 +deref_thr = 0.8 + + +reconstruct = plm +riemann = hlle +nspecies = 1 +const_stopping_time = true +size_input = none +stopping_time = 0.1 +hst_out_d2g = true +Kai0 = 0.1 #2*etaVk*iso_cs + +enable_dust_drag = true +enable_dust_feedback = true +drag_method = explicit +#rho_p = 1.25 +#rho_g0 = 0.3555 #g/cm^2, code-to-physical convert +#user_input_size = true +#Size_1 = 10.0 # dust size + + + +#type = uniform +#gx1 = 0.1 # 2*etaVk*Ome0 +#gx2 = 0.0 +#gx3 = 0.0 + +#type = point +#gm = 1e-5 +#soft = .03 +#x = 0 +#y = 0 +#z = 0 + + +omega = 1.0 +qshear = 1.5 +shboxcoord = 2 # 1=xy; 2=xz +stratified_flag = false + + +rho0 = 1.0 +dens_min = 1.0e-10 +pres_min = 1.0e-13 +h = 1.0 +etaVk = 0.05 +amp = 0.25 +dust_to_gas = 1.0 diff --git a/inputs/dust/SI_strat_BA.in b/inputs/dust/SI_strat_BA.in new file mode 100644 index 00000000..edb8cafc --- /dev/null +++ b/inputs/dust/SI_strat_BA.in @@ -0,0 +1,135 @@ +# ======================================================================================== +# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +# ======================================================================================== + + +problem = SI_strat # name of the pgen +coordinates = cartesian + + +problem_id = runBA # problem ID: basename of output filenames + + +file_type = hst +dt = 0.02 + + +variables = gas.prim.density, & + gas.prim.velocity, & + dust.prim.density, & + dust.prim.velocity + +file_type = hdf5 # HDF5 data dump +dt = 10 # time increment between outputs + + +file_type = rst +dt = 100.0 + + +nlim = -1 # cycle limit +tlim = 800.0 # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 20 # interval for stdout summary info + + +nx1 = 512 # Number of zones in X1-direction +x1min = -1.0 # minimum value of X1 +x1max = 1.0 # maximum value of X1 +ix1_bc = extrapolate # Inner-X1 boundary condition flag +ox1_bc = extrapolate # Outer-X1 boundary condition flag + +nx2 = 512 # Number of zones in X2-direction +x2min = -1.0 # minimum value of X2 +x2max = 1.0 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag + +# nghost = 2 +# refinement = adaptive +# numlevel = 4 + + +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 16 # Number of cells in each MeshBlock, X2-dir +nx3 = 16 # Number of cells in each MeshBlock, X3-dir + + +gas = true +gravity = false +rotating_frame = true +dust = true + + +cfl = 0.6 +gamma = 1.000001 +reconstruct = plm +riemann = hlle +dfloor = 1.0e-10 +siefloor = 1.0e-10 +refine_field = density +refine_type = magnitude +refine_thr = 3.0 +deref_thr = 0.8 + + +reconstruct = plm +riemann = hlle +nspecies = 1 +const_stopping_time = true +size_input = none +stopping_time = 1.0 +hst_out_d2g = true +Kai0 = 0.1 #2*etaVk*iso_cs + +enable_dust_drag = true +enable_dust_feedback = true +drag_method = implicit +#rho_p = 1.25 +#rho_g0 = 0.3555 #g/cm^2, code-to-physical convert +#user_input_size = true +#Size_1 = 10.0 # dust size + + + +#type = uniform +#gx1 = 0.1 # 2*etaVk*Ome0 +#gx2 = 0.0 +#gx3 = 0.0 + +#type = point +#gm = 1e-5 +#soft = .03 +#x = 0 +#y = 0 +#z = 0 + + +omega = 1.0 +qshear = 1.5 +shboxcoord = 2 # 1=xy; 2=xz +stratified_flag = false + + +rho0 = 1.0 +dens_min = 1.0e-10 +pres_min = 1.0e-13 +h = 1.0 +etaVk = 0.05 +amp = 0.1 +dust_to_gas = 0.2 diff --git a/inputs/dust/disk_cyl_dust10.in b/inputs/dust/disk_cyl_dust10.in new file mode 100644 index 00000000..79bed84e --- /dev/null +++ b/inputs/dust/disk_cyl_dust10.in @@ -0,0 +1,105 @@ +# ======================================================================================== +# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +# ======================================================================================== + + +problem = disk # name of the pgen +coordinates = axisymmetric #cylindrical # coordinate system + + +problem_id = disk_cyl # problem ID: basename of output filenames + + +file_type = hst +dt = 0.5 + + +variables = gas.prim.density, & + gas.prim.velocity, & + gas.prim.pressure, & + dust.prim.density, & + dust.prim.velocity, & + dust.stopping_time +file_type = hdf5 # HDF5 data dump +dt = 5.0 # time increment between outputs + + +nlim = -1 # cycle limit +tlim = 62.8 # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 1 # interval for stdout summary info + + +nx1 = 128 # Number of zones in X1-direction +x1min = 0.4 # minimum value of X1 +x1max = 2.0 # maximum value of X1 +ix1_bc = ic # Inner-X1 boundary condition flag +ox1_bc = ic # Outer-X1 boundary condition flag + +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 +x2max = 6.283185307179586 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = outflow # Inner-X3 boundary condition flag +ox3_bc = outflow # Outer-X3 boundary condition flag + + +nx1 = 128 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir + + +gas = true +dust = true +gravity = true + + +cfl = 0.8 +gamma = 1.01 +reconstruct = plm +riemann = hllc +dfloor = 1.0e-10 +siefloor = 1.0e-10 + + +reconstruct = plm +riemann = hlle +nspecies = 1 +const_stopping_time = false +enable_dust_drag = true +enable_dust_feedback = true +drag_method = implicit +grain_density = 1.25 +#rho_g0 = 0.3555 #g/cm^2, code-to-physical convert +size_input = direct +sizes = 10.0 # dust size, cm +surface_density_flag = true; #surface or volume density + + +gm = 1.0 + + + +r0 = 1.0 +rho0 = 1.0e-4 #pre-factor +dslope = -1.0 +tslope = -0.5 +h0 = 0.05 +dens_min = 1.0e-10 +pres_min = 1.0e-13 +mstar = 1.0 # Msun +r0_length = 10.0 # AU diff --git a/inputs/dust/dust_coagulation.in b/inputs/dust/dust_coagulation.in new file mode 100644 index 00000000..36455d5d --- /dev/null +++ b/inputs/dust/dust_coagulation.in @@ -0,0 +1,109 @@ +# ======================================================================================== +# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +# ======================================================================================== + + +problem = dust_coagulation # name of the pgen +coordinates = cartesian # coordinate system + + +problem_id = coag # problem ID: basename of output filenames + + + +file_type = hst +dt = 0.628 + + +variables = gas.prim.density, & + dust.prim.density +file_type = hdf5 # tab data dump +dt = 62.8 # time increment between outputs + + +file_type = rst +dt = 628 + + +nlim = -1 # cycle limit +tlim = 6280. # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 1 # interval for stdout summary info + + +nghost = 2 +refinement = none +# numlevel = 1 + +nx1 = 16 # Number of zones in X1-direction +x1min = 9.0 # minimum value of X1 +x1max = 11.0 # maximum value of X1 +ix1_bc = outflow # Inner-X1 boundary condition flag +ox1_bc = outflow # Outer-X1 boundary condition flag + +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 +x2max = 6.283185307179586 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag + + +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir + + +gas = true +dust = true +coagulation = true + + +cfl = 0.9 +gamma = 1.00001 +iso_sound_speed = 0.05 + + +cfl = 0.9 +nspecies = 121 +const_stopping_time = false +enable_dust_drag = false +enable_dust_feedback = false +drag_method = implicit +#user_dt = 0.005 + + +scr_level = 1 # for reconstruction +surface_density_flag = true +grain_density = 1.25 # dust internal density g/cc +size_input = logspace +min_size = 1e-5 #cm +max_size = 10.0 #cm +vfrag = 1000.0 $cm/s +coag_int = 1 +coag_use_adaptiveStep = false +coag_mom_preserve = true + + + +nInit_dust = 11 # number of dust species initially +dust_to_gas = 0.01 +nstep1Coag = 10 +mstar = 1.0 # central star masss (m_sun) +r0_length = 10.0 # 1 code unit (AU) +rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 + diff --git a/inputs/dust/dust_coagulation_den.in b/inputs/dust/dust_coagulation_den.in new file mode 100644 index 00000000..be3707b6 --- /dev/null +++ b/inputs/dust/dust_coagulation_den.in @@ -0,0 +1,108 @@ +# ======================================================================================== +# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +# ======================================================================================== + + +problem = dust_coagulation # name of the pgen +coordinates = cartesian # coordinate system + + +problem_id = coag # problem ID: basename of output filenames + + + +file_type = hst +dt = 0.628 + + +variables = gas.prim.density, & + dust.prim.density +file_type = hdf5 # tab data dump +dt = 62.8 # time increment between outputs + + +file_type = rst +dt = 628 + + +nlim = -1 # cycle limit +tlim = 6280. # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 1 # interval for stdout summary info + + +nghost = 2 +refinement = none +# numlevel = 1 + +nx1 = 16 # Number of zones in X1-direction +x1min = 9.0 # minimum value of X1 +x1max = 11.0 # maximum value of X1 +ix1_bc = outflow # Inner-X1 boundary condition flag +ox1_bc = outflow # Outer-X1 boundary condition flag + +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 +x2max = 6.283185307179586 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag + + +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir + + +gas = true +dust = true +coagulation = true + + +cfl = 0.9 +gamma = 1.00001 +iso_sound_speed = 0.05 + + +cfl = 0.9 +nspecies = 121 +const_stopping_time = false +enable_dust_drag = false +enable_dust_feedback = false +drag_method = implicit +#user_dt = 0.005 + +scr_level = 1 # for reconstruction +surface_density_flag = false +grain_density = 1.25 # dust internal density g/cc +min_size = 1e-5 #cm +max_size = 10.0 #cm +size_input = logspace +vfrag = 1000.0 $cm/s +coag_int = 1 +coag_use_adaptiveStep = false +coag_mom_preserve = false + + + +nInit_dust = 11 # number of dust species initially +dust_to_gas = 0.01 +nstep1Coag = 10 +mstar = 1.0 # central star masss (m_sun) +r0_length = 10.0 # 1 code unit (AU) +#rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 +rho0 = 1.59577e-4 # 3D rho diff --git a/inputs/dust/dust_collision.in b/inputs/dust/dust_collision.in new file mode 100644 index 00000000..09a08df8 --- /dev/null +++ b/inputs/dust/dust_collision.in @@ -0,0 +1,86 @@ +# ======================================================================================== +# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +# ======================================================================================== + + +problem = dust_collision # name of the pgen +coordinates = cartesian # coordinate system + + +problem_id = dc_B # problem ID: basename of output filenames + + +variables = gas.prim.density, & + gas.prim.velocity, & + gas.prim.pressure, & + dust.prim.density, & + dust.prim.velocity +file_type = hdf5 # tab data dump +dt = 0.05 # time increment between outputs + + +nlim = -1 # cycle limit +tlim = 0.05 # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 1 # interval for stdout summary info + + +nghost = 2 +refinement = none +# numlevel = 1 + +nx1 = 16 # Number of zones in X1-direction +x1min = 0.0 # minimum value of X1 +x1max = 1.0 # maximum value of X1 +ix1_bc = periodic # Inner-X1 boundary condition flag +ox1_bc = periodic # Outer-X1 boundary condition flag + +nx2 = 1 # Number of zones in X2-direction +x2min = -0.5 # minimum value of X2 +x2max = 0.5 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag + + +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir + + +gas = true +dust = true + + +cfl = 0.9 +gamma = 1.4 +iso_sound_speed = 0.1 + + +cfl = 0.9 +nspecies = 2 +const_stopping_time = true +enable_dust_drag = true +enable_dust_feedback = true +drag_method = implicit +user_dt = 0.005 + +size_input = none +stopping_time = 0.01, 0.002 + + +iprob = 1 diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp new file mode 100644 index 00000000..84315987 --- /dev/null +++ b/src/dust/coagulation/coagulation.cpp @@ -0,0 +1,308 @@ +//======================================================================================== +// (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +// +// This program was produced under U.S. Government contract 89233218CNA000001 for Los +// Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +// for the U.S. Department of Energy/National Nuclear Security Administration. All rights +// in the program are reserved by Triad National Security, LLC, and the U.S. Department +// of Energy/National Nuclear Security Administration. The Government is granted for +// itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +// license in this material to reproduce, prepare derivative works, distribute copies to +// the public, perform publicly and display publicly, and to permit others to do so. +//======================================================================================== + +// Artemis includes +#include "dust/coagulation/coagulation.hpp" +#include "artemis.hpp" +#include "dust/dust.hpp" +#include "geometry/geometry.hpp" + +using namespace parthenon::package::prelude; + +namespace Dust { +namespace Coagulation { +//---------------------------------------------------------------------------------------- +//! \fn StateDescriptor Coagulalation::Initialize +//! \brief Adds intialization function for coagulation package +std::shared_ptr Initialize(ParameterInput *pin) { + auto coag = std::make_shared("coagulation"); + Params ¶ms = coag->AllParams(); + + CoagParams cpars; + const int nm = pin->GetOrAddInteger("dust", "nspecies", 1); + cpars.nm = nm; + cpars.vfrag = pin->GetOrAddReal("dust", "vfrag", 1.e3); // cm/s + cpars.nlim = 1e10; + cpars.integrator = pin->GetOrAddInteger("dust", "coag_int", 3); + cpars.use_adaptive = pin->GetOrAddBoolean("dust", "coag_use_adaptiveStep", true); + cpars.mom_coag = pin->GetOrAddBoolean("dust", "coag_mom_preserve", true); + cpars.nCall_mx = pin->GetOrAddInteger("dust", "coag_nsteps_mx", 1000); + // dust particle internal density g/cc + const Real rho_p = pin->GetOrAddReal("dust", "rho_p", 1.25); + cpars.rho_p = rho_p; + + cpars.ibounce = pin->GetOrAddBoolean("dust", "coag_bounce", false); + + int coord_type = 0; // density + + const bool isurface_den = pin->GetOrAddBoolean("dust", "surface_density_flag", true); + if (isurface_den) coord_type = 1; + cpars.coord = coord_type; // 1--surface density, 0: 3D + + cpars.err_eps = 1.0e-1; + cpars.S = 0.9; + cpars.cfl = 1.0e-1; + cpars.chi = 1.0; + + // some checks and definition + if (cpars.use_adaptive) { + if (cpars.integrator == 3) { + cpars.pgrow = -0.5; + cpars.pshrink = -1.0; + } else if (cpars.integrator == 5) { + cpars.pgrow = -0.2; + cpars.pshrink = -0.25; + } else { + std::stringstream msg; + msg << "### FATAL ERROR in dust coagulation initialization: " << std::endl + << "### You can not use this integrator with adaptive step sizing: " + << cpars.integrator << std::endl; + PARTHENON_FAIL(msg); + } + cpars.errcon = std::pow((5. / cpars.S), (1. / cpars.pgrow)); + } + + const Real s_min = pin->GetReal("dust", "min_size"); + const Real s_max = pin->GetReal("dust", "max_size"); + const Real mmin = 4.0 * M_PI / 3.0 * rho_p * std::pow(s_min, 3); + const Real mmax = 4.0 * M_PI / 3.0 * rho_p * std::pow(s_max, 3); + const Real cond = 1.0 / (1.0 - nm) * std::log(mmin / mmax); + const Real conc = std::log(mmin); + if (std::exp(cond) > std::sqrt(2.0)) { + std::stringstream msg; + msg << "### FATAL ERROR in dust with coagulation: using nspecies >" + << std::log(mmax / mmin) / (std::log(std::sqrt(2.0))) + 1. << " instead of " << nm + << std::endl; + PARTHENON_FAIL(msg); + } + + ParArray1D dust_size("dustSize", nm); + auto dust_size_host = dust_size.GetHostMirror(); + + for (int n = 0; n < nm; ++n) { + Real mgrid = std::exp(conc + cond * n); + dust_size_host(n) = std::pow(3.0 * mgrid / (4.0 * M_PI * cpars.rho_p), 1. / 3.); + } + dust_size.DeepCopy(dust_size_host); + + // allocate array and assign values + cpars.klf = ParArray2D("klf", nm, nm); + cpars.mass_grid = ParArray1D("mass_grid", nm); + const int n2DRv = coag2DRv::last2; + cpars.coagR3D = ParArray3D("coagReal3D", n2DRv, nm, nm); + cpars.cpod_notzero = ParArray3D("idx_nzcpod", nm, nm, 4); + cpars.cpod_short = ParArray3D("nzcpod", nm, nm, 4); + + if (Dust::cgsunit == NULL) { + Dust::cgsunit = new CGSUnit; + } + if (!Dust::cgsunit->isSet()) { + Dust::cgsunit->SetCGSUnit(pin); + } + const Real dfloor = pin->GetOrAddReal("dust", "dfloor", 1.0e-25); + // convert to CGS unit + cpars.dfloor = dfloor * Dust::cgsunit->mass0 / Dust::cgsunit->vol0; + Real a = std::log10(mmin / mmax) / static_cast(1 - nm); + + initializeArray(nm, cpars.pGrid, cpars.rho_p, cpars.chi, a, dust_size, cpars.klf, + cpars.mass_grid, cpars.coagR3D, cpars.cpod_notzero, cpars.cpod_short); + + params.Add("coag_pars", cpars); + + // other parameters for coagulation + const int nstep1Coag = pin->GetOrAddReal("problem", "nstep1Coag", 50); + params.Add("nstep1Coag", nstep1Coag); + Real dtCoag = 0.0; + params.Add("dtCoag", dtCoag, Params::Mutability::Restart); + const Real alpha = pin->GetOrAddReal("dust", "coag_alpha", 1.e-3); + params.Add("coag_alpha", alpha); + const int scr_level = pin->GetOrAddReal("dust", "coag_scr_level", 0); + params.Add("coag_scr_level", scr_level); + + return coag; +} + +// using Kokkos par_for() loop +void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &chi, + const Real &a, const ParArray1D dsize, ParArray2D klf, + ParArray1D mass_grid, ParArray3D coag3D, + ParArray3D cpod_notzero, ParArray3D cpod_short) { + + int ikdelta = coag2DRv::kdelta; + auto kdelta = Kokkos::subview(coag3D, ikdelta, Kokkos::ALL, Kokkos::ALL); + int icoef_fett = coag2DRv::coef_fett; + auto coef_fett = Kokkos::subview(coag3D, icoef_fett, Kokkos::ALL, Kokkos::ALL); + parthenon::par_for( + parthenon::loop_pattern_flatrange_tag, "initializeCoag1", parthenon::DevExecSpace(), + 0, nm - 1, KOKKOS_LAMBDA(const int i) { + // initialize in_idx(*) array + // initialize kdelta array + for (int j = 0; j < nm; j++) { + kdelta(i, j) = 0.0; + } + kdelta(i, i) = 1.0; + mass_grid(i) = 4.0 * M_PI / 3.0 * rho_p * std::pow(dsize(i), 3); + // initialize coef_fett(*,*) + for (int j = 0; j < nm; j++) { + Real tmp1 = (1.0 - 0.5 * kdelta(i, j)); + coef_fett(i, j) = M_PI * SQR(dsize(i) + dsize(j)) * tmp1; + } + }); + + // set fragmentation variables + // Real a = std::log10(massGrid_h(0) / massGrid_h(nm - 1)) / (1 - nm); + Real ten_a = std::pow(10.0, a); + Real ten_ma = 1.0 / ten_a; + int ce = int(-1.0 / a * std::log10(1.0 - ten_ma)) + 1; + + pGrid = floor(1.0 / a); // used in integration + + Real frag_slope = 2.0 - 11.0 / 6.0; + + int iphiFrag = coag2DRv::phiFrag, iepsFrag = coag2DRv::epsFrag; + int iaFrag = coag2DRv::aFrag; + auto phiFrag = Kokkos::subview(coag3D, iphiFrag, Kokkos::ALL, Kokkos::ALL); + auto epsFrag = Kokkos::subview(coag3D, iepsFrag, Kokkos::ALL, Kokkos::ALL); + auto aFrag = Kokkos::subview(coag3D, iaFrag, Kokkos::ALL, Kokkos::ALL); + parthenon::par_for( + parthenon::loop_pattern_flatrange_tag, "initializeCoag2", parthenon::DevExecSpace(), + 0, nm - 1, KOKKOS_LAMBDA(const int i) { + Real sum_pF = 0.0; + for (int j = 0; j <= i; j++) { + phiFrag(j, i) = std::pow(mass_grid(j), frag_slope); + sum_pF += phiFrag(j, i); + } + // normalization + for (int j = 0; j <= i; j++) { + phiFrag(j, i) /= sum_pF; // switch (i,j) from fortran + } + + // Cratering + for (int j = 0; j <= i - pGrid - 1; j++) { + // FRAGMENT DISTRIBUTION + // The largest fragment has the mass of the smaller collision partner + + // Mass bin of largest fragment + klf(i, j) = j; + + aFrag(i, j) = (1.0 + chi) * mass_grid(j); + // |_____________| + // | + // Mass of fragments + epsFrag(i, j) = chi * mass_grid(j) / (mass_grid(i) * (1.0 - ten_ma)); + } + + int i1 = std::max(0, i - pGrid); + for (int j = i1; j <= i; j++) { + // The largest fragment has the mass of the larger collison partner + klf(i, j) = i; + aFrag(i, j) = (mass_grid(i) + mass_grid(j)); + } + }); + + // initialize dalp array + // Calculate the D matrix + // Calculate the E matrix + ParArray2D e("epod", nm, nm); + int idalp = coag2DRv::dalp, idpod = coag2DRv::dpod; + auto dalp = Kokkos::subview(coag3D, idalp, Kokkos::ALL, Kokkos::ALL); + auto dpod = Kokkos::subview(coag3D, idpod, Kokkos::ALL, Kokkos::ALL); + parthenon::par_for( + parthenon::loop_pattern_flatrange_tag, "initializeCoag4", parthenon::DevExecSpace(), + 0, nm - 1, KOKKOS_LAMBDA(const int k) { + for (int j = 0; j < nm; j++) { + if (j <= k + 1 - ce) { + dalp(k, j) = 1.0; + dpod(k, j) = -mass_grid(j) / (mass_grid(k) * (ten_a - 1.0)); + } else { + dpod(k, j) = -1.0; + dalp(k, j) = 0.0; + } + } + // for E matrix------------- + Real mkkme = mass_grid(k) * (1.0 - ten_ma); + Real mkpek = mass_grid(k) * (ten_a - 1.0); + Real mkpeme = mass_grid(k) * (ten_a - ten_ma); + for (int j = 0; j < nm; ++j) { + if (j <= k - ce) { + e(k, j) = mass_grid(j) / mkkme; + } else { + Real theta1 = (mkpeme - mass_grid(j) < 0.0) ? 0.0 : 1.0; + e(k, j) = (1.0 - (mass_grid(j) - mkkme) / mkpek) * theta1; + } + } + }); + + // calculate the coagualtion variables + ParArray3D cpod("cpod", nm, nm, nm); + + // initialize cpod array; + parthenon::par_for( + parthenon::loop_pattern_mdrange_tag, "initializeCoag6", parthenon::DevExecSpace(), + 0, nm - 1, 0, nm - 1, KOKKOS_LAMBDA(const int i, const int j) { + // initialize to zero first + for (int k = 0; k < nm; k++) { + cpod(i, j, k) = 0.0; + } + Real mloc = mass_grid(i) + mass_grid(j); + if (mloc < mass_grid(nm - 1)) { + int gg = 0; + for (int k = std::max(i, j); k < nm - 1; k++) { + if (mloc >= mass_grid(k) && mloc < mass_grid(k + 1)) { + gg = k; + break; + } + } + + cpod(i, j, gg) = + (mass_grid(gg + 1) - mloc) / (mass_grid(gg + 1) - mass_grid(gg)); + cpod(i, j, gg + 1) = 1.0 - cpod(i, j, gg); + + // modified cpod(*) array------------------------- + Real dtheta_ji = (j - i - 0.5 < 0.0) ? 0.0 : 1.0; // theta(j - i - 0.5); + for (int k = 0; k < nm; k++) { + Real theta_kj = (k - j - 1.5 < 0.0) ? 0.0 : 1.0; // theta(k - j - 1.5) + cpod(i, j, k) = (0.5 * kdelta(i, j) * cpod(i, j, k) + + cpod(i, j, k) * theta_kj * dtheta_ji); + } + cpod(i, j, j) += dpod(j, i); + cpod(i, j, j + 1) += e(j + 1, i) * dtheta_ji; + + } // end if + }); + + // initialize cpod_nonzero and cpod_short array + parthenon::par_for( + parthenon::loop_pattern_mdrange_tag, "initializeCoag7", parthenon::DevExecSpace(), + 0, nm - 1, 0, nm - 1, KOKKOS_LAMBDA(const int i, const int j) { + if (j <= i) { + // initialize cpod_notzero(i, j, 4) and cpod_short(i, j, 4) + for (int k = 0; k < 4; k++) { + cpod_notzero(i, j, k) = 0; + cpod_short(i, j, k) = 0.0; + } + int inc = 0; + for (int k = 0; k < nm; ++k) { + Real dum = cpod(i, j, k) + cpod(j, i, k); + if (dum != 0.0) { + cpod_notzero(i, j, inc) = k; + cpod_short(i, j, inc) = dum; + inc++; + } + } + } + }); +} + +} // namespace Coagulation +} // namespace Dust diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp new file mode 100644 index 00000000..454e0db0 --- /dev/null +++ b/src/dust/coagulation/coagulation.hpp @@ -0,0 +1,719 @@ +//======================================================================================== +// (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +// +// This program was produced under U.S. Government contract 89233218CNA000001 for Los +// Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +// for the U.S. Department of Energy/National Nuclear Security Administration. All rights +// in the program are reserved by Triad National Security, LLC, and the U.S. Department +// of Energy/National Nuclear Security Administration. The Government is granted for +// itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +// license in this material to reproduce, prepare derivative works, distribute copies to +// the public, perform publicly and display publicly, and to permit others to do so. +//======================================================================================== +#ifndef DUST_COAGULATION_HPP_ +#define DUST_COAGULATION_HPP_ + +#include "utils/artemis_utils.hpp" + +//#define COAGULATION_DEBUG +namespace Dust { +namespace Coagulation { + +enum coag2DRv { dpod, aFrag, phiFrag, epsFrag, dalp, kdelta, coef_fett, last2 }; + +std::shared_ptr Initialize(ParameterInput *pin); + +struct CoagParams { + int coord = 0; // 1--surface density, 0: 3D + + int nm; + int nCall_mx = 1000; + bool ibounce = false; + Real nlim; + Real rho_p; + Real vfrag; + Real dfloor; + int integrator; + bool use_adaptive; // adaptive step size + bool mom_coag; // mom-preserving coagulation + + int pGrid; + Real chi; + Real pgrow; // Power for increasing step size + Real pshrink; // Power for decreasing step size + Real err_eps; // Relative tolerance for adaptive step sizing + Real S; // Safety margin for adaptive step sizing + Real cfl; + Real errcon; // Needed for increasing step size + + // pre-calculated array, once-for-all + ParArray2D klf; + ParArray1D mass_grid; + ParArray3D coagR3D; + ParArray3D cpod_notzero; + ParArray3D cpod_short; +}; + +void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &chi, + const Real &a, const ParArray1D dsize, ParArray2D klf, + ParArray1D mass_grid, ParArray3D coag3D, + ParArray3D cpod_notzero, ParArray3D cpod_short); + +KOKKOS_INLINE_FUNCTION +Real v_rel_ormel(Real tau_1, Real tau_2, Real t0, Real v0, Real ts, Real vs, + Real reynolds) { + Real st1, st2, tau_mx, tau_mn, vg2; + Real c0, c1, c2, c3, y_star, ya, eps; + Real hulp1, hulp2; + + // sort tau's 1--> correspond to the max. now + if (tau_1 >= tau_2) { + tau_mx = tau_1; + tau_mn = tau_2; + st1 = tau_mx / t0; + st2 = tau_mn / t0; + } else { + tau_mx = tau_2; + tau_mn = tau_1; + st1 = tau_mx / t0; + st2 = tau_mn / t0; + } + + vg2 = 1.5 * pow(v0, 2); // note the square + ya = 1.6; // approximate solution for st*=y*st1; valid for st1 << 1. + + Real sqRe = 1.0 / sqrt(reynolds); + if (tau_mx < 0.2 * ts) { + // very small regime + return 1.5 * pow((vs / ts * (tau_mx - tau_mn)), 2); + } else if (tau_mx < ts / ya) { + return vg2 * (st1 - st2) / (st1 + st2) * + (pow(st1, 2) / (st1 + sqRe) - pow(st2, 2) / (st2 + sqRe)); + } else if (tau_mx < 5.0 * ts) { + // eq. 17 of oc07. the second term with st_i**2.0 is negligible (assuming re>>1) + // hulp1 = eq. 17; hulp2 = eq. 18 + hulp1 = ((st1 - st2) / (st1 + st2) * + (pow(st1, 2) / (st1 + ya * st1) - + pow(st2, 2) / (st2 + ya * st1))); // note the -sign + hulp2 = 2.0 * (ya * st1 - sqRe) + pow(st1, 2.0) / (ya * st1 + st1) - + pow(st1, 2) / (st1 + sqRe) + pow(st2, 2) / (ya * st1 + st2) - + pow(st2, 2) / (st2 + sqRe); + return vg2 * (hulp1 + hulp2); + } else if (tau_mx < t0 / 5.0) { + // full intermediate regime + eps = st2 / st1; // stopping time ratio + return vg2 * + (st1 * (2.0 * ya - (1.0 + eps) + + 2.0 / (1.0 + eps) * (1.0 / (1.0 + ya) + pow(eps, 3) / (ya + eps)))); + } else if (tau_mx < t0) { + // now y* lies between 1.6 (st1 << 1) and 1.0 (st1>=1). the fit below fits ystar to + // less than 1% + c3 = -0.29847604; + c2 = 0.32938936; + c1 = -0.63119577; + c0 = 1.6015125; + y_star = c0 + c1 * st1 + c2 * pow(st1, 2) + c3 * pow(st1, 3); + // we can then employ the same formula as before + eps = st2 / st1; // stopping time ratio + return vg2 * (st1 * (2.0 * y_star - (1.0 + eps) + + 2.0 / (1.0 + eps) * + (1.0 / (1.0 + y_star) + pow(eps, 3) / (y_star + eps)))); + } else { + // heavy particle limit + return vg2 * (1.0 / (1.0 + st1) + 1.0 / (1.0 + st2)); + } +} + +KOKKOS_INLINE_FUNCTION +Real theta(Real x) { return (x < 0 ? 0.0 : 1.0); } + +// Function calculates the new Q value of a particle resulting of a +// collision of particles with masses m1, m2 and Q values Q1, Q2 +KOKKOS_INLINE_FUNCTION +Real Qplus(Real m1, Real Q1, Real m2, Real Q2) { return (m1 * Q1 + m2 * Q2) / (m1 + m2); } + +KOKKOS_INLINE_FUNCTION +Real CoagulationRate(const int i, const int j, const Real kernel4[], + const ScratchPad1D &vel, + const ScratchPad1D &stoppingTime, const CoagParams &coag, + const int itype) { + + const Real &mass_gridi = coag.mass_grid(i); + const Real &mass_gridj = coag.mass_grid(j); + const Real &mass_gride = coag.mass_grid(coag.nm - 1); + if (mass_gridi + mass_gridj >= mass_gride) { + return 0.0; + } + + const Real &gasdens = kernel4[0]; + const Real &alpha = kernel4[1]; + const Real &cs = kernel4[2]; + const Real &omega = kernel4[3]; + const Real &tau_i = stoppingTime(i); + const Real &tau_j = stoppingTime(j); + const Real *vel_i = &vel(3 * i); + const Real *vel_j = &vel(3 * j); + + const Real sig_h2 = 2.0e-15; //! cross section of H2 + const Real mu = 2.3; //! mean molecular mass in proton masses + const Real m_p = 1.6726231e-24; //! proton mass in g + + // calculate some basic properties + const Real hg = cs / omega; + Real re = alpha * sig_h2 * gasdens / (2.0 * mu * m_p); + if (coag.coord == 0) { + re *= std::sqrt(2.0 * M_PI) * hg; + } + + const Real tn = 1.0 / omega; + const Real ts = tn / sqrt(re); + const Real vn = std::sqrt(alpha) * cs; + const Real vs = vn * std::pow(re, -0.25); + + // calculate the relative velocities + const Real c1 = 8.0 / M_PI * cs * cs * mu * m_p; + + const Real stokes_i = tau_i * omega; + const Real stokes_j = tau_j * omega; + + // turbulent relative velocity + Real dv0 = v_rel_ormel(tau_i, tau_j, tn, vn, ts, vs, re); + + // Brownian motion relative velocities + const Real mredu = (mass_gridi * mass_gridj / (mass_gridi + mass_gridj)); + dv0 += (c1 / mredu); + + Real dv2_ij; + Real hij = 1.0; + if (coag.coord == 1) { // surface density + const Real hi = + std::min(std::sqrt(alpha / (std::min(0.5, stokes_i) * (SQR(stokes_i) + 1.0))), + 1.0) * + hg; + const Real hj = + std::min(std::sqrt(alpha / (std::min(0.5, stokes_j) * (SQR(stokes_j) + 1.0))), + 1.0) * + hg; + const Real vs_i = std::min(stokes_i, 1.0) * omega * hi; + const Real vs_j = std::min(stokes_j, 1.0) * omega * hj; + // relative velocity from vertical settling + dv2_ij = SQR(vs_i - vs_j); + dv2_ij += (SQR(vel_i[0] - vel_j[0]) + SQR(vel_i[1] - vel_j[1])); + hij = std::sqrt(2.0 * M_PI * (SQR(hi) + SQR(hj))); + } else { + dv2_ij = + (SQR(vel_i[0] - vel_j[0]) + SQR(vel_i[1] - vel_j[1]) + SQR(vel_i[2] - vel_j[2])); + } + + // after adding up all v_rel**2 take the square root + const Real dv = std::sqrt(dv0 + dv2_ij); + + // new pf calculation: for fragmenation + Real pf = 0.0; + if (dv > 0.0) { + const Real tmp = 1.5 * SQR(coag.vfrag / dv); + pf = (tmp + 1.0) * std::exp(-tmp); + } + + int icoef_fett = coag2DRv::coef_fett; + const Real &coef_fettij = coag.coagR3D(icoef_fett, i, j); + if (itype == 0) { // coagulation + if (coag.ibounce && dv > 0.0) { // including bouncing effect + const Real froll = 1e-4; // Heim et al.(PRL) 1999 + const Real amono = 1e-4; // micro-size + const Real vbounce = std::sqrt(5.0 * M_PI * amono * froll / mredu); + if (vbounce < coag.vfrag) { + const Real tmp = 1.5 * SQR(vbounce / dv); + pf = (tmp + 1.0) * std::exp(-tmp); // using bouncing vel + } + } + const Real pc = 1.0 - pf; + return (coef_fettij * dv * pc / hij); + } else { // fragmentation + return (coef_fettij * dv * pf / hij); + } +} + +KOKKOS_INLINE_FUNCTION +void CoagulationSource(parthenon::team_mbr_t const &mbr, ScratchPad1D &source, + const ScratchPad1D &distri, const int mimax, + const Real kernel4[], const ScratchPad1D &vel, + const ScratchPad1D &stoppingTime, const CoagParams &coag) { + + const int nm = coag.nm; + + // initialize source(*) + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int k) { + // for (int k = 0; k < nm; k++) { + source(k) = 0.0; + }); + mbr.team_barrier(); + + // Adding coagulation source terms + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int i) { + // for (int i = 0; i <= mimax; i++) { + for (int j = 0; j <= i; j++) { + // calculate the rate + const Real fett_t = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 0); + const Real Rc1 = distri(i) * distri(j) * fett_t; + for (int nz = 0; nz < 4; nz++) { + const int k = coag.cpod_notzero(i, j, nz); + if (k < 0) continue; + const Real src_coag0 = coag.cpod_short(i, j, nz) * Rc1; + Kokkos::atomic_add(&source(k), src_coag0); + } + } + }); + mbr.team_barrier(); + + // FRAGMENTATION------------------------------------------------------ + + // Adding fragment distribution + const int pGrid = coag.pGrid; + int iaFrag = coag2DRv::aFrag; + int iphiFrag = coag2DRv::phiFrag, iepsFrag = coag2DRv::epsFrag; + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int k) { + // for (int k = 0; k < nm; k++) { + for (int j = k; j <= mimax; j++) { + // calculate As(j) on fly + Real As_j = 0.0; + for (int i2 = 0; i2 <= mimax; i2++) { + for (int j2 = 0; j2 <= i2; j2++) { + // int klf = (j2 <= i2 - pGrid - 1) ? j2 : i2; + // if (klf == j) { + if (coag.klf(i2, j2) == j) { + const Real fett_l = + CoagulationRate(i2, j2, kernel4, vel, stoppingTime, coag, 1); + As_j += coag.coagR3D(iaFrag, i2, j2) * distri(i2) * distri(j2) * fett_l; + } + } + } + source(k) += coag.coagR3D(iphiFrag, k, j) / coag.mass_grid(k) * As_j; + } + }); + mbr.team_barrier(); + + // Negative terms and cratering remnants + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int j) { + Real sum0(0.0); + for (int i = j; i <= mimax; i++) { + const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); + const Real Rf1 = distri(i) * distri(j) * fett_l; + sum0 -= Rf1; + } + source(j) += sum0; + }); + mbr.team_barrier(); + + // for (int i = 0; i <= mimax; i++) { + // Cratering + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int i) { + Real sum0(0.0); + for (int j = 0; j <= i - pGrid - 1; j++) { + const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); + const Real Rf1 = distri(i) * distri(j) * fett_l; + const Real dummy = coag.coagR3D(iepsFrag, i, j) * Rf1; + sum0 += dummy; + } + + if (i - pGrid - 1 >= 0) { + Kokkos::atomic_add(&source(i - 1), sum0); + } + + Real sum1 = -sum0; + // Full fragmentation (only negative terms) + int i1 = std::max(0, i - pGrid); + for (int j = i1; j <= i; j++) { + const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); + const Real Rf1 = distri(i) * distri(j) * fett_l; + sum1 -= Rf1; + } + Kokkos::atomic_add(&source(i), sum1); + }); + mbr.team_barrier(); +} // end of subroutine source + +KOKKOS_INLINE_FUNCTION +void Coagulation_nQ(parthenon::team_mbr_t const &mbr, ScratchPad1D &nQs, + const ScratchPad1D &Q, const ScratchPad1D &distri, + const int mimax, const Real kernel4[], const ScratchPad1D &vel, + const ScratchPad1D &stoppingTime, const CoagParams &coag) { + + const int nm = coag.nm; + + int iaFrag = coag2DRv::aFrag; + int iphiFrag = coag2DRv::phiFrag, iepsFrag = coag2DRv::epsFrag; + int idalp = coag2DRv::dalp, idpod = coag2DRv::dpod; + // int ikdelta = coag2DRv::kdelta; + // Adding coagulation source terms + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int i) { + // for (int i = 0; i <= mimax; i++) { + for (int j = 0; j <= i; j++) { + // calculate the rate + const Real fett_t = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 0); + const Real Rc1 = distri(i) * distri(j) * fett_t; + const Real &mass_gridi = coag.mass_grid(i); + const Real &mass_gridj = coag.mass_grid(j); + const Real &dalpji = coag.coagR3D(idalp, j, i); + const Real &dpodji = coag.coagR3D(idpod, j, i); + const Real &dalpij = coag.coagR3D(idalp, i, j); + const Real &dpodij = coag.coagR3D(idpod, i, j); + + const Real Qp1 = Qplus(mass_gridi, Q(i), mass_gridj, Q(j)); + const Real dphijQ = dalpji * Qp1 * (1.0 + dpodji) - Q(j); + const Real dphjiQ = dalpij * Qp1 * (1.0 + dpodij) - Q(i); + + const Real tmp1 = dphijQ - Qp1 * dpodji; + const Real tmp2 = dphjiQ - Qp1 * dpodij; + for (int nz = 0; nz < 4; nz++) { + const int k = coag.cpod_notzero(i, j, nz); + if (k < 0) continue; + const Real kdeltajk = (j == k) ? 1.0 : 0.0; + const Real kdeltaik = (i == k) ? 1.0 : 0.0; + const Real nqs_k = + (Qp1 * coag.cpod_short(i, j, nz) + tmp1 * kdeltajk + tmp2 * kdeltaik) * Rc1; + Kokkos::atomic_add(&nQs(k), nqs_k); + } + } + }); + mbr.team_barrier(); + + // FRAGMENTATION------------------------------------------------------ + + const int pGrid = coag.pGrid; + // Adding fragment distribution + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int k) { + // for (int k = 0; k < nm; k++) { + for (int j = k; j <= mimax; j++) { + // calculate As(j) on fly + Real As_j = 0.0; + for (int i2 = 0; i2 <= mimax; i2++) { + for (int j2 = 0; j2 <= i2; j2++) { + int klf = (j2 <= i2 - pGrid - 1) ? j2 : i2; + // if (coag.klf(i2, j2) == j) { + if (klf == j) { + const Real fett_l = + CoagulationRate(i2, j2, kernel4, vel, stoppingTime, coag, 1); + Real Qf1; + const Real &mass_gridi2 = coag.mass_grid(i2); + const Real &mass_gridj2 = coag.mass_grid(j2); + const Real &aFragi2j2 = coag.coagR3D(iaFrag, i2, j2); + if (j2 <= i2 - pGrid - 1) { + Qf1 = Qplus(coag.chi * mass_gridj2, Q(i2), mass_gridj2, Q(j2)); + } else { + Qf1 = Qplus(mass_gridi2, Q(i2), mass_gridj2, Q(j2)); + } + As_j += aFragi2j2 * distri(i2) * distri(j2) * fett_l * Qf1; + } + } + } + const Real &mass_gridk = coag.mass_grid(k); + nQs(k) += coag.coagR3D(iphiFrag, k, j) / mass_gridk * As_j; + } + }); + mbr.team_barrier(); + + // Negative terms and cratering remnants + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int j) { + // Cratering + Real sum0(0.0); + for (int i = j; i <= mimax; i++) { + const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); + const Real Rf1 = distri(i) * distri(j) * fett_l; + sum0 -= Rf1; + } + nQs(j) += (sum0 * Q(j)); + }); + mbr.team_barrier(); + + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int i) { + Real sum0(0.0); + for (int j = 0; j <= i - pGrid - 1; j++) { + const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); + const Real Rf1 = distri(i) * distri(j) * fett_l; + const Real dummy = coag.coagR3D(iepsFrag, i, j) * Rf1 * Q(i); + sum0 += dummy; + } + + if (i - pGrid - 1 >= 0) { + Kokkos::atomic_add(&nQs(i - 1), sum0); + } + + Real sum1 = -sum0; + // Full fragmentation (only negative terms) + int i1 = std::max(0, i - pGrid); + for (int j = i1; j <= i; j++) { + const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); + const Real Rf1 = distri(i) * distri(j) * fett_l * Q(i); + sum1 -= Rf1; + } + Kokkos::atomic_add(&nQs(i), sum1); + }); + mbr.team_barrier(); +} // end of subroutine source + +KOKKOS_INLINE_FUNCTION +void Coagulation_nQs(parthenon::team_mbr_t const &mbr, const Real &dt, + ScratchPad1D &Q, ScratchPad1D &nQs, + ScratchPad1D &distri, const int mimax, const int nvel, + const Real kernel4[], ScratchPad1D &vel, + const ScratchPad1D &stoppingTime, const CoagParams &coag, + ScratchPad1D &source) { + + const int nm = coag.nm - 1; + + const Real mom_scale = 1.0e10; + const Real mom_iscale = 1.0e-10; + + for (int n = 0; n < nvel; n++) { + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { + Q(k) = vel(n + k * 3) * mom_scale; + nQs(k) = 0.0; // initialize source(*) + }); + mbr.team_barrier(); + + Coagulation_nQ(mbr, nQs, Q, distri, mimax, kernel4, vel, stoppingTime, coag); + + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { + const Real distri_k = distri(k) + dt * source(k); + if (distri_k > coag.dfloor / coag.mass_grid(k)) { + const Real nQ1 = distri(k) * Q(k) + dt * nQs(k); + vel(n + k * 3) = nQ1 / distri_k * mom_iscale; + } + }); + mbr.team_barrier(); + } // loop of n + + // update the density + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, + [&](const int k) { distri(k) += dt * source(k); }); + mbr.team_barrier(); +} + +KOKKOS_INLINE_FUNCTION +void Coagulation_nQs3(parthenon::team_mbr_t const &mbr, const Real &dt, + ScratchPad1D &Q, ScratchPad1D &nQs, + ScratchPad1D &distri, const int mimax, const int nvel, + const Real kernel4[], ScratchPad1D &vel, + const ScratchPad1D &stoppingTime, const CoagParams &coag, + ScratchPad1D &source, ScratchPad1D &Q2, + const int mimax2) { + + const int nm = coag.nm - 1; + + const Real mom_scale = 1.0e10; + const Real mom_iscale = 1.0e-10; + + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { + Q2(k) = nQs(k); // 2nd stage source + }); + mbr.team_barrier(); + + for (int n = 0; n < nvel; n++) { + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { + Q(k) = vel(n + k * 3) * mom_scale; + nQs(k) = 0.0; + }); + mbr.team_barrier(); + + // 1st stage + Coagulation_nQ(mbr, nQs, Q, distri, mimax, kernel4, vel, stoppingTime, coag); + + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { + const Real distri_k = distri(k) + dt * source(k); + const Real nQ1 = distri(k) * Q(k) + dt * nQs(k); + Q(k) = nQ1 / distri_k; // intermediate Q + }); + mbr.team_barrier(); + + // 2nd stage + Coagulation_nQ(mbr, nQs, Q, distri, mimax2, kernel4, vel, stoppingTime, coag); + + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { + const Real nQ_o = distri(k) * vel(n + k * 3) * mom_scale; + const Real distri_k = distri(k) + 0.5 * dt * (source(k) + Q2(k)); + if (distri_k > coag.dfloor / coag.mass_grid(k)) { + Real nQ1 = nQ_o + 0.5 * dt * nQs(k); + vel(n + k * 3) = nQ1 / distri_k * mom_iscale; + } + }); + mbr.team_barrier(); + } + // update the density + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { + distri(k) += 0.5 * dt * (source(k) + Q2(k)); + }); + mbr.team_barrier(); +} + +KOKKOS_INLINE_FUNCTION +void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, + const Real &time, Real &dt_sync, const Real &gasdens, + ScratchPad1D &dustdens, ScratchPad1D &stime, + ScratchPad1D &vel, const int nvel, ScratchPad1D &Q, + ScratchPad1D &nQs, const Real &alpha, const Real &cs, + const Real &omega, const CoagParams &coag, + ScratchPad1D &source, int &nCall, ScratchPad1D &Q2) { + + int nm = coag.nm; + + Real dt, time_dummy, time_goal, hnext; + Real dt_sync1 = dt_sync; + + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int i) { + // convert to number density + const Real &mass_gridi = coag.mass_grid(i); + dustdens(i) /= mass_gridi; // number density + // take the floor value + dustdens(i) = std::max(dustdens(i), 0.01 * coag.dfloor / mass_gridi); +#ifdef COAGULATION_DEBUG + if (cell_i == 2 && dustdens[i] > coag.dfloor / mass_gridi) { + std::cout << " oneCellBeg: " << time << " " << i << " " << dustdens[i] << " " + << mass_gridi << " " << stime[i] << std::endl; + } +#endif + }); + mbr.team_barrier(); + + nCall = 0; + + // do time steps + time_dummy = time; + time_goal = time_dummy + dt_sync1; + dt = dt_sync1; + hnext = dt; + dt_sync = 1e-15; // works H5 + + Real kernel[4]; + kernel[0] = gasdens; + kernel[1] = alpha; + kernel[2] = cs; + kernel[3] = omega; + + while (std::abs(time_dummy - time_goal) > 1e-6 * dt) { + int mimax = 0; + Kokkos::parallel_reduce( + Kokkos::TeamThreadRange(mbr, nm), + [&](const int i, int &lmax) { + if (dustdens(i) > coag.dfloor / coag.mass_grid(i)) { + lmax = std::max(lmax, i); + } + }, + Kokkos::Max(mimax)); + + CoagulationSource(mbr, source, dustdens, mimax, kernel, vel, stime, coag); + + if (coag.use_adaptive == 0 || coag.integrator == 1) { + // time step control + dt_sync1 = std::numeric_limits::max(); // start with a large number + Kokkos::parallel_reduce( + Kokkos::TeamThreadRange(mbr, nm), + [&](const int i, Real &lmin) { + if (dustdens(i) > coag.dfloor / coag.mass_grid(i) && source(i) < 0.0) { + lmin = std::min(lmin, std::abs(dustdens(i) / source(i))); + } + }, + Kokkos::Min(dt_sync1)); + dt_sync1 *= coag.cfl; + dt = std::min(dt_sync1, time_goal - time_dummy); + dt_sync = dt_sync1; + + if (coag.mom_coag) { + Coagulation_nQs(mbr, dt, Q, nQs, dustdens, mimax, nvel, kernel, vel, stime, coag, + source); + } else { + // integration: first-order + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, + [&](const int i) { dustdens(i) += dt * source(i); }); + mbr.team_barrier(); + } + + } else { + // third-order method + Real h0 = hnext; + Real h = h0; + Real errmax; + int mimax2 = 0; + // Heun's Method + while (1) { + // Q(*) is temprary variable to store the dust number density + mimax2 = 0; + Kokkos::parallel_reduce( + Kokkos::TeamThreadRange(mbr, nm), + [&](const int i, int &lmax) { + Q(i) = dustdens(i) + h * source(i); + if (Q(i) > coag.dfloor / coag.mass_grid(i)) { + lmax = std::max(lmax, i); + } + }, + Kokkos::Max(mimax2)); + + CoagulationSource(mbr, nQs, Q, mimax2, kernel, vel, stime, coag); + + errmax = 0.0; + const int nm1 = std::min(mimax2, mimax); + Kokkos::parallel_reduce( + Kokkos::TeamThreadRange(mbr, nm1), + [&](const int i, Real &lmax) { + Real dscale = std::abs(dustdens(i)) + std::abs(h0 * source(i)); + Real derr = 0.5 * h * (nQs(i) - source(i)) / dscale; + lmax = std::max(lmax, std::abs(derr)); + }, + Kokkos::Max(errmax)); +#ifdef COAGULATION_DEBUG + if (cell_i == 2) + std::cout << nCall << " " << errmax << " " << coag.err_eps << " " << h << " " + << mimax << " " << mimax2 << std::endl; +#endif + errmax /= coag.err_eps; + + if (errmax <= 1.0) break; + + h = std::max(coag.S * h * std::pow(errmax, coag.pshrink), 0.1 * h); + } // end of while (1) + + if (errmax > coag.errcon) { + hnext = coag.S * h * std::pow(errmax, coag.pgrow); + } else { + hnext = 5.0 * h; + } + + // Actual taken step + dt = h; + + if (coag.mom_coag) { + Coagulation_nQs3(mbr, dt, Q, nQs, dustdens, mimax, nvel, kernel, vel, stime, coag, + source, Q2, mimax2); + } else { + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, + [&](const int i) { dustdens(i) += 0.5 * dt * (source(i) + nQs(i)); }); + mbr.team_barrier(); + } + + } // end of if (coag.use_adaptive == 0) + + // Kokkos::single (Kokkos::PerTeam(mbr), [&]() { + time_dummy += dt; + nCall++; + //}); mbr.team_barrier(); + + if (coag.use_adaptive == 1) { + dt_sync = std::max(hnext, dt_sync); + hnext = std::min(hnext, time_goal - time_dummy); + } + + if (nCall > coag.nCall_mx) break; + } // end of internal timestep + + // from number density to volume density + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, + [&](const int i) { dustdens(i) *= coag.mass_grid(i); }); + mbr.team_barrier(); + +} // end of CoagulationOneCell + +} // namespace Coagulation +} // namespace Dust + +#endif // DUST_COAGULATION_HPP_ diff --git a/src/pgen/dust_coagulation.hpp b/src/pgen/dust_coagulation.hpp new file mode 100644 index 00000000..23988f32 --- /dev/null +++ b/src/pgen/dust_coagulation.hpp @@ -0,0 +1,190 @@ +//======================================================================================== +// (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +// +// This program was produced under U.S. Government contract 89233218CNA000001 for Los +// Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +// for the U.S. Department of Energy/National Nuclear Security Administration. All rights +// in the program are reserved by Triad National Security, LLC, and the U.S. Department +// of Energy/National Nuclear Security Administration. The Government is granted for +// itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +// license in this material to reproduce, prepare derivative works, distribute copies to +// the public, perform publicly and display publicly, and to permit others to do so. +//======================================================================================== +// AthenaXXX astrophysical plasma code +// Copyright(C) 2020 James M. Stone and the Athena code team +// Licensed under the 3-clause BSD License (the "LICENSE") +//======================================================================================== + +// NOTE(@pdmullen): The following is taken directly from the open-source +// Athena++-dustfluid software, and adapted for Parthenon/Artemis by @Shengtai on 7/30/24 + +//! \file dust_coagulation.hpp +//! \brief dust collision problem generator for 1D problems. + +#ifndef PGEN_DUST_COAGULATION_HPP_ +#define PGEN_DUST_COAGULATION_HPP_ + +// C/C++ headers +#include +#include +#include +#include +#include +#include +#include + +// Artemis headers +#include "artemis.hpp" +#include "geometry/geometry.hpp" +#include "utils/artemis_utils.hpp" +#include "utils/eos/eos.hpp" + +using ArtemisUtils::EOS; +using ArtemisUtils::VI; + +namespace { + +//---------------------------------------------------------------------------------------- +//! \struct DustCoagulationVariable +//! \brief container for variables shared with dust_coagulation pgen +struct DustCoagulationVariable { + int nDust; + int nInit_dust; + Real gamma, gm1; + Real iso_cs; + Real d2g; + int nstep1Coag; + Real rho_g0; + Real mass0; + Real time0; + Real length0; + Real vol0; +}; + +} // end anonymous namespace + +namespace dust_coagulation { + +DustCoagulationVariable dcv; + +//---------------------------------------------------------------------------------------- +//! \fn void ProblemGenerator::DustCollision_() +//! \brief Sets initial conditions for dust coagulation tests +template +inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { + using parthenon::MakePackDescriptor; + + auto artemis_pkg = pmb->packages.Get("artemis"); + const auto geom = artemis_pkg->Param("coords"); + PARTHENON_REQUIRE(geom == Coordinates::cartesian, + "dust_coagulation pgen requires Cartesian geometry!"); + const bool do_dust = artemis_pkg->Param("do_dust"); + PARTHENON_REQUIRE(do_dust, "dust_coagulation pgen requires do_dust=true!"); + + auto &dust_pkg = pmb->packages.Get("dust"); + + const bool enable_coagulation = dust_pkg->Param("enable_coagulation"); + // PARTHENON_REQUIRE(enable_coagulation, + // "dust_coagulation pgen requires enable_coagulation=true!"); + + // read global parameters + dcv.nDust = pin->GetOrAddReal("dust", "nspecies", 121); + dcv.nInit_dust = pin->GetOrAddReal("problem", "nInit_dust", 1); + dcv.d2g = pin->GetOrAddReal("problem", "dust_to_gas", 0.01); + dcv.nstep1Coag = pin->GetOrAddReal("problem", "nstep1Coag", 50); + + if (Dust::cgsunit == NULL) { + Dust::cgsunit = new Dust::CGSUnit(); + } + if (!Dust::cgsunit->isSet()) { + Dust::cgsunit->SetCGSUnit(pin); + } + + //bool isurface_den = Dust::cgsunit->isurface_den; + dcv.length0 = Dust::cgsunit->length0; + dcv.mass0 = Dust::cgsunit->mass0; + dcv.time0 = Dust::cgsunit->time0; + + Real den_code2phy = 1.0; + dcv.vol0 = Dust::cgsunit->vol0; + + den_code2phy = dcv.mass0 / dcv.vol0; + + dcv.rho_g0 = den_code2phy; + + // using MRN distribution for the initial dust setup + ParArray1D dust_size = dust_pkg->template Param>("sizes"); + + auto s_p_prefh = Kokkos::create_mirror(dust_size); + Kokkos::deep_copy(s_p_prefh, dust_size); + + Real sum1 = 0.0; + for (int i = 0; i < dcv.nInit_dust; i++) { + sum1 += std::sqrt(s_p_prefh(i)); + } + + for (int i = 0; i < dcv.nInit_dust; i++) { + s_p_prefh(i) = std::sqrt(s_p_prefh(i)) / sum1; + } + + for (int i = dcv.nInit_dust; i < dcv.nDust; i++) { + s_p_prefh(i) = 0.0; + } + ParArray1D s_p_pref("init dust", dcv.nDust); + Kokkos::deep_copy(s_p_pref, s_p_prefh); + + auto gas_pkg = pmb->packages.Get("gas"); + auto eos_d = gas_pkg->template Param("eos_d"); + + dcv.gamma = gas_pkg->Param("adiabatic_index"); + dcv.gm1 = dcv.gamma - 1.0; + dcv.iso_cs = pin->GetOrAddReal("gas", "iso_sound_speed", 1e-1); + + const Real gdens = 1.0; + const Real gtemp = SQR(dcv.iso_cs); + const Real vx_g = 0.0; + const Real gsie = eos_d.InternalEnergyFromDensityTemperature(gdens, gtemp); + std::cout << "gamma,cs,pre=" << dcv.gamma << " " << dcv.iso_cs << " " << gsie * dcv.gm1 + << std::endl; + + const Real vx_d = 0.0; + const Real vy_d = 0.0; + const Real vz_d = 0.0; + + // packing and capture variables for kernel + auto &md = pmb->meshblock_data.Get(); + for (auto &var : md->GetVariableVector()) { + if (!var->IsAllocated()) pmb->AllocateSparse(var->label()); + } + static auto desc = + MakePackDescriptor( + (pmb->resolved_packages).get()); + auto v = desc.GetPack(md.get()); + IndexRange ib = pmb->cellbounds.GetBoundsI(IndexDomain::entire); + IndexRange jb = pmb->cellbounds.GetBoundsJ(IndexDomain::entire); + IndexRange kb = pmb->cellbounds.GetBoundsK(IndexDomain::entire); + auto &dcoag = dcv; + + pmb->par_for( + "pgen_dustCoagulation", kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(const int k, const int j, const int i) { + v(0, gas::prim::density(0), k, j, i) = gdens; + v(0, gas::prim::velocity(0), k, j, i) = vx_g; + v(0, gas::prim::velocity(1), k, j, i) = 0.0; + v(0, gas::prim::velocity(2), k, j, i) = 0.0; + v(0, gas::prim::sie(0), k, j, i) = gsie; + + // dust initial condition + for (int n = 0; n < dcoag.nDust; ++n) { + v(0, dust::prim::density(n), k, j, i) = dcoag.d2g * gdens * s_p_pref(n); + v(0, dust::prim::velocity(n * 3 + 0), k, j, i) = vx_d; + v(0, dust::prim::velocity(n * 3 + 1), k, j, i) = vy_d; + v(0, dust::prim::velocity(n * 3 + 2), k, j, i) = vz_d; + } + }); +} + +} // namespace dust_coagulation + +#endif // PGEN_DUST_COAGULATION_HPP_ diff --git a/src/pgen/dust_collision.hpp b/src/pgen/dust_collision.hpp new file mode 100644 index 00000000..6ae9832a --- /dev/null +++ b/src/pgen/dust_collision.hpp @@ -0,0 +1,239 @@ +//======================================================================================== +// (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. +// +// This program was produced under U.S. Government contract 89233218CNA000001 for Los +// Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +// for the U.S. Department of Energy/National Nuclear Security Administration. All rights +// in the program are reserved by Triad National Security, LLC, and the U.S. Department +// of Energy/National Nuclear Security Administration. The Government is granted for +// itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +// license in this material to reproduce, prepare derivative works, distribute copies to +// the public, perform publicly and display publicly, and to permit others to do so. +//======================================================================================== +// AthenaXXX astrophysical plasma code +// Copyright(C) 2020 James M. Stone and the Athena code team +// Licensed under the 3-clause BSD License (the "LICENSE") +//======================================================================================== + +// NOTE(@pdmullen): The following is taken directly from the open-source +// Athena++-dustfluid software, and adapted for Parthenon/Artemis by @Shengtai on 4/12/24 + +//! \file dust_collision.cpp +//! \brief dust collision problem generator for 1D problems. + +#ifndef PGEN_DUST_COLLISION_HPP_ +#define PGEN_DUST_COLLISION_HPP_ + +// C/C++ headers +#include +#include +#include +#include +#include +#include +#include + +// Artemis headers +#include "artemis.hpp" +#include "geometry/geometry.hpp" +//#include "pgen/pgen.hpp" +#include "utils/artemis_utils.hpp" +#include "utils/eos/eos.hpp" + +using ArtemisUtils::EOS; + +namespace { + +//---------------------------------------------------------------------------------------- +//! \struct DustCollisionVariable +//! \brief container for variables shared with dust collision pgen +struct DustCollisionVariable { + int prob_flag; + int nDust; + Real gamma, gm1; + Real iso_cs; +}; + +} // end anonymous namespace + +namespace dust_collision { + +DustCollisionVariable dcv; + +//---------------------------------------------------------------------------------------- +//! \fn void ProblemGenerator::DustCollision_() +//! \brief Sets initial conditions for dust collision tests +template +inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { + using parthenon::MakePackDescriptor; + + auto artemis_pkg = pmb->packages.Get("artemis"); + const auto geom = artemis_pkg->Param("coords"); + PARTHENON_REQUIRE(geom == Coordinates::cartesian, + "dust_collision pgen requires Cartesian geometry!"); + const bool do_dust = artemis_pkg->Param("do_dust"); + PARTHENON_REQUIRE(do_dust, "dust_collision pgen requires do_dust=true!"); + bool const_stopping_time = pin->GetOrAddBoolean("dust", "const_stopping_time", true); + PARTHENON_REQUIRE(do_dust, "dust_collision pgen requires const_stopping_time=true!"); + + // read global parameters + dcv.prob_flag = pin->GetOrAddInteger("problem", "iprob", 1); + dcv.nDust = pin->GetOrAddReal("dust", "nspecies", 2); + PARTHENON_REQUIRE(dcv.nDust == 2, "dust_collision pgen requires dust nspecies == 2!"); + + auto gas_pkg = pmb->packages.Get("gas"); + auto eos_d = gas_pkg->template Param("eos_d"); + + dcv.gamma = gas_pkg->Param("adiabatic_index"); + dcv.gm1 = dcv.gamma - 1.0; + dcv.iso_cs = pin->GetOrAddReal("gas", "iso_sound_speed", 1e-1); + + const Real gdens = 1.0; + const Real gtemp = SQR(dcv.iso_cs); + const Real vx_g = 1.0; + const Real gsie = eos_d.InternalEnergyFromDensityTemperature(gdens, gtemp); + + // packing and capture variables for kernel + auto &md = pmb->meshblock_data.Get(); + for (auto &var : md->GetVariableVector()) { + if (!var->IsAllocated()) pmb->AllocateSparse(var->label()); + } + static auto desc = + MakePackDescriptor( + (pmb->resolved_packages).get()); + auto v = desc.GetPack(md.get()); + IndexRange ib = pmb->cellbounds.GetBoundsI(IndexDomain::entire); + IndexRange jb = pmb->cellbounds.GetBoundsJ(IndexDomain::entire); + IndexRange kb = pmb->cellbounds.GetBoundsK(IndexDomain::entire); + auto &dcol = dcv; + + pmb->par_for( + "pgen_dustCollision", kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(const int k, const int j, const int i) { + v(0, gas::prim::density(), k, j, i) = gdens; + v(0, gas::prim::velocity(0), k, j, i) = vx_g; + v(0, gas::prim::velocity(1), k, j, i) = 0.0; + v(0, gas::prim::velocity(2), k, j, i) = 0.0; + v(0, gas::prim::sie(), k, j, i) = gsie; + + // dust initial condition + if (dcol.prob_flag == 1) { // stiff problem with smaller stopping time + v(0, dust::prim::density(0), k, j, i) = 1.0; + v(0, dust::prim::density(1), k, j, i) = 1.0; + } else { + v(0, dust::prim::density(0), k, j, i) = 10.0; + v(0, dust::prim::density(1), k, j, i) = 100.0; + } + v(0, dust::prim::velocity(0 * 3 + 0), k, j, i) = 2.0; + v(0, dust::prim::velocity(0 * 3 + 1), k, j, i) = 0.0; + v(0, dust::prim::velocity(0 * 3 + 2), k, j, i) = 0.0; + + v(0, dust::prim::velocity(1 * 3 + 0), k, j, i) = 0.5; + v(0, dust::prim::velocity(1 * 3 + 1), k, j, i) = 0.0; + v(0, dust::prim::velocity(1 * 3 + 2), k, j, i) = 0.0; + }); +} + +//---------------------------------------------------------------------------------------- +//! \fn void PreStepUserworkInLoop +//! \brief output numerical solution and analytic solution before each step +//! and writing to file. +inline void PreStepUserWorkInLoop(Mesh *pmesh, ParameterInput *pin, + parthenon::SimTime &tm) { + + // packing and capture variables for kernel + auto &md = pmesh->mesh_data.GetOrAdd("base", 0); + auto pmb = md->GetBlockData(0)->GetBlockPointer(); + static auto desc = MakePackDescriptor( + (pmb->resolved_packages).get()); + auto v = desc.GetPack(md.get()); + + IndexRange ib = pmb->cellbounds.GetBoundsI(IndexDomain::interior); + IndexRange jb = pmb->cellbounds.GetBoundsJ(IndexDomain::interior); + IndexRange kb = pmb->cellbounds.GetBoundsK(IndexDomain::interior); + + // root process opens output file and writes out data + if (parthenon::Globals::my_rank == 0) { + std::string fname; + fname.assign(pin->GetString("parthenon/job", "problem_id")); + fname.append("-solu1.dat"); + static FILE *pfile = NULL; + + // The file exists -- reopen the file in append mode + if (pfile == NULL) { + if ((pfile = std::fopen(fname.c_str(), "r")) != nullptr) { + if ((pfile = std::freopen(fname.c_str(), "a", pfile)) == nullptr) { + PARTHENON_FAIL("Error output file could not be opened"); + } + // The file does not exist -- open the file in write mode and add headers + } else { + if ((pfile = std::fopen(fname.c_str(), "w")) == nullptr) { + PARTHENON_FAIL("Error output file could not be opened"); + } + std::fprintf(pfile, "# time vel-g vel-ge vel-d1 vel-d1e vel-d2 vel-d2e \n"); + } + } + + // analytic solution + Real v_com, c1_g, c2_g, lam1, lam2, c1_d1, c2_d1, c1_d2, c2_d2; + Real v_g, v_d1, v_d2; + if (dcv.prob_flag == 1) { + v_com = 7. / 6.; + c1_g = -0.35610569612832; + c2_g = 0.18943902946166; + lam1 = -141.742430504416, lam2 = -1058.25756949558; + c1_d1 = 0.85310244713865; + c2_d1 = -0.01976911380532; + c1_d2 = -0.49699675101033; + c2_d2 = -0.16966991565634; + } else { + v_com = 0.63963963963963; + c1_g = -0.06458203330249; + c2_g = 0.42494239366285; + lam1 = -0.52370200744224; + lam2 = -105.976297992557; + c1_d1 = 1.36237475791577; + c2_d1 = -0.00201439755542; + c1_d2 = -0.13559165545855; + c2_d2 = -0.00404798418109; + } + + v_g = v_com + c1_g * std::exp(lam1 * tm.time) + c2_g * std::exp(lam2 * tm.time); + v_d1 = v_com + c1_d1 * std::exp(lam1 * tm.time) + c2_d1 * std::exp(lam2 * tm.time); + v_d2 = v_com + c1_d2 * std::exp(lam1 * tm.time) + c2_d2 * std::exp(lam2 * tm.time); + + // write data + + ParArray1D vel("outdat", 3); + + Real vg0 = 0.0, vd10 = 0.0, vd20 = 0.0; + pmb->par_for( + "out_dustCollision", kb.s, kb.e, jb.s, jb.e, ib.s, ib.s, + KOKKOS_LAMBDA(const int k, const int j, const int i) { + vel(0) = v(0, gas::prim::velocity(0), k, j, i); + vel(1) = v(0, dust::prim::velocity(0), k, j, i); + vel(2) = v(0, dust::prim::velocity(3), k, j, i); + }); + + auto dat = Kokkos::create_mirror_view_and_copy(parthenon::HostMemSpace(), vel); + vg0 = dat(0); + vd10 = dat(1); + vd20 = dat(2); + + std::fprintf(pfile, " %e ", tm.time); + std::fprintf(pfile, " %e ", vg0); + std::fprintf(pfile, " %e ", v_g); + std::fprintf(pfile, " %e ", vd10); + std::fprintf(pfile, " %e ", v_d1); + std::fprintf(pfile, " %e ", vd20); + std::fprintf(pfile, " %e ", v_d2); + + std::fprintf(pfile, "\n"); + // std::fclose(pfile); + } +} + +} // namespace dust_collision + +#endif // PGEN_DUST_COLLISION_HPP_ From 63e37b9b466dfa508c2f6977cb66c7ba4ec148a5 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Wed, 4 Dec 2024 09:40:52 -0700 Subject: [PATCH 03/38] format fixed in pgen/dust_coagulation.hpp --- src/pgen/dust_coagulation.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pgen/dust_coagulation.hpp b/src/pgen/dust_coagulation.hpp index 23988f32..a8daa71a 100644 --- a/src/pgen/dust_coagulation.hpp +++ b/src/pgen/dust_coagulation.hpp @@ -100,7 +100,6 @@ inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { Dust::cgsunit->SetCGSUnit(pin); } - //bool isurface_den = Dust::cgsunit->isurface_den; dcv.length0 = Dust::cgsunit->length0; dcv.mass0 = Dust::cgsunit->mass0; dcv.time0 = Dust::cgsunit->time0; From 6ba72b0161aed571d11df19f2c076e0419f48b2c Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Wed, 4 Dec 2024 22:21:58 -0700 Subject: [PATCH 04/38] fixed omega_k calculation in dust.cpp --- inputs/dust/disk_cyl_dust10.in | 2 +- src/dust/coagulation/coagulation.cpp | 2 +- src/dust/dust.cpp | 31 ++++++++++++++++++++++++---- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/inputs/dust/disk_cyl_dust10.in b/inputs/dust/disk_cyl_dust10.in index 79bed84e..b8999b7f 100644 --- a/inputs/dust/disk_cyl_dust10.in +++ b/inputs/dust/disk_cyl_dust10.in @@ -102,4 +102,4 @@ h0 = 0.05 dens_min = 1.0e-10 pres_min = 1.0e-13 mstar = 1.0 # Msun -r0_length = 10.0 # AU +r0_length = 50.0 # AU diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index 84315987..f008076b 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -38,7 +38,7 @@ std::shared_ptr Initialize(ParameterInput *pin) { cpars.mom_coag = pin->GetOrAddBoolean("dust", "coag_mom_preserve", true); cpars.nCall_mx = pin->GetOrAddInteger("dust", "coag_nsteps_mx", 1000); // dust particle internal density g/cc - const Real rho_p = pin->GetOrAddReal("dust", "rho_p", 1.25); + const Real rho_p = pin->GetOrAddReal("dust", "grain_density", 1.25); cpars.rho_p = rho_p; cpars.ibounce = pin->GetOrAddBoolean("dust", "coag_bounce", false); diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index b17f16d8..06cdcdc7 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -255,6 +255,9 @@ std::shared_ptr Initialize(ParameterInput *pin) { rho_p /= cgsunit->length0; } + if (parthenon::Globals::my_rank == 0) { + std::cout << "rho_p, rho_g0=" << rho_p << " " << rho_g0 << std::endl; + } params.Add("rho_p", rho_p); } // Scratch for dust flux @@ -390,7 +393,13 @@ TaskStatus UpdateDustStoppingTime(MeshData *md) { geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); // for surface denstiy, Stokes number = Pi/2*rho_p*s_p/sigma_g // calculate the Keplerian Omega at mid-plane - Real rad = coords.x1v(); + // const auto &hx = coords.GetScaleFactors(); + Real rad; + if constexpr (GEOM == Coordinates::cylindrical) { + rad = coords.hx2v(); // cylindrical-rad + } else { + rad = coords.hx3v(); + } Real Omega_k = 1.0 / std::sqrt(rad) / rad; for (int n = 0; n < nspecies; ++n) { const Real St = rho_p * dust_size(n) / dens_g; @@ -832,8 +841,11 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); const auto &hx = coords.GetScaleFactors(); - const Real rad = hx[2]; // cylindrical R_cyl - const Real Omega_k = 1.0 / std::sqrt(rad) / rad; + Real rad = hx[2]; + if constexpr (GEOM == Coordinates::cylindrical) { + rad = hx[1]; + } + const Real Omega_k = 1.0 / std::sqrt(rad) / rad; // code unit // const Real vol1 = coords.Volume() * vol0; int nCall1 = 0; @@ -998,6 +1010,15 @@ TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt TaskID none(0); // Assemble tasks + auto &coag = coag_pkg->template Param("coag_pars"); + const int nspecies = coag.nm; + std::vector dust_var_names; + for (int n = 0; n < nspecies; n++) { + dust_var_names.push_back(dust::prim::density::name() + '_' + std::to_string(n)); + dust_var_names.push_back(dust::prim::velocity::name() + '_' + std::to_string(n)); + } + auto &dust_subset = + pm->mesh_data.AddShallow("dust_subset", pm->mesh_data.Get(), dust_var_names); using namespace ::parthenon::Update; const int num_partitions = pm->DefaultNumPartitions(); TaskRegion &tr = tc.AddRegion(num_partitions); @@ -1011,7 +1032,9 @@ TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt auto pre_comm = tl.AddTask(coag_step, PreCommFillDerived>, base.get()); // Set boundary conditions (both physical and logical) - auto bcs = parthenon::AddBoundaryExchangeTasks(pre_comm, tl, base, pm->multilevel); + // auto bcs = parthenon::AddBoundaryExchangeTasks(pre_comm, tl, base, pm->multilevel); + auto &md_coag = pm->mesh_data.GetOrAdd("dust_subset", i); + auto bcs = parthenon::AddBoundaryExchangeTasks(pre_comm, tl, md_coag, pm->multilevel); // Update primitive variables auto c2p = tl.AddTask(bcs, FillDerived>, base.get()); From 1beaf24b0c20f13871d99e615e18766c3e53dcd7 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Thu, 5 Dec 2024 13:19:51 -0700 Subject: [PATCH 05/38] remove dust_drag --- src/artemis.hpp | 8 - src/artemis_driver.cpp | 8 +- src/dust/dust.cpp | 375 +++++------------------------------------ src/dust/dust.hpp | 2 - 4 files changed, 47 insertions(+), 346 deletions(-) diff --git a/src/artemis.hpp b/src/artemis.hpp index 1350768e..8cd37002 100644 --- a/src/artemis.hpp +++ b/src/artemis.hpp @@ -92,14 +92,6 @@ enum class RSolver { hllc, hlle, llf, null }; enum class ReconstructionMethod { pcm, plm, ppm, null }; // ...Fluid types enum class Fluid { gas, dust, null }; -// constants that enumerate dust drag method -enum class DragMethod { - explicitNoFeedback, - explicitFeedback, - implicitNoFeedback, - implicitFeedback, - null -}; // ...Boundary conditions enum class ArtemisBC { reflect, diff --git a/src/artemis_driver.cpp b/src/artemis_driver.cpp index 2c0d1174..455360c4 100644 --- a/src/artemis_driver.cpp +++ b/src/artemis_driver.cpp @@ -260,15 +260,9 @@ TaskCollection ArtemisDriver::StepTasks() { tl.AddTask(drag_src, Gas::Cooling::CoolingSource, u0.get(), time, bdt); } - // Add dust drag force - TaskID dust_drag_src = cooling_src; - if (do_dust) { - dust_drag_src = tl.AddTask(cooling_src, Dust::ApplyDragForce, u0.get(), bdt); - } - // Set auxillary fields auto set_aux = - tl.AddTask(dust_drag_src, ArtemisDerived::SetAuxillaryFields, u0.get()); + tl.AddTask(cooling_src, ArtemisDerived::SetAuxillaryFields, u0.get()); // Set (remaining) fields to be communicated auto pre_comm = tl.AddTask(set_aux, PreCommFillDerived>, u0.get()); diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index 06cdcdc7..916c672e 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -103,41 +103,12 @@ std::shared_ptr Initialize(ParameterInput *pin) { for (int n = 0; n < nspecies; ++n) dustids.push_back(n); - // dust stopping time flag - bool const_stopping_time = pin->GetOrAddBoolean("dust", "const_stopping_time", true); - params.Add("const_stopping_time", const_stopping_time); - - bool enable_dust_drag = pin->GetOrAddBoolean("dust", "enable_dust_drag", false); - params.Add("enable_dust_drag", enable_dust_drag); - bool hst_out_d2g = pin->GetOrAddBoolean("dust", "hst_out_d2g", false); params.Add("hst_out_d2g", hst_out_d2g); // coagulation flag bool enable_dust_coagulation = pin->GetOrAddBoolean("physics", "coagulation", false); - DragMethod drag_method = DragMethod::null; - if (enable_dust_drag) { - bool enable_dust_feedback = pin->GetBoolean("dust", "enable_dust_feedback"); - std::string drag_method1 = pin->GetOrAddString("dust", "drag_method", "implicit"); - - if (drag_method1 == "implicit") { - if (enable_dust_feedback) { - drag_method = DragMethod::implicitFeedback; - } else { - drag_method = DragMethod::implicitNoFeedback; - } - } else { - if (enable_dust_feedback) { - drag_method = DragMethod::explicitFeedback; - } else { - drag_method = DragMethod::explicitNoFeedback; - } - } - - params.Add("drag_method", drag_method); - } // end if (enable_dust_drag) - // Dust sizes auto size_dist = pin->GetOrAddString("dust", "size_input", "direct"); if (enable_dust_coagulation) size_dist = "logspace"; @@ -212,7 +183,7 @@ std::shared_ptr Initialize(ParameterInput *pin) { sizes.DeepCopy(h_sizes); params.Add("sizes", sizes); params.Add("h_sizes", h_sizes); - } else if (!const_stopping_time) { + } else { PARTHENON_FAIL("dust/size_input not recognized!"); } @@ -220,18 +191,7 @@ std::shared_ptr Initialize(ParameterInput *pin) { const Real rho_p_orig = pin->GetOrAddReal("dust", "grain_density", 1.0); params.Add("grain_density", rho_p_orig); - if (const_stopping_time) { - if (enable_dust_drag) { - ParArray1D stopping_time("dust_stopping_time", nspecies); - auto stopping_time_host = stopping_time.GetHostMirror(); - auto stopping_v = pin->GetVector("dust", "stopping_time"); - for (int n = 0; n < nspecies; ++n) { - stopping_time_host(n) = stopping_v[n]; - } - stopping_time.DeepCopy(stopping_time_host); - params.Add("stopping_time", stopping_time); - } - } else { + if (enable_dust_coagulation) { if (cgsunit == NULL) { cgsunit = new CGSUnit; } @@ -336,8 +296,7 @@ TaskStatus UpdateDustStoppingTime(MeshData *md) { auto pm = md->GetParentPointer(); auto &dust_pkg = pm->packages.Get("dust"); - if ((!dust_pkg->template Param("enable_dust_drag")) && - (!dust_pkg->template Param("enable_coagulation"))) { + if ((!dust_pkg->template Param("enable_coagulation"))) { return TaskStatus::complete; } @@ -349,75 +308,54 @@ TaskStatus UpdateDustStoppingTime(MeshData *md) { const int nspecies = dust_pkg->template Param("nspecies"); - const bool const_stopping_time = dust_pkg->template Param("const_stopping_time"); + const bool isurf_den = cgsunit->isurface_den; + ParArray1D dust_size = dust_pkg->template Param>("sizes"); + static auto desc = + MakePackDescriptor( + resolved_pkgs.get()); + + auto vmesh = desc.GetPack(md); + + auto &gas_pkg = pm->packages.Get("gas"); + + const Real gamma = gas_pkg->template Param("adiabatic_index"); + const Real rho_p = dust_pkg->template Param("rho_p"); - if (const_stopping_time) { - ParArray1D stoppingTime = - dust_pkg->template Param>("stopping_time"); - static auto desc = MakePackDescriptor(resolved_pkgs.get()); + parthenon::par_for( + DEFAULT_LOOP_PATTERN, "Dust::DustStoppingTime2", parthenon::DevExecSpace(), 0, + md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { + const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); + // usually the Stokes number depends gas density, unless constant is used + // stopping_time = Stokes_number/Omega_k - auto vmesh = desc.GetPack(md); - parthenon::par_for( - DEFAULT_LOOP_PATTERN, "Dust::DustStoppingTime", parthenon::DevExecSpace(), 0, - md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { - // usually the stopping time depends gas density, unless constant is used - // constant stopping time + if (isurf_den) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + // for surface denstiy, Stokes number = Pi/2*rho_p*s_p/sigma_g + // calculate the Keplerian Omega at mid-plane + Real rad; + if constexpr (GEOM == Coordinates::cylindrical) { + rad = coords.hx2v(); // cylindrical-rad + } else { + rad = coords.hx3v(); + } + Real Omega_k = 1.0 / std::sqrt(rad) / rad; for (int n = 0; n < nspecies; ++n) { - vmesh(b, dust::stopping_time(n), k, j, i) = stoppingTime(n); + const Real St = rho_p * dust_size(n) / dens_g; + vmesh(b, dust::stopping_time(n), k, j, i) = St / Omega_k; } - }); - } else { - const bool isurf_den = cgsunit->isurface_den; - ParArray1D dust_size = dust_pkg->template Param>("sizes"); - static auto desc = - MakePackDescriptor( - resolved_pkgs.get()); - - auto vmesh = desc.GetPack(md); - - auto &gas_pkg = pm->packages.Get("gas"); - - const Real gamma = gas_pkg->template Param("adiabatic_index"); - const Real rho_p = dust_pkg->template Param("rho_p"); - - parthenon::par_for( - DEFAULT_LOOP_PATTERN, "Dust::DustStoppingTime2", parthenon::DevExecSpace(), 0, - md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { - const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); - // usually the Stokes number depends gas density, unless constant is used - // stopping_time = Stokes_number/Omega_k - - if (isurf_den) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - // for surface denstiy, Stokes number = Pi/2*rho_p*s_p/sigma_g - // calculate the Keplerian Omega at mid-plane - // const auto &hx = coords.GetScaleFactors(); - Real rad; - if constexpr (GEOM == Coordinates::cylindrical) { - rad = coords.hx2v(); // cylindrical-rad - } else { - rad = coords.hx3v(); - } - Real Omega_k = 1.0 / std::sqrt(rad) / rad; - for (int n = 0; n < nspecies; ++n) { - const Real St = rho_p * dust_size(n) / dens_g; - vmesh(b, dust::stopping_time(n), k, j, i) = St / Omega_k; - } - } else { + } else { - // for density (g/cc), Stokes number = sqrt(Pi/8)*rho_p*s_p*Omega_k/rho_g/Cs - const Real pres = vmesh(b, gas::prim::pressure(0), k, j, i); - const Real cs = std::sqrt(gamma * pres / dens_g); - for (int n = 0; n < nspecies; ++n) { - const Real StOme = rho_p * dust_size(n) / dens_g; - vmesh(b, dust::stopping_time(n), k, j, i) = StOme / cs; - } + // for density (g/cc), Stokes number = sqrt(Pi/8)*rho_p*s_p*Omega_k/rho_g/Cs + const Real pres = vmesh(b, gas::prim::pressure(0), k, j, i); + const Real cs = std::sqrt(gamma * pres / dens_g); + for (int n = 0; n < nspecies; ++n) { + const Real StOme = rho_p * dust_size(n) / dens_g; + vmesh(b, dust::stopping_time(n), k, j, i) = StOme / cs; } - }); - } + } + }); return TaskStatus::complete; } @@ -434,20 +372,9 @@ Real EstimateTimestepMesh(MeshData *md) { auto &dust_pkg = pm->packages.Get("dust"); auto ¶ms = dust_pkg->AllParams(); - auto dragDt = params.template Get("user_dt"); + auto userDt = params.template Get("user_dt"); auto nspecies = params.template Get("nspecies"); - bool dt_stoppingTime = false; - if (params.template Get("enable_dust_drag")) { - UpdateDustStoppingTime(md); - if ((params.template Get("drag_method") == - DragMethod::explicitFeedback) || - (params.template Get("drag_method") == - DragMethod::explicitNoFeedback)) { - dt_stoppingTime = true; - } - } - const auto cfl_number = params.template Get("cfl"); static auto desc = MakePackDescriptor( @@ -474,15 +401,10 @@ Real EstimateTimestepMesh(MeshData *md) { } ldt = std::min(ldt, 1.0 / denom * cfl_number); } - if (dt_stoppingTime) { - for (int n = 0; n < nspecies; ++n) { - ldt = std::min(ldt, vmesh(b, dust::stopping_time(n), k, j, i)); - } - } }, Kokkos::Min(min_dt)); - return std::min(dragDt, min_dt); + return std::min(userDt, min_dt); } //---------------------------------------------------------------------------------------- @@ -535,211 +457,6 @@ TaskStatus FluxSource(MeshData *md, const Real dt) { return TaskStatus::complete; } -//---------------------------------------------------------------------------------------- -//! \fn TaskStatus Dust::ApplyDragForceSelect -// \brief Wrapper function for dust-drag froce based on different drag-method -template -TaskStatus ApplyDragForceSelect(MeshData *md, const Real dt) { - - using parthenon::MakePackDescriptor; - - auto pm = md->GetParentPointer(); - auto &dust_pkg = pm->packages.Get("dust"); - IndexRange ib = md->GetBoundsI(IndexDomain::interior); - IndexRange jb = md->GetBoundsJ(IndexDomain::interior); - IndexRange kb = md->GetBoundsK(IndexDomain::interior); - - auto &resolved_pkgs = pm->resolved_packages; - auto &DUST_DRAG = dust_pkg->template Param("drag_method"); - - static auto desc = - MakePackDescriptor(resolved_pkgs.get()); - - auto vmesh = desc.GetPack(md); - - if ((DUST_DRAG == DragMethod::explicitFeedback) || - (DUST_DRAG == DragMethod::explicitNoFeedback)) { - parthenon::par_for( - DEFAULT_LOOP_PATTERN, "Dust::DustDrag", parthenon::DevExecSpace(), 0, - md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { - const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); - const int nspecies = vmesh.GetUpperBound(b, dust::prim::density()) - - vmesh.GetLowerBound(b, dust::prim::density()) + 1; - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - const auto &hx = coords.GetScaleFactors(); - - for (int n = 0; n < nspecies; ++n) { - const Real dens_d = vmesh(b, dust::prim::density(n), k, j, i); - const Real tst = vmesh(b, dust::stopping_time(n), k, j, i); - const Real cj = dt * dens_d / tst; - - vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i) += - cj * hx[0] * - (vmesh(b, gas::prim::velocity(0), k, j, i) - - vmesh(b, dust::prim::velocity(VI(n, 0)), k, j, i)); - - vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i) += - cj * hx[1] * - (vmesh(b, gas::prim::velocity(1), k, j, i) - - vmesh(b, dust::prim::velocity(VI(n, 1)), k, j, i)); - - vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i) += - cj * hx[2] * - (vmesh(b, gas::prim::velocity(2), k, j, i) - - vmesh(b, dust::prim::velocity(VI(n, 2)), k, j, i)); - } - if (DUST_DRAG == DragMethod::explicitFeedback) { - const Real dens_g = vmesh(b, gas::cons::density(0), k, j, i); - Real delta_mom1 = 0.0; - Real delta_mom2 = 0.0; - Real delta_mom3 = 0.0; - for (int n = 0; n < nspecies; ++n) { - const Real dens_d = vmesh(b, dust::prim::density(n), k, j, i); - const Real tst = vmesh(b, dust::stopping_time(n), k, j, i); - Real cj = dt * dens_d / tst; - delta_mom1 -= cj * (vmesh(b, gas::prim::velocity(0), k, j, i) - - vmesh(b, dust::prim::velocity(VI(n, 0)), k, j, i)); - delta_mom2 -= cj * (vmesh(b, gas::prim::velocity(1), k, j, i) - - vmesh(b, dust::prim::velocity(VI(n, 1)), k, j, i)); - delta_mom3 -= cj * (vmesh(b, gas::prim::velocity(2), k, j, i) - - vmesh(b, dust::prim::velocity(VI(n, 2)), k, j, i)); - } - vmesh(b, gas::cons::momentum(0), k, j, i) += delta_mom1 * hx[0]; - vmesh(b, gas::cons::momentum(1), k, j, i) += delta_mom2 * hx[1]; - vmesh(b, gas::cons::momentum(2), k, j, i) += delta_mom3 * hx[2]; - - // gas energy update: delta_E = delta_mom*(M_new - 0.5*delta_mom)/rho_g - // delta_E = 0.5*rhog*(V_new^2 - V_old^2) - - vmesh(b, gas::cons::total_energy(0), k, j, i) += - (delta_mom1 * (vmesh(b, gas::cons::momentum(0), k, j, i) / hx[0] - - delta_mom1 * 0.5) + - delta_mom2 * (vmesh(b, gas::cons::momentum(1), k, j, i) / hx[1] - - delta_mom2 * 0.5) + - delta_mom3 * (vmesh(b, gas::cons::momentum(2), k, j, i) / hx[2] - - delta_mom3 * 0.5)) / - dens_g; - } - }); - - } else if ((DUST_DRAG == DragMethod::implicitFeedback) || - (DUST_DRAG == DragMethod::implicitNoFeedback)) { - auto &dfloor = dust_pkg->template Param("dfloor"); - parthenon::par_for( - DEFAULT_LOOP_PATTERN, "Dust::DustDragImp", parthenon::DevExecSpace(), 0, - md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - const auto &hx = coords.GetScaleFactors(); - const int nspecies = vmesh.GetUpperBound(b, dust::prim::density()) - - vmesh.GetLowerBound(b, dust::prim::density()) + 1; - - const Real dens_g = vmesh(b, gas::cons::density(0), k, j, i); - Real mom1_g = vmesh(b, gas::cons::momentum(0), k, j, i); - Real mom2_g = vmesh(b, gas::cons::momentum(1), k, j, i); - Real mom3_g = vmesh(b, gas::cons::momentum(2), k, j, i); - - Real vel1_g = mom1_g / (dens_g * hx[0]); - Real vel2_g = mom2_g / (dens_g * hx[1]); - Real vel3_g = mom3_g / (dens_g * hx[2]); - const Real coef1 = dens_g / vmesh(b, gas::prim::density(0), k, j, i); - - if (DUST_DRAG == DragMethod::implicitFeedback) { - - Real tmp1 = dens_g; - const Real vel1_go = vel1_g; - const Real vel2_go = vel2_g; - const Real vel3_go = vel3_g; - for (int n = 0; n < nspecies; ++n) { - const Real dens_d = vmesh(b, dust::cons::density(n), k, j, i); - const Real tst = vmesh(b, dust::stopping_time(n), k, j, i); - const Real cj = dt * dens_d / tst * coef1; // use updated dens_g - const Real bj1 = vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i); - const Real bj2 = vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i); - const Real bj3 = vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i); - const Real dj = dens_d + cj; - - const Real cjOdj = cj / dj; - tmp1 += (cj - cj * cjOdj); - mom1_g += bj1 * cjOdj; - mom2_g += bj2 * cjOdj; - mom3_g += bj3 * cjOdj; - } - - vel1_g = mom1_g / (tmp1 * hx[0]); - vel2_g = mom2_g / (tmp1 * hx[1]); - vel3_g = mom3_g / (tmp1 * hx[2]); - vmesh(b, gas::cons::momentum(0), k, j, i) = dens_g * vel1_g * hx[0]; - vmesh(b, gas::cons::momentum(1), k, j, i) = dens_g * vel2_g * hx[1]; - vmesh(b, gas::cons::momentum(2), k, j, i) = dens_g * vel3_g * hx[2]; - - // gas energy update: delta_E = 0.5*(v_new^2 - v_old^2)*rho_g - vmesh(b, gas::cons::total_energy(0), k, j, i) += - 0.5 * - (SQR(vel1_g) - SQR(vel1_go) + SQR(vel2_g) - SQR(vel2_go) + SQR(vel3_g) - - SQR(vel3_go)) * - dens_g; - } // end if (DUST_DRAG == DragMethod::implicitFeedback) - - // update the dust - for (int n = 0; n < nspecies; ++n) { - const Real dens_d = - std::max(dfloor, vmesh(b, dust::cons::density(n), k, j, i)); - const Real tst = vmesh(b, dust::stopping_time(n), k, j, i); - const Real cj = dt * dens_d / tst * coef1; // use updated dens_g - const Real bj1 = vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i); - const Real bj2 = vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i); - const Real bj3 = vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i); - const Real dj = dens_d + cj; - vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i) = - dens_d * (bj1 + cj * vel1_g * hx[0]) / dj; - vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i) = - dens_d * (bj2 + cj * vel2_g * hx[1]) / dj; - vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i) = - dens_d * (bj3 + cj * vel3_g * hx[2]) / dj; - } - }); - } - - return TaskStatus::complete; -} - -//---------------------------------------------------------------------------------------- -//! \fn TaskStatus Dust::ApplyDragForce -// \brief Wrapper function for dust-drag froce -TaskStatus ApplyDragForce(MeshData *md, const Real dt) { - - using parthenon::MakePackDescriptor; - - auto pm = md->GetParentPointer(); - auto &dust_pkg = pm->packages.Get("dust"); - if (!dust_pkg->template Param("enable_dust_drag")) { - return TaskStatus::complete; - } - - const Coordinates GEOM = dust_pkg->template Param("coords"); - - if (GEOM == Coordinates::cartesian) { - return ApplyDragForceSelect(md, dt); - } else if (GEOM == Coordinates::spherical1D) { - return ApplyDragForceSelect(md, dt); - } else if (GEOM == Coordinates::spherical2D) { - return ApplyDragForceSelect(md, dt); - } else if (GEOM == Coordinates::spherical3D) { - return ApplyDragForceSelect(md, dt); - } else if (GEOM == Coordinates::cylindrical) { - return ApplyDragForceSelect(md, dt); - } else if (GEOM == Coordinates::axisymmetric) { - return ApplyDragForceSelect(md, dt); - } else { - PARTHENON_FAIL("Coordinate type not recognized!"); - } -} - //#define COAG_DEBUG //---------------------------------------------------------------------------------------- //! \fn TaskStatus Dust::CoagulationOneStep diff --git a/src/dust/dust.hpp b/src/dust/dust.hpp index 535240cc..50dbb069 100644 --- a/src/dust/dust.hpp +++ b/src/dust/dust.hpp @@ -83,8 +83,6 @@ extern CGSUnit *cgsunit; template TaskStatus UpdateDustStoppingTime(MeshData *md); -TaskStatus ApplyDragForce(MeshData *md, const Real dt); - // OperatorSplit tasks template TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt); From a26caada247101a58ce76fbd44cd9a1cc76db340 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Wed, 11 Dec 2024 13:42:50 -0700 Subject: [PATCH 06/38] modification based on merge comments --- inputs/dust/SI_strat1_amr_BA.in | 146 -------- inputs/dust/SI_strat_AB.in | 135 -------- inputs/dust/SI_strat_BA.in | 135 -------- inputs/dust/disk_cyl_dust10.in | 105 ------ inputs/dust/dust_coagulation.in | 68 ++-- inputs/dust/dust_coagulation_den.in | 71 ++-- inputs/dust/dust_collision.in | 51 +-- src/artemis.cpp | 24 +- src/artemis.hpp | 6 +- src/artemis_driver.cpp | 15 +- src/dust/coagulation/coagulation.cpp | 120 +++---- src/dust/coagulation/coagulation.hpp | 41 +-- src/dust/dust.cpp | 489 +++++++++++---------------- src/dust/dust.hpp | 53 +-- src/pgen/dust_coagulation.hpp | 149 +++++--- src/pgen/dust_collision.hpp | 2 +- 16 files changed, 471 insertions(+), 1139 deletions(-) delete mode 100644 inputs/dust/SI_strat1_amr_BA.in delete mode 100644 inputs/dust/SI_strat_AB.in delete mode 100644 inputs/dust/SI_strat_BA.in delete mode 100644 inputs/dust/disk_cyl_dust10.in diff --git a/inputs/dust/SI_strat1_amr_BA.in b/inputs/dust/SI_strat1_amr_BA.in deleted file mode 100644 index 8e3e24ba..00000000 --- a/inputs/dust/SI_strat1_amr_BA.in +++ /dev/null @@ -1,146 +0,0 @@ -# ======================================================================================== -# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. -# -# This program was produced under U.S. Government contract 89233218CNA000001 for Los -# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC -# for the U.S. Department of Energy/National Nuclear Security Administration. All rights -# in the program are reserved by Triad National Security, LLC, and the U.S. Department -# of Energy/National Nuclear Security Administration. The Government is granted for -# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide -# license in this material to reproduce, prepare derivative works, distribute copies to -# the public, perform publicly and display publicly, and to permit others to do so. -# ======================================================================================== - - -problem = SI_strat # name of the pgen -coordinates = cartesian - - -problem_id = runBA # problem ID: basename of output filenames - - -file_type = hst -dt = 0.01 - - -variables = gas.prim.density, & - gas.prim.velocity, & - dust.prim.density, & - dust.prim.velocity - -file_type = hdf5 # HDF5 data dump -dt = 2.0 # time increment between outputs - - -file_type = rst -dt = 100.0 - - -nlim = -1 # cycle limit -tlim = 400.0 # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 100 # interval for stdout summary info - - -nx1 = 1024 # Number of zones in X1-direction -x1min = -0.4 # minimum value of X1 -x1max = 0.4 # maximum value of X1 -ix1_bc = extrapolate # Inner-X1 boundary condition flag -ox1_bc = extrapolate # Outer-X1 boundary condition flag - -nx2 = 512 # Number of zones in X2-direction -x2min = -0.2 # minimum value of X2 -x2max = 0.2 # maximum value of X2 -ix2_bc = extrapolate # Inner-X2 boundary condition flag -ox2_bc = extrapolate # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag - -# nghost = 2 -refinement = static -numlevel = 2 #3 - - -x1min = -0.3 -x1max = 0.3 -x2min = -0.02 -x2max = 0.02 -level = 1 - - - - -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 16 # Number of cells in each MeshBlock, X2-dir -nx3 = 16 # Number of cells in each MeshBlock, X3-dir - - -gas = true -gravity = false -rotating_frame = true -dust = true - - -cfl = 0.6 -gamma = 1.000001 -reconstruct = plm -riemann = hlle -dfloor = 1.0e-10 -siefloor = 1.0e-10 -refine_field = density -refine_type = magnitude -refine_thr = 3.0 -deref_thr = 0.8 - - -reconstruct = plm -riemann = hlle -nspecies = 1 -const_stopping_time = true -size_input = none -stopping_time = 0.3 -Hratio = 0.1 - -hst_out_d2g = true -Kai0 = 0.1 #2*etaVk*iso_cs - -enable_dust_drag = true -enable_dust_feedback = true -drag_method = implicit -#rho_p = 1.25 -#rho_g0 = 0.3555 #g/cm^2, code-to-physical convert -#user_input_size = true -#Size_1 = 10.0 # dust size - - - -#type = uniform -#gx1 = 0.1 # 2*etaVk*Ome0 -#gx2 = 0.0 -#gx3 = 0.0 - -#type = point -#gm = 1e-5 -#soft = .03 -#x = 0 -#y = 0 -#z = 0 - - -omega = 1.0 -qshear = 1.5 -shboxcoord = 2 # 1=xy; 2=xz -stratified_flag = true - - -rho0 = 0.3989422804 #1.0/sqrt(2*pi) -dens_min = 1.0e-10 -pres_min = 1.0e-13 -h = 1.0 -etaVk = 0.05 -amp = 0.1 -dust_to_gas = 0.04 diff --git a/inputs/dust/SI_strat_AB.in b/inputs/dust/SI_strat_AB.in deleted file mode 100644 index 0cd69530..00000000 --- a/inputs/dust/SI_strat_AB.in +++ /dev/null @@ -1,135 +0,0 @@ -# ======================================================================================== -# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. -# -# This program was produced under U.S. Government contract 89233218CNA000001 for Los -# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC -# for the U.S. Department of Energy/National Nuclear Security Administration. All rights -# in the program are reserved by Triad National Security, LLC, and the U.S. Department -# of Energy/National Nuclear Security Administration. The Government is granted for -# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide -# license in this material to reproduce, prepare derivative works, distribute copies to -# the public, perform publicly and display publicly, and to permit others to do so. -# ======================================================================================== - - -problem = SI_strat # name of the pgen -coordinates = cartesian - - -problem_id = runAB # problem ID: basename of output filenames - - -file_type = hst -dt = 0.01 - - -variables = gas.prim.density, & - gas.prim.velocity, & - dust.prim.density, & - dust.prim.velocity - -file_type = hdf5 # HDF5 data dump -dt = 0.5 # time increment between outputs - - -file_type = rst -dt = 20.0 - - -nlim = -1 # cycle limit -tlim = 40.0 # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 20 # interval for stdout summary info - - -nx1 = 512 # Number of zones in X1-direction -x1min = -0.05 # minimum value of X1 -x1max = 0.05 # maximum value of X1 -ix1_bc = extrapolate # Inner-X1 boundary condition flag -ox1_bc = extrapolate # Outer-X1 boundary condition flag - -nx2 = 512 # Number of zones in X2-direction -x2min = -0.05 # minimum value of X2 -x2max = 0.05 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag - -# nghost = 2 -# refinement = adaptive -# numlevel = 4 - - -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 16 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir - - -gas = true -gravity = false -rotating_frame = true -dust = true - - -cfl = 0.6 -gamma = 1.000001 -reconstruct = plm -riemann = hlle -dfloor = 1.0e-10 -siefloor = 1.0e-10 -refine_field = density -refine_type = magnitude -refine_thr = 3.0 -deref_thr = 0.8 - - -reconstruct = plm -riemann = hlle -nspecies = 1 -const_stopping_time = true -size_input = none -stopping_time = 0.1 -hst_out_d2g = true -Kai0 = 0.1 #2*etaVk*iso_cs - -enable_dust_drag = true -enable_dust_feedback = true -drag_method = explicit -#rho_p = 1.25 -#rho_g0 = 0.3555 #g/cm^2, code-to-physical convert -#user_input_size = true -#Size_1 = 10.0 # dust size - - - -#type = uniform -#gx1 = 0.1 # 2*etaVk*Ome0 -#gx2 = 0.0 -#gx3 = 0.0 - -#type = point -#gm = 1e-5 -#soft = .03 -#x = 0 -#y = 0 -#z = 0 - - -omega = 1.0 -qshear = 1.5 -shboxcoord = 2 # 1=xy; 2=xz -stratified_flag = false - - -rho0 = 1.0 -dens_min = 1.0e-10 -pres_min = 1.0e-13 -h = 1.0 -etaVk = 0.05 -amp = 0.25 -dust_to_gas = 1.0 diff --git a/inputs/dust/SI_strat_BA.in b/inputs/dust/SI_strat_BA.in deleted file mode 100644 index edb8cafc..00000000 --- a/inputs/dust/SI_strat_BA.in +++ /dev/null @@ -1,135 +0,0 @@ -# ======================================================================================== -# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. -# -# This program was produced under U.S. Government contract 89233218CNA000001 for Los -# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC -# for the U.S. Department of Energy/National Nuclear Security Administration. All rights -# in the program are reserved by Triad National Security, LLC, and the U.S. Department -# of Energy/National Nuclear Security Administration. The Government is granted for -# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide -# license in this material to reproduce, prepare derivative works, distribute copies to -# the public, perform publicly and display publicly, and to permit others to do so. -# ======================================================================================== - - -problem = SI_strat # name of the pgen -coordinates = cartesian - - -problem_id = runBA # problem ID: basename of output filenames - - -file_type = hst -dt = 0.02 - - -variables = gas.prim.density, & - gas.prim.velocity, & - dust.prim.density, & - dust.prim.velocity - -file_type = hdf5 # HDF5 data dump -dt = 10 # time increment between outputs - - -file_type = rst -dt = 100.0 - - -nlim = -1 # cycle limit -tlim = 800.0 # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 20 # interval for stdout summary info - - -nx1 = 512 # Number of zones in X1-direction -x1min = -1.0 # minimum value of X1 -x1max = 1.0 # maximum value of X1 -ix1_bc = extrapolate # Inner-X1 boundary condition flag -ox1_bc = extrapolate # Outer-X1 boundary condition flag - -nx2 = 512 # Number of zones in X2-direction -x2min = -1.0 # minimum value of X2 -x2max = 1.0 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag - -# nghost = 2 -# refinement = adaptive -# numlevel = 4 - - -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 16 # Number of cells in each MeshBlock, X2-dir -nx3 = 16 # Number of cells in each MeshBlock, X3-dir - - -gas = true -gravity = false -rotating_frame = true -dust = true - - -cfl = 0.6 -gamma = 1.000001 -reconstruct = plm -riemann = hlle -dfloor = 1.0e-10 -siefloor = 1.0e-10 -refine_field = density -refine_type = magnitude -refine_thr = 3.0 -deref_thr = 0.8 - - -reconstruct = plm -riemann = hlle -nspecies = 1 -const_stopping_time = true -size_input = none -stopping_time = 1.0 -hst_out_d2g = true -Kai0 = 0.1 #2*etaVk*iso_cs - -enable_dust_drag = true -enable_dust_feedback = true -drag_method = implicit -#rho_p = 1.25 -#rho_g0 = 0.3555 #g/cm^2, code-to-physical convert -#user_input_size = true -#Size_1 = 10.0 # dust size - - - -#type = uniform -#gx1 = 0.1 # 2*etaVk*Ome0 -#gx2 = 0.0 -#gx3 = 0.0 - -#type = point -#gm = 1e-5 -#soft = .03 -#x = 0 -#y = 0 -#z = 0 - - -omega = 1.0 -qshear = 1.5 -shboxcoord = 2 # 1=xy; 2=xz -stratified_flag = false - - -rho0 = 1.0 -dens_min = 1.0e-10 -pres_min = 1.0e-13 -h = 1.0 -etaVk = 0.05 -amp = 0.1 -dust_to_gas = 0.2 diff --git a/inputs/dust/disk_cyl_dust10.in b/inputs/dust/disk_cyl_dust10.in deleted file mode 100644 index b8999b7f..00000000 --- a/inputs/dust/disk_cyl_dust10.in +++ /dev/null @@ -1,105 +0,0 @@ -# ======================================================================================== -# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. -# -# This program was produced under U.S. Government contract 89233218CNA000001 for Los -# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC -# for the U.S. Department of Energy/National Nuclear Security Administration. All rights -# in the program are reserved by Triad National Security, LLC, and the U.S. Department -# of Energy/National Nuclear Security Administration. The Government is granted for -# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide -# license in this material to reproduce, prepare derivative works, distribute copies to -# the public, perform publicly and display publicly, and to permit others to do so. -# ======================================================================================== - - -problem = disk # name of the pgen -coordinates = axisymmetric #cylindrical # coordinate system - - -problem_id = disk_cyl # problem ID: basename of output filenames - - -file_type = hst -dt = 0.5 - - -variables = gas.prim.density, & - gas.prim.velocity, & - gas.prim.pressure, & - dust.prim.density, & - dust.prim.velocity, & - dust.stopping_time -file_type = hdf5 # HDF5 data dump -dt = 5.0 # time increment between outputs - - -nlim = -1 # cycle limit -tlim = 62.8 # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 1 # interval for stdout summary info - - -nx1 = 128 # Number of zones in X1-direction -x1min = 0.4 # minimum value of X1 -x1max = 2.0 # maximum value of X1 -ix1_bc = ic # Inner-X1 boundary condition flag -ox1_bc = ic # Outer-X1 boundary condition flag - -nx2 = 1 # Number of zones in X2-direction -x2min = 0.0 # minimum value of X2 -x2max = 6.283185307179586 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = outflow # Inner-X3 boundary condition flag -ox3_bc = outflow # Outer-X3 boundary condition flag - - -nx1 = 128 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir - - -gas = true -dust = true -gravity = true - - -cfl = 0.8 -gamma = 1.01 -reconstruct = plm -riemann = hllc -dfloor = 1.0e-10 -siefloor = 1.0e-10 - - -reconstruct = plm -riemann = hlle -nspecies = 1 -const_stopping_time = false -enable_dust_drag = true -enable_dust_feedback = true -drag_method = implicit -grain_density = 1.25 -#rho_g0 = 0.3555 #g/cm^2, code-to-physical convert -size_input = direct -sizes = 10.0 # dust size, cm -surface_density_flag = true; #surface or volume density - - -gm = 1.0 - - - -r0 = 1.0 -rho0 = 1.0e-4 #pre-factor -dslope = -1.0 -tslope = -0.5 -h0 = 0.05 -dens_min = 1.0e-10 -pres_min = 1.0e-13 -mstar = 1.0 # Msun -r0_length = 50.0 # AU diff --git a/inputs/dust/dust_coagulation.in b/inputs/dust/dust_coagulation.in index 36455d5d..0af7e0fa 100644 --- a/inputs/dust/dust_coagulation.in +++ b/inputs/dust/dust_coagulation.in @@ -26,46 +26,46 @@ dt = 0.628 variables = gas.prim.density, & dust.prim.density -file_type = hdf5 # tab data dump -dt = 62.8 # time increment between outputs +file_type = hdf5 # tab data dump +dt = 62.8 # time increment between outputs file_type = rst dt = 628 -nlim = -1 # cycle limit -tlim = 6280. # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 1 # interval for stdout summary info +nlim = -1 # cycle limit +tlim = 6280. # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 1 # interval for stdout summary info nghost = 2 refinement = none # numlevel = 1 -nx1 = 16 # Number of zones in X1-direction -x1min = 9.0 # minimum value of X1 -x1max = 11.0 # maximum value of X1 -ix1_bc = outflow # Inner-X1 boundary condition flag -ox1_bc = outflow # Outer-X1 boundary condition flag +nx1 = 16 # Number of zones in X1-direction +x1min = 1.35e15 # minimum value of X1 +x1max = 1.64e15 # maximum value of X1 +ix1_bc = outflow # Inner-X1 boundary condition flag +ox1_bc = outflow # Outer-X1 boundary condition flag -nx2 = 1 # Number of zones in X2-direction -x2min = 0.0 # minimum value of X2 +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 x2max = 6.283185307179586 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir gas = true @@ -75,29 +75,26 @@ coagulation = true cfl = 0.9 gamma = 1.00001 -iso_sound_speed = 0.05 +iso_sound_speed = 0.05 # code unit cfl = 0.9 nspecies = 121 -const_stopping_time = false -enable_dust_drag = false -enable_dust_feedback = false -drag_method = implicit -#user_dt = 0.005 - +size_input = logspace scr_level = 1 # for reconstruction -surface_density_flag = true + +surface_density_flag = true # surface or volume density grain_density = 1.25 # dust internal density g/cc -size_input = logspace min_size = 1e-5 #cm max_size = 10.0 #cm -vfrag = 1000.0 $cm/s + + +vfrag = 1000.0 #cm/s coag_int = 1 coag_use_adaptiveStep = false -coag_mom_preserve = true - +coag_mom_preserve = false +coag_info_out = true nInit_dust = 11 # number of dust species initially @@ -106,4 +103,5 @@ nstep1Coag = 10 mstar = 1.0 # central star masss (m_sun) r0_length = 10.0 # 1 code unit (AU) rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 +const_coag_omega = true # using omega at r0_length diff --git a/inputs/dust/dust_coagulation_den.in b/inputs/dust/dust_coagulation_den.in index be3707b6..97de1305 100644 --- a/inputs/dust/dust_coagulation_den.in +++ b/inputs/dust/dust_coagulation_den.in @@ -26,46 +26,46 @@ dt = 0.628 variables = gas.prim.density, & dust.prim.density -file_type = hdf5 # tab data dump -dt = 62.8 # time increment between outputs +file_type = hdf5 # tab data dump +dt = 62.8 # time increment between outputs file_type = rst dt = 628 -nlim = -1 # cycle limit -tlim = 6280. # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 1 # interval for stdout summary info +nlim = 5 # cycle limit +tlim = 6280. # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 1 # interval for stdout summary info nghost = 2 refinement = none # numlevel = 1 -nx1 = 16 # Number of zones in X1-direction -x1min = 9.0 # minimum value of X1 -x1max = 11.0 # maximum value of X1 -ix1_bc = outflow # Inner-X1 boundary condition flag -ox1_bc = outflow # Outer-X1 boundary condition flag +nx1 = 16 # Number of zones in X1-direction +x1min = 1.35e15 # minimum value of X1 +x1max = 1.64e15 # maximum value of X1 +ix1_bc = outflow # Inner-X1 boundary condition flag +ox1_bc = outflow # Outer-X1 boundary condition flag -nx2 = 1 # Number of zones in X2-direction -x2min = 0.0 # minimum value of X2 +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 x2max = 6.283185307179586 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir gas = true @@ -75,34 +75,33 @@ coagulation = true cfl = 0.9 gamma = 1.00001 -iso_sound_speed = 0.05 +iso_sound_speed = 0.05 # code unit cfl = 0.9 nspecies = 121 -const_stopping_time = false -enable_dust_drag = false -enable_dust_feedback = false -drag_method = implicit -#user_dt = 0.005 +size_input = logspace scr_level = 1 # for reconstruction -surface_density_flag = false + +surface_density_flag = false # surface or volume density grain_density = 1.25 # dust internal density g/cc min_size = 1e-5 #cm max_size = 10.0 #cm -size_input = logspace -vfrag = 1000.0 $cm/s + + +vfrag = 1000.0 #cm/s coag_int = 1 coag_use_adaptiveStep = false coag_mom_preserve = false - +coag_info_out = true nInit_dust = 11 # number of dust species initially dust_to_gas = 0.01 -nstep1Coag = 10 +nstep1Coag = 1 mstar = 1.0 # central star masss (m_sun) r0_length = 10.0 # 1 code unit (AU) -#rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 -rho0 = 1.59577e-4 # 3D rho +rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 +const_coag_omega = true # using omega at r0_length + diff --git a/inputs/dust/dust_collision.in b/inputs/dust/dust_collision.in index 09a08df8..482c46e2 100644 --- a/inputs/dust/dust_collision.in +++ b/inputs/dust/dust_collision.in @@ -29,9 +29,10 @@ dt = 0.05 # time increment between outputs nlim = -1 # cycle limit -tlim = 0.05 # time limit +tlim = 0.05 # time limit integrator = rk2 # time integration algorithm ncycle_out = 1 # interval for stdout summary info +dt_user = 0.005 nghost = 2 @@ -39,31 +40,32 @@ refinement = none # numlevel = 1 nx1 = 16 # Number of zones in X1-direction -x1min = 0.0 # minimum value of X1 +x1min = 0.0 # minimum value of X1 x1max = 1.0 # maximum value of X1 -ix1_bc = periodic # Inner-X1 boundary condition flag -ox1_bc = periodic # Outer-X1 boundary condition flag +ix1_bc = periodic # Inner-X1 boundary condition flag +ox1_bc = periodic # Outer-X1 boundary condition flag -nx2 = 1 # Number of zones in X2-direction +nx2 = 1 # Number of zones in X2-direction x2min = -0.5 # minimum value of X2 -x2max = 0.5 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag +x2max = 0.5 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag -nx3 = 1 # Number of zones in X3-direction +nx3 = 1 # Number of zones in X3-direction x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir gas = true dust = true +drag = true cfl = 0.9 @@ -73,14 +75,17 @@ iso_sound_speed = 0.1 cfl = 0.9 nspecies = 2 -const_stopping_time = true -enable_dust_drag = true -enable_dust_feedback = true -drag_method = implicit -user_dt = 0.005 -size_input = none -stopping_time = 0.01, 0.002 +sizes = 1.0, 1.0 + + +type = constant +tau = 0.01, 0.001 # for iprob = 1 +#tau = 2.0, 1.0 # for iprob = 2 + + +type = simple_dust + -iprob = 1 +iprob = 1 # 1 or 2 diff --git a/src/artemis.cpp b/src/artemis.cpp index 63f72972..4421dc1e 100644 --- a/src/artemis.cpp +++ b/src/artemis.cpp @@ -105,7 +105,10 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { if (do_cooling) packages.Add(Gas::Cooling::Initialize(pin.get())); if (do_drag) packages.Add(Drag::Initialize(pin.get())); if (do_nbody) packages.Add(NBody::Initialize(pin.get())); - if (do_coagulation) packages.Add(Dust::Coagulation::Initialize(pin.get())); + if (do_coagulation) { + auto &dustPars = packages.Get("dust")->AllParams(); + packages.Add(Dust::Coagulation::Initialize(pin.get(), dustPars)); + } if (do_radiation) { auto eos_h = packages.Get("gas")->Param("eos_h"); auto opacity_h = packages.Get("gas")->Param("opacity_h"); @@ -146,25 +149,6 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { parthenon::MetadataFlag MetadataOperatorSplit = parthenon::Metadata::AddUserFlag("OperatorSplit"); - if (do_coagulation) { - typedef Coordinates C; - if (coords == C::cartesian) { - OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); - } else if (coords == C::spherical1D) { - OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); - } else if (coords == C::spherical2D) { - OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); - } else if (coords == C::spherical3D) { - OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); - } else if (coords == C::cylindrical) { - OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); - } else if (coords == C::axisymmetric) { - OperatorSplitTasks.push_back(&Dust::OperatorSplitDust); - } else { - PARTHENON_FAIL("Invalid artemis/coordinate system!"); - } - } - // Add in user-defined AMR criterion callback const bool amr_user = pin->GetOrAddBoolean("artemis", "amr_user", false); if (amr_user) artemis->CheckRefinementBlock = artemis::ProblemCheckRefinementBlock; diff --git a/src/artemis.hpp b/src/artemis.hpp index 8cd37002..38506bfe 100644 --- a/src/artemis.hpp +++ b/src/artemis.hpp @@ -67,13 +67,11 @@ namespace prim { ARTEMIS_VARIABLE(dust.prim, density); ARTEMIS_VARIABLE(dust.prim, velocity); } // namespace prim -ARTEMIS_VARIABLE(dust, stopping_time); } // namespace dust #undef ARTEMIS_VARIABLE // TaskCollection function pointer for operator split tasks -using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, parthenon::SimTime &tm, - const Real dt); +using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, parthenon::SimTime &tm); // Constants that enumerate... // ...Coordinate systems @@ -150,7 +148,7 @@ inline int ProblemDimension(parthenon::ParameterInput *pin) { namespace artemis { extern std::function *mbd)> ProblemCheckRefinementBlock; -extern std::vector OperatorSplitTasks; +// extern std::vector OperatorSplitTasks; } // namespace artemis #endif // ARTEMIS_ARTEMIS_HPP_ diff --git a/src/artemis_driver.cpp b/src/artemis_driver.cpp index 455360c4..59960ad0 100644 --- a/src/artemis_driver.cpp +++ b/src/artemis_driver.cpp @@ -112,11 +112,8 @@ TaskListStatus ArtemisDriver::Step() { if (do_radiation) status = IMC::JaybenneIMC(pmesh, tm.time, tm.dt); if (status != TaskListStatus::complete) return status; - // Execute operator split physics - for (auto &fn : OperatorSplitTasks) { - status = fn(pmesh, tm, integrator->dt).Execute(); - if (status != TaskListStatus::complete) return status; - } + if (do_coagulation) status = Dust::OperatorSplitDust(pmesh, tm); + if (status != TaskListStatus::complete) return status; // Compute new dt, (de)refine, and handle sparse (if enabled) status = PostStepTasks().Execute(); @@ -189,13 +186,7 @@ TaskCollection ArtemisDriver::StepTasks() { const bool do_pcm = ((stage == 1) && (integrator->GetName() == "vl2")); TaskID gas_flx = none, dust_flx = none; if (do_gas) gas_flx = tl.AddTask(none, Gas::CalculateFluxes, u0.get(), do_pcm); - if (do_dust) { - // update dust stopping time and dust diffusivity - TaskID dust_stopping_time = - tl.AddTask(none, Dust::UpdateDustStoppingTime, u0.get()); - dust_flx = - tl.AddTask(dust_stopping_time, Dust::CalculateFluxes, u0.get(), do_pcm); - } + if (do_dust) dust_flx = tl.AddTask(none, Dust::CalculateFluxes, u0.get(), do_pcm); // Compute (gas) diffusive fluxes TaskID diff_flx = none; diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index f008076b..4829e0b9 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -17,31 +17,43 @@ #include "dust/dust.hpp" #include "geometry/geometry.hpp" -using namespace parthenon::package::prelude; - namespace Dust { namespace Coagulation { //---------------------------------------------------------------------------------------- //! \fn StateDescriptor Coagulalation::Initialize //! \brief Adds intialization function for coagulation package -std::shared_ptr Initialize(ParameterInput *pin) { +std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars) { auto coag = std::make_shared("coagulation"); Params ¶ms = coag->AllParams(); CoagParams cpars; - const int nm = pin->GetOrAddInteger("dust", "nspecies", 1); + + const int nm = dustPars.template Get("nspecies"); + const Real dfloor = dustPars.template Get("dfloor"); + const Real rho_p = dustPars.template Get("grain_density"); cpars.nm = nm; cpars.vfrag = pin->GetOrAddReal("dust", "vfrag", 1.e3); // cm/s cpars.nlim = 1e10; - cpars.integrator = pin->GetOrAddInteger("dust", "coag_int", 3); - cpars.use_adaptive = pin->GetOrAddBoolean("dust", "coag_use_adaptiveStep", true); - cpars.mom_coag = pin->GetOrAddBoolean("dust", "coag_mom_preserve", true); - cpars.nCall_mx = pin->GetOrAddInteger("dust", "coag_nsteps_mx", 1000); - // dust particle internal density g/cc - const Real rho_p = pin->GetOrAddReal("dust", "grain_density", 1.25); + cpars.integrator = pin->GetOrAddInteger("dust/coagulation", "coag_int", 3); + cpars.use_adaptive = + pin->GetOrAddBoolean("dust/coagulation", "coag_use_adaptiveStep", true); + cpars.mom_coag = pin->GetOrAddBoolean("dust/coagulation", "coag_mom_preserve", true); + cpars.nCall_mx = pin->GetOrAddInteger("dust/coagulation", "coag_nsteps_mx", 1000); cpars.rho_p = rho_p; - cpars.ibounce = pin->GetOrAddBoolean("dust", "coag_bounce", false); + const Real M_SUN = 1.988409870698051e33; // gram (sun) + const Real GRAV_CONST = 6.674299999999999e-8; // gravitational const in cm^3 g^-1 s^-2 + const Real mstar = pin->GetOrAddReal("problem", "mstar", 1.0) * M_SUN; + cpars.gm = std::sqrt(GRAV_CONST * mstar); + const bool const_omega = pin->GetOrAddBoolean("problem", "const_coag_omega", false); + cpars.const_omega = const_omega; + if (const_omega) { + const Real AU_LENGTH = 1.4959787070000e13; // cm + const Real r0 = pin->GetOrAddReal("problem", "r0_length", 1.0) * AU_LENGTH; + cpars.gm /= (std::sqrt(r0) * r0); + } + + cpars.ibounce = pin->GetOrAddBoolean("dust/coagulation", "coag_bounce", false); int coord_type = 0; // density @@ -72,28 +84,17 @@ std::shared_ptr Initialize(ParameterInput *pin) { cpars.errcon = std::pow((5. / cpars.S), (1. / cpars.pgrow)); } - const Real s_min = pin->GetReal("dust", "min_size"); - const Real s_max = pin->GetReal("dust", "max_size"); - const Real mmin = 4.0 * M_PI / 3.0 * rho_p * std::pow(s_min, 3); - const Real mmax = 4.0 * M_PI / 3.0 * rho_p * std::pow(s_max, 3); - const Real cond = 1.0 / (1.0 - nm) * std::log(mmin / mmax); - const Real conc = std::log(mmin); + auto h_sizes = dustPars.template Get>("h_sizes"); + const Real cond = 3.0 / (1.0 - nm) * std::log(h_sizes(0) / h_sizes(nm - 1)); if (std::exp(cond) > std::sqrt(2.0)) { std::stringstream msg; msg << "### FATAL ERROR in dust with coagulation: using nspecies >" - << std::log(mmax / mmin) / (std::log(std::sqrt(2.0))) + 1. << " instead of " << nm - << std::endl; + << 3.0 * std::log(h_sizes(nm - 1) / h_sizes(0)) / (std::log(std::sqrt(2.0))) + 1. + << " instead of " << nm << std::endl; PARTHENON_FAIL(msg); } - ParArray1D dust_size("dustSize", nm); - auto dust_size_host = dust_size.GetHostMirror(); - - for (int n = 0; n < nm; ++n) { - Real mgrid = std::exp(conc + cond * n); - dust_size_host(n) = std::pow(3.0 * mgrid / (4.0 * M_PI * cpars.rho_p), 1. / 3.); - } - dust_size.DeepCopy(dust_size_host); + auto dust_size = dustPars.template Get>("sizes"); // allocate array and assign values cpars.klf = ParArray2D("klf", nm, nm); @@ -103,16 +104,8 @@ std::shared_ptr Initialize(ParameterInput *pin) { cpars.cpod_notzero = ParArray3D("idx_nzcpod", nm, nm, 4); cpars.cpod_short = ParArray3D("nzcpod", nm, nm, 4); - if (Dust::cgsunit == NULL) { - Dust::cgsunit = new CGSUnit; - } - if (!Dust::cgsunit->isSet()) { - Dust::cgsunit->SetCGSUnit(pin); - } - const Real dfloor = pin->GetOrAddReal("dust", "dfloor", 1.0e-25); - // convert to CGS unit - cpars.dfloor = dfloor * Dust::cgsunit->mass0 / Dust::cgsunit->vol0; - Real a = std::log10(mmin / mmax) / static_cast(1 - nm); + cpars.dfloor = dfloor; + Real a = 3.0 * std::log10(h_sizes(0) / h_sizes(nm - 1)) / static_cast(1 - nm); initializeArray(nm, cpars.pGrid, cpars.rho_p, cpars.chi, a, dust_size, cpars.klf, cpars.mass_grid, cpars.coagR3D, cpars.cpod_notzero, cpars.cpod_short); @@ -124,10 +117,12 @@ std::shared_ptr Initialize(ParameterInput *pin) { params.Add("nstep1Coag", nstep1Coag); Real dtCoag = 0.0; params.Add("dtCoag", dtCoag, Params::Mutability::Restart); - const Real alpha = pin->GetOrAddReal("dust", "coag_alpha", 1.e-3); + const Real alpha = pin->GetOrAddReal("dust/coagulation", "coag_alpha", 1.e-3); params.Add("coag_alpha", alpha); - const int scr_level = pin->GetOrAddReal("dust", "coag_scr_level", 0); + const int scr_level = pin->GetOrAddReal("dust/coagulation", "coag_scr_level", 0); params.Add("coag_scr_level", scr_level); + const bool info_out = pin->GetOrAddBoolean("dust/coagulation", "coag_info_out", false); + params.Add("coag_info_out", info_out); return coag; } @@ -139,23 +134,21 @@ void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &ch ParArray3D cpod_notzero, ParArray3D cpod_short) { int ikdelta = coag2DRv::kdelta; - auto kdelta = Kokkos::subview(coag3D, ikdelta, Kokkos::ALL, Kokkos::ALL); int icoef_fett = coag2DRv::coef_fett; - auto coef_fett = Kokkos::subview(coag3D, icoef_fett, Kokkos::ALL, Kokkos::ALL); parthenon::par_for( parthenon::loop_pattern_flatrange_tag, "initializeCoag1", parthenon::DevExecSpace(), 0, nm - 1, KOKKOS_LAMBDA(const int i) { // initialize in_idx(*) array // initialize kdelta array for (int j = 0; j < nm; j++) { - kdelta(i, j) = 0.0; + coag3D(ikdelta, i, j) = 0.0; } - kdelta(i, i) = 1.0; - mass_grid(i) = 4.0 * M_PI / 3.0 * rho_p * std::pow(dsize(i), 3); - // initialize coef_fett(*,*) + coag3D(ikdelta, i, i) = 1.0; + mass_grid(i) = 4.0 * M_PI / 3.0 * rho_p * dsize(i) * dsize(i) * dsize(i); + // initialize coag3D(icoef_fett, *,*) for (int j = 0; j < nm; j++) { - Real tmp1 = (1.0 - 0.5 * kdelta(i, j)); - coef_fett(i, j) = M_PI * SQR(dsize(i) + dsize(j)) * tmp1; + Real tmp1 = (1.0 - 0.5 * coag3D(ikdelta, i, j)); + coag3D(icoef_fett, i, j) = M_PI * SQR(dsize(i) + dsize(j)) * tmp1; } }); @@ -171,20 +164,17 @@ void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &ch int iphiFrag = coag2DRv::phiFrag, iepsFrag = coag2DRv::epsFrag; int iaFrag = coag2DRv::aFrag; - auto phiFrag = Kokkos::subview(coag3D, iphiFrag, Kokkos::ALL, Kokkos::ALL); - auto epsFrag = Kokkos::subview(coag3D, iepsFrag, Kokkos::ALL, Kokkos::ALL); - auto aFrag = Kokkos::subview(coag3D, iaFrag, Kokkos::ALL, Kokkos::ALL); parthenon::par_for( parthenon::loop_pattern_flatrange_tag, "initializeCoag2", parthenon::DevExecSpace(), 0, nm - 1, KOKKOS_LAMBDA(const int i) { Real sum_pF = 0.0; for (int j = 0; j <= i; j++) { - phiFrag(j, i) = std::pow(mass_grid(j), frag_slope); - sum_pF += phiFrag(j, i); + coag3D(iphiFrag, j, i) = std::pow(mass_grid(j), frag_slope); + sum_pF += coag3D(iphiFrag, j, i); } // normalization for (int j = 0; j <= i; j++) { - phiFrag(j, i) /= sum_pF; // switch (i,j) from fortran + coag3D(iphiFrag, j, i) /= sum_pF; // switch (i,j) from fortran } // Cratering @@ -195,18 +185,18 @@ void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &ch // Mass bin of largest fragment klf(i, j) = j; - aFrag(i, j) = (1.0 + chi) * mass_grid(j); - // |_____________| - // | + coag3D(iaFrag, i, j) = (1.0 + chi) * mass_grid(j); + // |_______| + // | // Mass of fragments - epsFrag(i, j) = chi * mass_grid(j) / (mass_grid(i) * (1.0 - ten_ma)); + coag3D(iepsFrag, i, j) = chi * mass_grid(j) / (mass_grid(i) * (1.0 - ten_ma)); } int i1 = std::max(0, i - pGrid); for (int j = i1; j <= i; j++) { // The largest fragment has the mass of the larger collison partner klf(i, j) = i; - aFrag(i, j) = (mass_grid(i) + mass_grid(j)); + coag3D(iaFrag, i, j) = (mass_grid(i) + mass_grid(j)); } }); @@ -215,18 +205,16 @@ void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &ch // Calculate the E matrix ParArray2D e("epod", nm, nm); int idalp = coag2DRv::dalp, idpod = coag2DRv::dpod; - auto dalp = Kokkos::subview(coag3D, idalp, Kokkos::ALL, Kokkos::ALL); - auto dpod = Kokkos::subview(coag3D, idpod, Kokkos::ALL, Kokkos::ALL); parthenon::par_for( parthenon::loop_pattern_flatrange_tag, "initializeCoag4", parthenon::DevExecSpace(), 0, nm - 1, KOKKOS_LAMBDA(const int k) { for (int j = 0; j < nm; j++) { if (j <= k + 1 - ce) { - dalp(k, j) = 1.0; - dpod(k, j) = -mass_grid(j) / (mass_grid(k) * (ten_a - 1.0)); + coag3D(idalp, k, j) = 1.0; + coag3D(idpod, k, j) = -mass_grid(j) / (mass_grid(k) * (ten_a - 1.0)); } else { - dpod(k, j) = -1.0; - dalp(k, j) = 0.0; + coag3D(idpod, k, j) = -1.0; + coag3D(idalp, k, j) = 0.0; } } // for E matrix------------- @@ -272,10 +260,10 @@ void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &ch Real dtheta_ji = (j - i - 0.5 < 0.0) ? 0.0 : 1.0; // theta(j - i - 0.5); for (int k = 0; k < nm; k++) { Real theta_kj = (k - j - 1.5 < 0.0) ? 0.0 : 1.0; // theta(k - j - 1.5) - cpod(i, j, k) = (0.5 * kdelta(i, j) * cpod(i, j, k) + + cpod(i, j, k) = (0.5 * coag3D(ikdelta, i, j) * cpod(i, j, k) + cpod(i, j, k) * theta_kj * dtheta_ji); } - cpod(i, j, j) += dpod(j, i); + cpod(i, j, j) += coag3D(idpod, j, i); cpod(i, j, j + 1) += e(j + 1, i) * dtheta_ji; } // end if diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index 454e0db0..5e5a8358 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -21,7 +21,7 @@ namespace Coagulation { enum coag2DRv { dpod, aFrag, phiFrag, epsFrag, dalp, kdelta, coef_fett, last2 }; -std::shared_ptr Initialize(ParameterInput *pin); +std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars); struct CoagParams { int coord = 0; // 1--surface density, 0: 3D @@ -44,7 +44,9 @@ struct CoagParams { Real err_eps; // Relative tolerance for adaptive step sizing Real S; // Safety margin for adaptive step sizing Real cfl; - Real errcon; // Needed for increasing step size + Real errcon; // Needed for increasing step size + Real gm; // sqrt(grav_const * mstar); + bool const_omega; // for shearing-box or testing // pre-calculated array, once-for-all ParArray2D klf; @@ -79,32 +81,32 @@ Real v_rel_ormel(Real tau_1, Real tau_2, Real t0, Real v0, Real ts, Real vs, st2 = tau_mn / t0; } - vg2 = 1.5 * pow(v0, 2); // note the square - ya = 1.6; // approximate solution for st*=y*st1; valid for st1 << 1. + vg2 = 1.5 * SQR(v0); // note the square + ya = 1.6; // approximate solution for st*=y*st1; valid for st1 << 1. Real sqRe = 1.0 / sqrt(reynolds); if (tau_mx < 0.2 * ts) { // very small regime - return 1.5 * pow((vs / ts * (tau_mx - tau_mn)), 2); + return 1.5 * SQR((vs / ts * (tau_mx - tau_mn))); } else if (tau_mx < ts / ya) { return vg2 * (st1 - st2) / (st1 + st2) * - (pow(st1, 2) / (st1 + sqRe) - pow(st2, 2) / (st2 + sqRe)); + (SQR(st1) / (st1 + sqRe) - SQR(st2) / (st2 + sqRe)); } else if (tau_mx < 5.0 * ts) { // eq. 17 of oc07. the second term with st_i**2.0 is negligible (assuming re>>1) // hulp1 = eq. 17; hulp2 = eq. 18 - hulp1 = ((st1 - st2) / (st1 + st2) * - (pow(st1, 2) / (st1 + ya * st1) - - pow(st2, 2) / (st2 + ya * st1))); // note the -sign - hulp2 = 2.0 * (ya * st1 - sqRe) + pow(st1, 2.0) / (ya * st1 + st1) - - pow(st1, 2) / (st1 + sqRe) + pow(st2, 2) / (ya * st1 + st2) - - pow(st2, 2) / (st2 + sqRe); + hulp1 = + ((st1 - st2) / (st1 + st2) * + (SQR(st1) / (st1 + ya * st1) - SQR(st2) / (st2 + ya * st1))); // note the -sign + hulp2 = 2.0 * (ya * st1 - sqRe) + SQR(st1) / (ya * st1 + st1) - + SQR(st1) / (st1 + sqRe) + SQR(st2) / (ya * st1 + st2) - + SQR(st2) / (st2 + sqRe); return vg2 * (hulp1 + hulp2); } else if (tau_mx < t0 / 5.0) { // full intermediate regime eps = st2 / st1; // stopping time ratio - return vg2 * - (st1 * (2.0 * ya - (1.0 + eps) + - 2.0 / (1.0 + eps) * (1.0 / (1.0 + ya) + pow(eps, 3) / (ya + eps)))); + return vg2 * (st1 * (2.0 * ya - (1.0 + eps) + + 2.0 / (1.0 + eps) * + (1.0 / (1.0 + ya) + (eps * eps * eps) / (ya + eps)))); } else if (tau_mx < t0) { // now y* lies between 1.6 (st1 << 1) and 1.0 (st1>=1). the fit below fits ystar to // less than 1% @@ -112,12 +114,13 @@ Real v_rel_ormel(Real tau_1, Real tau_2, Real t0, Real v0, Real ts, Real vs, c2 = 0.32938936; c1 = -0.63119577; c0 = 1.6015125; - y_star = c0 + c1 * st1 + c2 * pow(st1, 2) + c3 * pow(st1, 3); + y_star = c0 + c1 * st1 + c2 * SQR(st1) + c3 * (st1 * st1 * st1); // we can then employ the same formula as before eps = st2 / st1; // stopping time ratio - return vg2 * (st1 * (2.0 * y_star - (1.0 + eps) + - 2.0 / (1.0 + eps) * - (1.0 / (1.0 + y_star) + pow(eps, 3) / (y_star + eps)))); + return vg2 * + (st1 * (2.0 * y_star - (1.0 + eps) + + 2.0 / (1.0 + eps) * + (1.0 / (1.0 + y_star) + (eps * eps * eps) / (y_star + eps)))); } else { // heavy particle limit return vg2 * (1.0 / (1.0 + st1) + 1.0 / (1.0 + st2)); diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index 916c672e..b01494b5 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -27,10 +27,10 @@ #include "utils/fluxes/fluid_fluxes.hpp" #include "utils/history.hpp" +using ArtemisUtils::EOS; using ArtemisUtils::VI; namespace Dust { -CGSUnit *cgsunit = NULL; //---------------------------------------------------------------------------------------- //! \fn StateDescriptor Dust::Initialize //! \brief Adds intialization function for dust hydrodynamics package @@ -107,12 +107,14 @@ std::shared_ptr Initialize(ParameterInput *pin) { params.Add("hst_out_d2g", hst_out_d2g); // coagulation flag - bool enable_dust_coagulation = pin->GetOrAddBoolean("physics", "coagulation", false); + bool do_coagulation = pin->GetOrAddBoolean("physics", "coagulation", false); // Dust sizes auto size_dist = pin->GetOrAddString("dust", "size_input", "direct"); - if (enable_dust_coagulation) size_dist = "logspace"; - params.Add("enable_coagulation", enable_dust_coagulation); + if (do_coagulation) { + PARTHENON_REQUIRE(size_dist == "logspace", + "dust coagulation requires size_input = logspace!"); + } if (size_dist == "linspace") { // uniform @@ -146,11 +148,6 @@ std::shared_ptr Initialize(ParameterInput *pin) { params.Add("sizes", sizes); params.Add("h_sizes", h_sizes); - if (parthenon::Globals::my_rank == 0) { - for (int n = 0; n < nspecies; n++) { - std::cout << "dust_size(" << n << ")=" << h_sizes(n) << std::endl; - } - } } else if (size_dist == "direct") { // specify them directly auto sizes_v = pin->GetVector("dust", "sizes"); @@ -188,38 +185,8 @@ std::shared_ptr Initialize(ParameterInput *pin) { } // Dust density - const Real rho_p_orig = pin->GetOrAddReal("dust", "grain_density", 1.0); - params.Add("grain_density", rho_p_orig); - - if (enable_dust_coagulation) { - if (cgsunit == NULL) { - cgsunit = new CGSUnit; - } - if (!cgsunit->isSet()) { - cgsunit->SetCGSUnit(pin); - } - params.Add("cgs_unit", cgsunit); - - Real rho_p = rho_p_orig; - // density in physical unit correspinding to code unit 1. - // const Real rho_g0 = pin->GetOrAddReal("dust", "rho_g0", 1.0); - const Real rho_g0 = cgsunit->mass0 / cgsunit->vol0; - // re-scale rho_p to account for rho_g0 for stopping_time calculation - rho_p /= rho_g0; - - // re-scale rho_p by prefactor coefficient - if (cgsunit->isurface_den) { - rho_p *= 0.5 * M_PI; - } else { - rho_p *= std::sqrt(M_PI / 8.); - rho_p /= cgsunit->length0; - } + params.Add("grain_density", pin->GetOrAddReal("dust", "grain_density", 1.0)); - if (parthenon::Globals::my_rank == 0) { - std::cout << "rho_p, rho_g0=" << rho_p << " " << rho_g0 << std::endl; - } - params.Add("rho_p", rho_p); - } // Scratch for dust flux const int scr_level = pin->GetOrAddInteger("dust", "scr_level", 0); params.Add("scr_level", scr_level); @@ -257,14 +224,6 @@ std::shared_ptr Initialize(ParameterInput *pin) { m.SetSparseThresholds(0.0, 0.0, 0.0); dust->AddSparsePool(m, control_field, dustids); - // dust stopping-time - m = Metadata({Metadata::Cell, Metadata::Derived, Metadata::Intensive, Metadata::OneCopy, - Metadata::Sparse}); - m.SetSparseThresholds(0.0, 0.0, 0.0); - dust->AddSparsePool(m, control_field, dustids); - // std::vector stopping_id = {0}; - // dust->AddSparsePool(m, control_field, stopping_id); - // Dust hydrodynamics timestep if (coords == Coordinates::cartesian) { dust->EstimateTimestepMesh = EstimateTimestepMesh; @@ -285,81 +244,6 @@ std::shared_ptr Initialize(ParameterInput *pin) { return dust; } -//---------------------------------------------------------------------------------------- -//! \fn TaskStatus Dust::UpdateDustStoppingTime -// \brief Wrapper function for update dust stopping time -template -TaskStatus UpdateDustStoppingTime(MeshData *md) { - - using parthenon::MakePackDescriptor; - - auto pm = md->GetParentPointer(); - - auto &dust_pkg = pm->packages.Get("dust"); - if ((!dust_pkg->template Param("enable_coagulation"))) { - return TaskStatus::complete; - } - - auto &resolved_pkgs = pm->resolved_packages; - - IndexRange ib = md->GetBoundsI(IndexDomain::interior); - IndexRange jb = md->GetBoundsJ(IndexDomain::interior); - IndexRange kb = md->GetBoundsK(IndexDomain::interior); - - const int nspecies = dust_pkg->template Param("nspecies"); - - const bool isurf_den = cgsunit->isurface_den; - ParArray1D dust_size = dust_pkg->template Param>("sizes"); - static auto desc = - MakePackDescriptor( - resolved_pkgs.get()); - - auto vmesh = desc.GetPack(md); - - auto &gas_pkg = pm->packages.Get("gas"); - - const Real gamma = gas_pkg->template Param("adiabatic_index"); - const Real rho_p = dust_pkg->template Param("rho_p"); - - parthenon::par_for( - DEFAULT_LOOP_PATTERN, "Dust::DustStoppingTime2", parthenon::DevExecSpace(), 0, - md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i) { - const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); - // usually the Stokes number depends gas density, unless constant is used - // stopping_time = Stokes_number/Omega_k - - if (isurf_den) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - // for surface denstiy, Stokes number = Pi/2*rho_p*s_p/sigma_g - // calculate the Keplerian Omega at mid-plane - Real rad; - if constexpr (GEOM == Coordinates::cylindrical) { - rad = coords.hx2v(); // cylindrical-rad - } else { - rad = coords.hx3v(); - } - Real Omega_k = 1.0 / std::sqrt(rad) / rad; - for (int n = 0; n < nspecies; ++n) { - const Real St = rho_p * dust_size(n) / dens_g; - vmesh(b, dust::stopping_time(n), k, j, i) = St / Omega_k; - } - - } else { - - // for density (g/cc), Stokes number = sqrt(Pi/8)*rho_p*s_p*Omega_k/rho_g/Cs - const Real pres = vmesh(b, gas::prim::pressure(0), k, j, i); - const Real cs = std::sqrt(gamma * pres / dens_g); - for (int n = 0; n < nspecies; ++n) { - const Real StOme = rho_p * dust_size(n) / dens_g; - vmesh(b, dust::stopping_time(n), k, j, i) = StOme / cs; - } - } - }); - - return TaskStatus::complete; -} - //---------------------------------------------------------------------------------------- //! \fn Real Dust::EstimateTimestepMesh //! \brief Compute dust hydrodynamics timestep @@ -372,13 +256,11 @@ Real EstimateTimestepMesh(MeshData *md) { auto &dust_pkg = pm->packages.Get("dust"); auto ¶ms = dust_pkg->AllParams(); - auto userDt = params.template Get("user_dt"); auto nspecies = params.template Get("nspecies"); const auto cfl_number = params.template Get("cfl"); static auto desc = - MakePackDescriptor( - resolved_pkgs.get()); + MakePackDescriptor(resolved_pkgs.get()); auto vmesh = desc.GetPack(md); IndexRange ib = md->GetBoundsI(IndexDomain::interior); IndexRange jb = md->GetBoundsJ(IndexDomain::interior); @@ -399,12 +281,12 @@ Real EstimateTimestepMesh(MeshData *md) { for (int d = 0; d < ndim; d++) { denom += std::abs(vmesh(b, dust::prim::velocity(VI(n, d)), k, j, i)) / dx[d]; } - ldt = std::min(ldt, 1.0 / denom * cfl_number); + ldt = std::min(ldt, 1.0 / denom); } }, Kokkos::Min(min_dt)); - return std::min(userDt, min_dt); + return (cfl_number * min_dt); } //---------------------------------------------------------------------------------------- @@ -457,7 +339,6 @@ TaskStatus FluxSource(MeshData *md, const Real dt) { return TaskStatus::complete; } -//#define COAG_DEBUG //---------------------------------------------------------------------------------------- //! \fn TaskStatus Dust::CoagulationOneStep // \brief Wrapper function for coagulation procedure in one time step @@ -472,76 +353,76 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt IndexRange kb = md->GetBoundsK(IndexDomain::interior); auto &gas_pkg = pm->packages.Get("gas"); - const Real gamma = gas_pkg->template Param("adiabatic_index"); + auto eos_d = gas_pkg->template Param("eos_d"); auto &resolved_pkgs = pm->resolved_packages; const int nspecies = dust_pkg->template Param("nspecies"); + auto &dust_size = dust_pkg->template Param>("sizes"); auto &coag_pkg = pm->packages.Get("coagulation"); auto &coag = coag_pkg->template Param("coag_pars"); - PARTHENON_REQUIRE(cgsunit->isSet(), - "coagulation requires setting code-to-physical unit in user routine"); - static auto desc = - MakePackDescriptor(resolved_pkgs.get()); + MakePackDescriptor( + resolved_pkgs.get()); auto vmesh = desc.GetPack(md); const Real alpha = coag_pkg->template Param("coag_alpha"); // 1e-3 - const int nvel = 3; + int nvel = 3; + if (coag.coord) nvel = 2; // surface-density + auto &dfloor = dust_pkg->template Param("dfloor"); const int scr_level = coag_pkg->template Param("coag_scr_level"); + auto info_out_flag = coag_pkg->template Param("coag_info_out"); + size_t isize = (5 + nvel) * nspecies; if (coag.integrator == 3 && coag.mom_coag) isize += nspecies; size_t scr_size = ScratchPad1D::shmem_size(isize); - const Real den0 = cgsunit->mass0 / cgsunit->vol0; - const Real time0 = cgsunit->time0; - // const Real vol0 = cgsunit->vol0; - const Real vel0 = cgsunit->length0 / cgsunit->time0; auto pmb = md->GetBlockData(0)->GetBlockPointer(); - ParArray3D nCalls("nCalls", pmb->cellbounds.ncellsk(IndexDomain::entire), - pmb->cellbounds.ncellsj(IndexDomain::entire), - pmb->cellbounds.ncellsi(IndexDomain::entire)); + ParArray3D nCalls; + int maxCalls, maxSize, maxSize0; + Real massd0, massd; + if (info_out_flag) { + nCalls = ParArray3D("coag_nCalls", pmb->cellbounds.ncellsk(IndexDomain::entire), + pmb->cellbounds.ncellsj(IndexDomain::entire), + pmb->cellbounds.ncellsi(IndexDomain::entire)); + maxCalls = 0; + maxSize = 1; + massd = 0.0; + + maxSize0 = 1; + massd0 = 0.0; - int maxCalls = 0, maxSize = 1; - auto &dfloor = dust_pkg->template Param("dfloor"); - - int maxSize0 = 1; - Real massd = 0.0; - Kokkos::parallel_reduce( - "coag::maxSize0", - Kokkos::MDRangePolicy>( - {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, - int &lmax) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - for (int n = 0; n < nspecies; ++n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - lsum += dens_d * coords.Volume(); - } - for (int n = nspecies - 1; n >= 0; --n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - if (dens_d > dfloor) { - lmax = std::max(lmax, n); - break; + Kokkos::parallel_reduce( + "coag::maxSize0", + Kokkos::MDRangePolicy>( + {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, + int &lmax) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + for (int n = 0; n < nspecies; ++n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + lsum += dens_d * coords.Volume(); } - } - }, - massd, Kokkos::Max(maxSize0)); + for (int n = nspecies - 1; n >= 0; --n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + if (dens_d > dfloor) { + lmax = std::max(lmax, n); + break; + } + } + }, + massd0, Kokkos::Max(maxSize0)); #ifdef MPI_PARALLEL - // Sum the perturbations over all processors - MPI_Reduce(MPI_IN_PLACE, &maxSize0, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); - MPI_Reduce(MPI_IN_PLACE, &massd, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); + // Sum over all processors + MPI_Reduce(MPI_IN_PLACE, &maxSize0, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); + MPI_Reduce(MPI_IN_PLACE, &massd0, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); #endif // MPI_PARALLEL + } // end if (info_out_flag) - Real sumd1 = 0.0; -#ifdef COAG_DEBUG - ParArray3D floor_tmp("floor_tmp", 17, nspecies, 2); -#endif for (int b = 0; b < md->NumBlocks(); b++) { parthenon::par_for_outer( DEFAULT_OUTER_LOOP_PATTERN, "Dust::Coagulation", parthenon::DevExecSpace(), @@ -552,24 +433,25 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt const int nDust_live = (vmesh.GetUpperBound(b, dust::prim::density()) - vmesh.GetLowerBound(b, dust::prim::density()) + 1); - const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i) * den0; - Real dt_sync = dt * time0; - const Real time1 = time * time0; + const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); + Real dt_sync = dt; + const Real time1 = time; geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); const auto &hx = coords.GetScaleFactors(); - Real rad = hx[2]; - if constexpr (GEOM == Coordinates::cylindrical) { - rad = hx[1]; - } - const Real Omega_k = 1.0 / std::sqrt(rad) / rad; // code unit - // const Real vol1 = coords.Volume() * vol0; + const auto &xv = coords.GetCellCenter(); + const auto &xcyl = coords.ConvertToCyl(xv); + + const Real rad = xcyl[0]; // cylindrical + const Real Omega_k = + coag.const_omega ? coag.gm : coag.gm / std::sqrt(rad) / rad; // code unit int nCall1 = 0; - const Real pres = vmesh(b, gas::prim::pressure(0), k, j, i); - const Real cs = std::sqrt(gamma * pres / dens_g * den0) * vel0; - const Real omega1 = Omega_k / time0; + const Real sie = vmesh(b, gas::prim::sie(0), k, j, i); + const Real bulk = eos_d.BulkModulusFromDensityInternalEnergy(dens_g, sie); + const Real cs = std::sqrt(bulk / dens_g); + const Real omega1 = Omega_k; const int nm = nspecies; ScratchPad1D rhod(mbr.team_scratch(scr_level), nspecies); @@ -583,23 +465,28 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt Q2 = ScratchPad1D(mbr.team_scratch(scr_level), nspecies); } + // calculate the stopping time on the fly + Real st0 = 1.0; + if (coag.coord) { // surface density + st0 = 0.5 * M_PI * coag.rho_p / dens_g / omega1; + } else { + st0 = std::sqrt(M_PI / 8.0) * coag.rho_p / dens_g / cs; + } + parthenon::par_for_inner( DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { - // for (int n = 0; n < nm; ++n) { - stime(n) = vmesh(b, dust::stopping_time(n), k, j, i) * time0; + // calculate the stopping time on fly + stime(n) = st0 * dust_size(n); if (vmesh(b, dust::prim::density(n), k, j, i) > dfloor) { - rhod(n) = vmesh(b, dust::prim::density(n), k, j, i) * den0; - vel(0 + n * 3) = - vmesh(b, dust::prim::velocity(VI(n, 0)), k, j, i) * vel0; - vel(1 + n * 3) = - vmesh(b, dust::prim::velocity(VI(n, 1)), k, j, i) * vel0; - vel(2 + n * 3) = - vmesh(b, dust::prim::velocity(VI(n, 2)), k, j, i) * vel0; + rhod(n) = vmesh(b, dust::prim::density(n), k, j, i); + for (int d = 0; d < nvel; d++) { + vel(VI(n, d)) = vmesh(b, dust::prim::velocity(VI(n, d)), k, j, i); + } } else { rhod(n) = 0.0; - vel(0 + n * 3) = 0.0; - vel(1 + n * 3) = 0.0; - vel(2 + n * 3) = 0.0; + for (int d = 0; d < nvel; d++) { + vel(VI(n, d)) = 0.0; + } } }); @@ -607,94 +494,98 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt vel, nvel, Q, nQs, alpha, cs, omega1, coag, source, nCall1, Q2); - nCalls(k, j, i) = nCall1; + if (info_out_flag) nCalls(k, j, i) = nCall1; // update dust density and velocity after coagulation parthenon::par_for_inner( DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { // for (int n = 0; n < nspecies; ++n) { if (rhod(n) > 0.0) { - const Real rhod1 = rhod(n) / den0; + const Real rhod1 = rhod(n); vmesh(b, dust::cons::density(n), k, j, i) = rhod1; - vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i) = - rhod1 * vel(0 + n * 3) * hx[0] / vel0; - vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i) = - rhod1 * vel(1 + n * 3) * hx[1] / vel0; - vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i) = - rhod1 * vel(2 + n * 3) * hx[2] / vel0; + for (int d = 0; d < nvel; d++) { + vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = + rhod1 * vel(VI(n, d)) * hx[d]; + } } else { vmesh(b, dust::cons::density(n), k, j, i) = 0.0; - vmesh(b, dust::cons::momentum(VI(n, 0)), k, j, i) = 0.0; - vmesh(b, dust::cons::momentum(VI(n, 1)), k, j, i) = 0.0; - vmesh(b, dust::cons::momentum(VI(n, 2)), k, j, i) = 0.0; + for (int d = 0; d < nvel; d++) { + vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = 0.0; + } } }); -#ifdef COAG_DEBUG - parthenon::par_for_inner( - DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { - // for (int n = 0; n < nspecies; n++) { - floor_tmp(i - ib.s, n, 0) = source(n); - floor_tmp(i - ib.s, n, 1) = vmesh(b, dust::cons::density(n), k, j, i); - }); -#endif }); - Real sumd0 = 0.0; - Kokkos::parallel_reduce( - "coag::nCallsMaximum", - Kokkos::MDRangePolicy>({kb.s, jb.s, ib.s}, - {kb.e + 1, jb.e + 1, ib.e + 1}), - KOKKOS_LAMBDA(const int k, const int j, const int i, Real &lsum, int &lmax1, - int &lmax2) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - const Real vol00 = coords.Volume(); - for (int n = 0; n < nspecies; ++n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - lsum += dens_d * vol00; - } - lmax1 = std::max(lmax1, nCalls(k, j, i)); - for (int n = nspecies - 1; n >= 0; --n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - if (dens_d > dfloor) { - lmax2 = std::max(lmax2, n); - break; + if (info_out_flag) { + Real sumd0 = 0.0; + int maxCalls1 = 1, maxSize1 = 1; + Kokkos::parallel_reduce( + "coag::nCallsMaximum", + Kokkos::MDRangePolicy>({kb.s, jb.s, ib.s}, + {kb.e + 1, jb.e + 1, ib.e + 1}), + KOKKOS_LAMBDA(const int k, const int j, const int i, Real &lsum, int &lmax1, + int &lmax2) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const Real vol00 = coords.Volume(); + for (int n = 0; n < nspecies; ++n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + lsum += dens_d * vol00; } - } - }, - Kokkos::Sum(sumd0), Kokkos::Max(maxCalls), Kokkos::Max(maxSize)); - sumd1 += sumd0; - } // loop of blocks - -#ifdef COAG_DEBUG - auto floor_h = - Kokkos::create_mirror_view_and_copy(parthenon::HostMemSpace(), floor_tmp); - for (int i = 0; i <= 0; i++) { - std::cout << "i=" << i << " "; - for (int n = 0; n < 20; n++) { - std::cout << floor_h(i, n, 0) << " "; - } - std::cout << std::endl; - - std::cout << "i=" << i << " "; - for (int n = 0; n < 20; n++) { - std::cout << floor_h(i, n, 1) << " "; - } - std::cout << std::endl; - } -#endif - + lmax1 = std::max(lmax1, nCalls(k, j, i)); + for (int n = nspecies - 1; n >= 0; --n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + if (dens_d > dfloor) { + lmax2 = std::max(lmax2, n); + break; + } + } + }, + Kokkos::Sum(sumd0), Kokkos::Max(maxCalls1), + Kokkos::Max(maxSize1)); + massd += sumd0; + maxCalls = std::max(maxCalls, maxCalls1); + maxSize = std::max(maxSize, maxSize1); + } // end if (info_out_flag) + } // loop of blocks + + if (info_out_flag) { #ifdef MPI_PARALLEL - // over all processors - MPI_Reduce(MPI_IN_PLACE, &maxCalls, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); - MPI_Reduce(MPI_IN_PLACE, &maxSize, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); - MPI_Reduce(MPI_IN_PLACE, &sumd1, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); + // over all processors + MPI_Reduce(MPI_IN_PLACE, &maxCalls, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); + MPI_Reduce(MPI_IN_PLACE, &maxSize, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); + MPI_Reduce(MPI_IN_PLACE, &massd, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); #endif // MPI_PARALLEL - if (parthenon::Globals::my_rank == 0) { - std::cout << "maxcalls,size= " << time << " " << maxCalls << " " << maxSize << " " - << maxSize0 << " " << time0 * dt << std::endl - << "total massd =" << time << " " << massd << " " << sumd1 << std::endl; - } + if (parthenon::Globals::my_rank == 0) { + std::string fname; + // fname.assign(pin->GetString("parthenon/job", "problem_id")); + fname = "artemis"; + fname.append("_coag_info.dat"); + static FILE *pfile = NULL; + + // The file exists -- reopen the file in append mode + if (pfile == NULL) { + if ((pfile = std::fopen(fname.c_str(), "r")) != nullptr) { + if ((pfile = std::freopen(fname.c_str(), "a", pfile)) == nullptr) { + PARTHENON_FAIL("Error output file could not be opened"); + } + // The file does not exist -- open the file in write mode and add headers + } else { + if ((pfile = std::fopen(fname.c_str(), "w")) == nullptr) { + PARTHENON_FAIL("Error output file could not be opened"); + } + std::string label = "# time dt maxCall end_maxSize beg_massSize "; + label.append("end_total_massd beg_total_massd diff_massd \n"); + std::fprintf(pfile, label.c_str()); + } + } + std::fprintf(pfile, " %e ", time); + std::fprintf(pfile, " %e ", dt); + std::fprintf(pfile, " %d %d %d ", maxCalls, maxSize, maxSize0); + std::fprintf(pfile, " %e %e %e", massd, massd0, (massd - massd0) / massd); + std::fprintf(pfile, "\n"); + } + } // end if (info_out_flag) return TaskStatus::complete; } @@ -703,7 +594,7 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt //! \fn TaskCollection Dust::OperatorSplitDust //! \brief dust operator split task collection template -TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt) { +TaskCollection OperatorSplitDustSelect(Mesh *pm, parthenon::SimTime &tm) { TaskCollection tc; auto &coag_pkg = pm->packages.Get("coagulation"); auto *dtCoag = coag_pkg->MutableParam("dtCoag"); @@ -712,12 +603,12 @@ TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt *dtCoag = 0.0; } - *dtCoag += dt; + *dtCoag += tm.dt; if ((tm.ncycle + 1) % nstep1Coag != 0) { return tc; } - const Real time_local = tm.time + dt - (*dtCoag); + const Real time_local = tm.time + tm.dt - (*dtCoag); const Real dt_local = (*dtCoag); if (parthenon::Globals::my_rank == 0) { std::cout << "coagulation at: time,dt,cycle=" << time_local << " " << dt_local << " " @@ -736,6 +627,7 @@ TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt } auto &dust_subset = pm->mesh_data.AddShallow("dust_subset", pm->mesh_data.Get(), dust_var_names); + using namespace ::parthenon::Update; const int num_partitions = pm->DefaultNumPartitions(); TaskRegion &tr = tc.AddRegion(num_partitions); @@ -761,6 +653,31 @@ TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt return tc; } +//---------------------------------------------------------------------------------------- +//! \fn TaskStatus Dust::OperatorSplit +// \brief Wrapper function for Dust::OperatorSplitDust +TaskListStatus OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm) { + auto &dust_pkg = pm->packages.Get("dust"); + typedef Coordinates C; + const C coords = dust_pkg->template Param("coords"); + + if (coords == C::cartesian) { + return OperatorSplitDustSelect(pm, tm).Execute(); + } else if (coords == C::spherical1D) { + return OperatorSplitDustSelect(pm, tm).Execute(); + } else if (coords == C::spherical2D) { + return OperatorSplitDustSelect(pm, tm).Execute(); + } else if (coords == C::spherical3D) { + return OperatorSplitDustSelect(pm, tm).Execute(); + } else if (coords == C::cylindrical) { + return OperatorSplitDustSelect(pm, tm).Execute(); + } else if (coords == C::axisymmetric) { + return OperatorSplitDustSelect(pm, tm).Execute(); + } else { + PARTHENON_FAIL("Invalid artemis/coordinate system!"); + } +} + //---------------------------------------------------------------------------------------- //! \fn void Dust::ReduceD2gMaximum // \brief calculate dust-to-gas ratio maximum @@ -849,13 +766,6 @@ template Real EstimateTimestepMesh(MeshData *md) template Real EstimateTimestepMesh(MeshData *md); template Real EstimateTimestepMesh(MeshData *md); -template TaskStatus UpdateDustStoppingTime(MeshData *md); -template TaskStatus UpdateDustStoppingTime(MeshData *md); -template TaskStatus UpdateDustStoppingTime(MeshData *md); -template TaskStatus UpdateDustStoppingTime(MeshData *md); -template TaskStatus UpdateDustStoppingTime(MeshData *md); -template TaskStatus UpdateDustStoppingTime(MeshData *md); - template TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt); @@ -875,23 +785,4 @@ template TaskStatus CoagulationOneStep(MeshData const Real time, const Real dt); -template TaskCollection OperatorSplitDust(Mesh *pm, - parthenon::SimTime &tm, - const Real dt); -template TaskCollection -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, - const Real dt); -template TaskCollection -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, - const Real dt); -template TaskCollection -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, - const Real dt); -template TaskCollection -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, - const Real dt); -template TaskCollection -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, - const Real dt); - } // namespace Dust diff --git a/src/dust/dust.hpp b/src/dust/dust.hpp index 50dbb069..be355d0a 100644 --- a/src/dust/dust.hpp +++ b/src/dust/dust.hpp @@ -33,59 +33,8 @@ TaskStatus FluxSource(MeshData *md, const Real dt); void AddHistory(Coordinates coords, Params ¶ms); -struct CGSUnit { - Real mass0 = 1.0; - Real time0 = 1.0; - Real length0 = 1.0; - Real vol0 = 1.0; - bool isurface_den = true; - bool Code2PhysicalUnit_Set = false; - - bool isSet() const { return Code2PhysicalUnit_Set; } - - void SetCGSUnit(const Real &mass0_in, const Real &length0_in, const Real &time0_in, - const int isurf) { - if (!Code2PhysicalUnit_Set) { - mass0 = mass0_in; - length0 = length0_in; - vol0 = SQR(length0_in); - if (isurf == 0) vol0 *= length0_in; // 3D volume - time0 = time0_in; - Code2PhysicalUnit_Set = true; - } - } - - void SetCGSUnit(ParameterInput *pin) { - if (!Code2PhysicalUnit_Set) { - const Real M_SUN = 1.988409870698051e33; // gram (sun) - const Real AU_LENGTH = 1.4959787070000e13; // cm - const Real GRAV_CONST = - 6.674299999999999e-8; // gravitational const in cm^3 g^-1 s^-2 - - Real mstar = pin->GetOrAddReal("problem", "mstar", 1.0) * M_SUN; - length0 = pin->GetOrAddReal("problem", "r0_length", 1.0) * AU_LENGTH; - const Real omega0 = std::sqrt(GRAV_CONST * mstar / pow(length0, 3)); - time0 = 1. / omega0; - - const Real rho0 = pin->GetReal("problem", "rho0"); - mass0 = rho0 * mstar; - - isurface_den = pin->GetOrAddBoolean("dust", "surface_density_flag", true); - vol0 = SQR(length0); - if (isurface_den == 0) vol0 *= length0; // 3D volume - Code2PhysicalUnit_Set = true; - } - } -}; - -extern CGSUnit *cgsunit; - -template -TaskStatus UpdateDustStoppingTime(MeshData *md); - // OperatorSplit tasks -template -TaskCollection OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm, const Real dt); +TaskListStatus OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); template TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt); diff --git a/src/pgen/dust_coagulation.hpp b/src/pgen/dust_coagulation.hpp index a8daa71a..9e2daae3 100644 --- a/src/pgen/dust_coagulation.hpp +++ b/src/pgen/dust_coagulation.hpp @@ -53,18 +53,57 @@ struct DustCoagulationVariable { Real gamma, gm1; Real iso_cs; Real d2g; - int nstep1Coag; - Real rho_g0; - Real mass0; - Real time0; - Real length0; - Real vol0; }; } // end anonymous namespace namespace dust_coagulation { +struct CGSUnit { + Real mass0 = 1.0; + Real time0 = 1.0; + Real length0 = 1.0; + Real vol0 = 1.0; + bool isurface_den = true; + bool Code2PhysicalUnit_Set = false; + + bool isSet() const { return Code2PhysicalUnit_Set; } + + void SetCGSUnit(const Real &mass0_in, const Real &length0_in, const Real &time0_in, + const int isurf) { + if (!Code2PhysicalUnit_Set) { + mass0 = mass0_in; + length0 = length0_in; + vol0 = SQR(length0_in); + if (isurf == 0) vol0 *= length0_in; // 3D volume + time0 = time0_in; + Code2PhysicalUnit_Set = true; + } + } + + void SetCGSUnit(ParameterInput *pin) { + if (!Code2PhysicalUnit_Set) { + const Real M_SUN = 1.988409870698051e33; // gram (sun) + const Real AU_LENGTH = 1.4959787070000e13; // cm + const Real GRAV_CONST = + 6.674299999999999e-8; // gravitational const in cm^3 g^-1 s^-2 + + Real mstar = pin->GetOrAddReal("problem", "mstar", 1.0) * M_SUN; + length0 = pin->GetOrAddReal("problem", "r0_length", 1.0) * AU_LENGTH; + const Real omega0 = std::sqrt(GRAV_CONST * mstar / (length0 * length0 * length0)); + time0 = 1. / omega0; + + const Real rho0 = pin->GetReal("problem", "rho0"); + mass0 = rho0 * mstar; + + isurface_den = pin->GetOrAddBoolean("dust", "surface_density_flag", true); + vol0 = SQR(length0); + if (isurface_den == 0) vol0 *= length0; // 3D volume + Code2PhysicalUnit_Set = true; + } + } +}; + DustCoagulationVariable dcv; //---------------------------------------------------------------------------------------- @@ -83,72 +122,69 @@ inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { auto &dust_pkg = pmb->packages.Get("dust"); - const bool enable_coagulation = dust_pkg->Param("enable_coagulation"); - // PARTHENON_REQUIRE(enable_coagulation, - // "dust_coagulation pgen requires enable_coagulation=true!"); + const bool do_coagulation = artemis_pkg->Param("do_coagulation"); + PARTHENON_REQUIRE(do_coagulation, + "dust_coagulation pgen requires physics coagulation=true!"); // read global parameters dcv.nDust = pin->GetOrAddReal("dust", "nspecies", 121); dcv.nInit_dust = pin->GetOrAddReal("problem", "nInit_dust", 1); dcv.d2g = pin->GetOrAddReal("problem", "dust_to_gas", 0.01); - dcv.nstep1Coag = pin->GetOrAddReal("problem", "nstep1Coag", 50); - - if (Dust::cgsunit == NULL) { - Dust::cgsunit = new Dust::CGSUnit(); - } - if (!Dust::cgsunit->isSet()) { - Dust::cgsunit->SetCGSUnit(pin); - } - - dcv.length0 = Dust::cgsunit->length0; - dcv.mass0 = Dust::cgsunit->mass0; - dcv.time0 = Dust::cgsunit->time0; - - Real den_code2phy = 1.0; - dcv.vol0 = Dust::cgsunit->vol0; - - den_code2phy = dcv.mass0 / dcv.vol0; - - dcv.rho_g0 = den_code2phy; // using MRN distribution for the initial dust setup ParArray1D dust_size = dust_pkg->template Param>("sizes"); - auto s_p_prefh = Kokkos::create_mirror(dust_size); - Kokkos::deep_copy(s_p_prefh, dust_size); + // convert input "AU" and "mstar" to CGS unit + CGSUnit *cgsunit = new CGSUnit(); + cgsunit->SetCGSUnit(pin); + const Real den0 = cgsunit->mass0 / cgsunit->vol0; // density + const Real time0 = cgsunit->time0; + const Real vel0 = cgsunit->length0 / cgsunit->time0; - Real sum1 = 0.0; - for (int i = 0; i < dcv.nInit_dust; i++) { - sum1 += std::sqrt(s_p_prefh(i)); + const Real tlim_in = pin->GetReal("parthenon/time", "tlim"); + pin->SetReal("parthenon/time", "tlim", tlim_in * time0); + + if (pin->DoesBlockExist("parthenon/output0")) { + const Real dt = pin->GetReal("parthenon/output0", "dt"); + pin->SetReal("parthenon/output0", "dt", dt * time0); } - for (int i = 0; i < dcv.nInit_dust; i++) { - s_p_prefh(i) = std::sqrt(s_p_prefh(i)) / sum1; + if (pin->DoesBlockExist("parthenon/output1")) { + const Real dt = pin->GetReal("parthenon/output1", "dt"); + pin->SetReal("parthenon/output1", "dt", dt * time0); } - for (int i = dcv.nInit_dust; i < dcv.nDust; i++) { - s_p_prefh(i) = 0.0; + if (pin->DoesBlockExist("parthenon/output2")) { + const Real dt = pin->GetReal("parthenon/output2", "dt"); + pin->SetReal("parthenon/output2", "dt", dt * time0); } - ParArray1D s_p_pref("init dust", dcv.nDust); - Kokkos::deep_copy(s_p_pref, s_p_prefh); + const Real x1max = pin->GetReal("parthenon/mesh", "x1max"); + if (x1max < 1e10) { + std::stringstream msg; + msg << " reset x1min and x1max using cgs unit = " << cgsunit->length0 << std::endl; + PARTHENON_FAIL(msg); + } auto gas_pkg = pmb->packages.Get("gas"); auto eos_d = gas_pkg->template Param("eos_d"); dcv.gamma = gas_pkg->Param("adiabatic_index"); dcv.gm1 = dcv.gamma - 1.0; dcv.iso_cs = pin->GetOrAddReal("gas", "iso_sound_speed", 1e-1); + dcv.iso_cs *= vel0; - const Real gdens = 1.0; + const Real gdens = 1.0 * den0; const Real gtemp = SQR(dcv.iso_cs); - const Real vx_g = 0.0; const Real gsie = eos_d.InternalEnergyFromDensityTemperature(gdens, gtemp); - std::cout << "gamma,cs,pre=" << dcv.gamma << " " << dcv.iso_cs << " " << gsie * dcv.gm1 - << std::endl; + if (pmb->gid == 0) { + std::cout << "gamma,cs,temp=" << dcv.gamma << " " << dcv.iso_cs << " " + << gsie * dcv.gm1 << ", time0,length0,mass0,den0,vel0=" << time0 << " " + << cgsunit->length0 << " " << cgsunit->mass0 << " " << den0 << " " << vel0 + << std::endl; + } - const Real vx_d = 0.0; - const Real vy_d = 0.0; - const Real vz_d = 0.0; + const Real vx_g = 0.0 * vel0; + const Real vx_d = 0.0 * vel0; // packing and capture variables for kernel auto &md = pmb->meshblock_data.Get(); @@ -165,6 +201,11 @@ inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { IndexRange kb = pmb->cellbounds.GetBoundsK(IndexDomain::entire); auto &dcoag = dcv; + Real sum1 = 0.0; + pmb->par_reduce( + "pgen_partialSum", 0, dcoag.nInit_dust - 1, + KOKKOS_LAMBDA(const int n, Real &lsum) { lsum += std::sqrt(dust_size(n)); }, sum1); + pmb->par_for( "pgen_dustCoagulation", kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, KOKKOS_LAMBDA(const int k, const int j, const int i) { @@ -174,12 +215,18 @@ inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { v(0, gas::prim::velocity(2), k, j, i) = 0.0; v(0, gas::prim::sie(0), k, j, i) = gsie; - // dust initial condition - for (int n = 0; n < dcoag.nDust; ++n) { - v(0, dust::prim::density(n), k, j, i) = dcoag.d2g * gdens * s_p_pref(n); + for (int n = 0; n < dcoag.nInit_dust; ++n) { + const Real sratio = std::sqrt(dust_size(n)) / sum1; + v(0, dust::prim::density(n), k, j, i) = dcoag.d2g * gdens * sratio; + v(0, dust::prim::velocity(n * 3 + 0), k, j, i) = vx_d; + v(0, dust::prim::velocity(n * 3 + 1), k, j, i) = 0.0; + v(0, dust::prim::velocity(n * 3 + 2), k, j, i) = 0.0; + } + for (int n = dcoag.nInit_dust; n < dcoag.nDust; ++n) { + v(0, dust::prim::density(n), k, j, i) = 0.0; v(0, dust::prim::velocity(n * 3 + 0), k, j, i) = vx_d; - v(0, dust::prim::velocity(n * 3 + 1), k, j, i) = vy_d; - v(0, dust::prim::velocity(n * 3 + 2), k, j, i) = vz_d; + v(0, dust::prim::velocity(n * 3 + 1), k, j, i) = 0.0; + v(0, dust::prim::velocity(n * 3 + 2), k, j, i) = 0.0; } }); } diff --git a/src/pgen/dust_collision.hpp b/src/pgen/dust_collision.hpp index 6ae9832a..b7983c09 100644 --- a/src/pgen/dust_collision.hpp +++ b/src/pgen/dust_collision.hpp @@ -15,7 +15,7 @@ // Licensed under the 3-clause BSD License (the "LICENSE") //======================================================================================== -// NOTE(@pdmullen): The following is taken directly from the open-source +// NOTE(@Shengtai): The following is taken directly from the open-source // Athena++-dustfluid software, and adapted for Parthenon/Artemis by @Shengtai on 4/12/24 //! \file dust_collision.cpp From 347ea013e7d4916a2c4bb29f440d433c103fcaf8 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Wed, 11 Dec 2024 14:30:03 -0700 Subject: [PATCH 07/38] merge with the head version and modify c2p to p2c in dust.cpp --- external/parthenon | 2 +- src/dust/dust.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/external/parthenon b/external/parthenon index 75ec2e2e..b5594528 160000 --- a/external/parthenon +++ b/external/parthenon @@ -1 +1 @@ -Subproject commit 75ec2e2e1951b1d35022f33105eaa7dedf112c69 +Subproject commit b5594528e31cbcb3bd5d2aaa0f944d36d10b2c8f diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index b01494b5..15e4121c 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -645,8 +645,8 @@ TaskCollection OperatorSplitDustSelect(Mesh *pm, parthenon::SimTime &tm) { auto &md_coag = pm->mesh_data.GetOrAdd("dust_subset", i); auto bcs = parthenon::AddBoundaryExchangeTasks(pre_comm, tl, md_coag, pm->multilevel); - // Update primitive variables - auto c2p = tl.AddTask(bcs, FillDerived>, base.get()); + // Sync fields + auto p2c = tl.AddTask(bcs, FillDerived>, base.get()); } *dtCoag = 0.0; From 053f77bca1824f8129aaf76605742fa6d6ae42d4 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Fri, 3 Jan 2025 14:50:51 -0700 Subject: [PATCH 08/38] new modification based on units --- inputs/dust/dust_coagulation.in | 18 +- inputs/dust/dust_coagulation_den.in | 18 +- inputs/dust/dust_collision.in | 91 ---------- src/artemis_driver.cpp | 2 +- src/dust/coagulation/coagulation.cpp | 22 +-- src/dust/coagulation/coagulation.hpp | 8 +- src/dust/dust.cpp | 87 +++++----- src/dust/dust.hpp | 1 + src/pgen/dust_coagulation.hpp | 89 +--------- src/pgen/dust_collision.hpp | 239 --------------------------- src/pgen/pgen.hpp | 3 - src/pgen/problem_modifier.hpp | 2 - src/utils/units.cpp | 8 +- 13 files changed, 93 insertions(+), 495 deletions(-) delete mode 100644 inputs/dust/dust_collision.in delete mode 100644 src/pgen/dust_collision.hpp diff --git a/inputs/dust/dust_coagulation.in b/inputs/dust/dust_coagulation.in index 0af7e0fa..4ebd23ac 100644 --- a/inputs/dust/dust_coagulation.in +++ b/inputs/dust/dust_coagulation.in @@ -13,7 +13,12 @@ problem = dust_coagulation # name of the pgen -coordinates = cartesian # coordinate system +coordinates = cartesian # coordinate system +unit_conversion = ppd # ppd (code unit: AU, Msun, year/(2*pi) +r0_length = 10. # AU +mstar = 1.0 # M_sun +rho0 = 2e-5 +physical_units = cgs # problem_id = coag # problem ID: basename of output filenames @@ -45,8 +50,8 @@ refinement = none # numlevel = 1 nx1 = 16 # Number of zones in X1-direction -x1min = 1.35e15 # minimum value of X1 -x1max = 1.64e15 # maximum value of X1 +x1min = 9.0 # minimum value of X1 +x1max = 11.0 # maximum value of X1 ix1_bc = outflow # Inner-X1 boundary condition flag ox1_bc = outflow # Outer-X1 boundary condition flag @@ -76,6 +81,7 @@ coagulation = true cfl = 0.9 gamma = 1.00001 iso_sound_speed = 0.05 # code unit +cv = 1e5 # 1/(gamma-1) cfl = 0.9 @@ -99,9 +105,7 @@ coag_info_out = true nInit_dust = 11 # number of dust species initially dust_to_gas = 0.01 -nstep1Coag = 10 -mstar = 1.0 # central star masss (m_sun) -r0_length = 10.0 # 1 code unit (AU) -rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 +nstep1Coag = 1 +#rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 const_coag_omega = true # using omega at r0_length diff --git a/inputs/dust/dust_coagulation_den.in b/inputs/dust/dust_coagulation_den.in index 97de1305..c1bb60a3 100644 --- a/inputs/dust/dust_coagulation_den.in +++ b/inputs/dust/dust_coagulation_den.in @@ -13,7 +13,12 @@ problem = dust_coagulation # name of the pgen -coordinates = cartesian # coordinate system +coordinates = cartesian # coordinate system +unit_conversion = ppd # ppd (code unit: AU, Msun, year/(2*pi) +r0_length = 10. # AU +mstar = 1.0 # M_sun +rho0 = 1.59577e-4 # 3D rho (mstar/r0^3) +physical_units = cgs # problem_id = coag # problem ID: basename of output filenames @@ -34,7 +39,7 @@ file_type = rst dt = 628 -nlim = 5 # cycle limit +nlim = -1 # cycle limit tlim = 6280. # time limit integrator = rk2 # time integration algorithm ncycle_out = 1 # interval for stdout summary info @@ -45,8 +50,8 @@ refinement = none # numlevel = 1 nx1 = 16 # Number of zones in X1-direction -x1min = 1.35e15 # minimum value of X1 -x1max = 1.64e15 # maximum value of X1 +x1min = 9.0 # minimum value of X1 +x1max = 11.0 # maximum value of X1 ix1_bc = outflow # Inner-X1 boundary condition flag ox1_bc = outflow # Outer-X1 boundary condition flag @@ -76,6 +81,7 @@ coagulation = true cfl = 0.9 gamma = 1.00001 iso_sound_speed = 0.05 # code unit +cv = 1e5 # 1/(gamma-1) cfl = 0.9 @@ -100,8 +106,6 @@ coag_info_out = true nInit_dust = 11 # number of dust species initially dust_to_gas = 0.01 nstep1Coag = 1 -mstar = 1.0 # central star masss (m_sun) -r0_length = 10.0 # 1 code unit (AU) -rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 +#rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 const_coag_omega = true # using omega at r0_length diff --git a/inputs/dust/dust_collision.in b/inputs/dust/dust_collision.in deleted file mode 100644 index 482c46e2..00000000 --- a/inputs/dust/dust_collision.in +++ /dev/null @@ -1,91 +0,0 @@ -# ======================================================================================== -# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. -# -# This program was produced under U.S. Government contract 89233218CNA000001 for Los -# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC -# for the U.S. Department of Energy/National Nuclear Security Administration. All rights -# in the program are reserved by Triad National Security, LLC, and the U.S. Department -# of Energy/National Nuclear Security Administration. The Government is granted for -# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide -# license in this material to reproduce, prepare derivative works, distribute copies to -# the public, perform publicly and display publicly, and to permit others to do so. -# ======================================================================================== - - -problem = dust_collision # name of the pgen -coordinates = cartesian # coordinate system - - -problem_id = dc_B # problem ID: basename of output filenames - - -variables = gas.prim.density, & - gas.prim.velocity, & - gas.prim.pressure, & - dust.prim.density, & - dust.prim.velocity -file_type = hdf5 # tab data dump -dt = 0.05 # time increment between outputs - - -nlim = -1 # cycle limit -tlim = 0.05 # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 1 # interval for stdout summary info -dt_user = 0.005 - - -nghost = 2 -refinement = none -# numlevel = 1 - -nx1 = 16 # Number of zones in X1-direction -x1min = 0.0 # minimum value of X1 -x1max = 1.0 # maximum value of X1 -ix1_bc = periodic # Inner-X1 boundary condition flag -ox1_bc = periodic # Outer-X1 boundary condition flag - -nx2 = 1 # Number of zones in X2-direction -x2min = -0.5 # minimum value of X2 -x2max = 0.5 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag - - -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir - - -gas = true -dust = true -drag = true - - -cfl = 0.9 -gamma = 1.4 -iso_sound_speed = 0.1 - - -cfl = 0.9 -nspecies = 2 - -sizes = 1.0, 1.0 - - -type = constant -tau = 0.01, 0.001 # for iprob = 1 -#tau = 2.0, 1.0 # for iprob = 2 - - -type = simple_dust - - - -iprob = 1 # 1 or 2 diff --git a/src/artemis_driver.cpp b/src/artemis_driver.cpp index 222d329e..5860b5eb 100644 --- a/src/artemis_driver.cpp +++ b/src/artemis_driver.cpp @@ -112,7 +112,7 @@ TaskListStatus ArtemisDriver::Step() { if (do_radiation) status = IMC::JaybenneIMC(pmesh, tm.time, tm.dt); if (status != TaskListStatus::complete) return status; - if (do_coagulation) status = Dust::OperatorSplitDust(pmesh, tm); + if (do_coagulation) status = Dust::OperatorSplitDust(pmesh, tm); if (status != TaskListStatus::complete) return status; // Compute new dt, (de)refine, and handle sparse (if enabled) diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index 4829e0b9..a8d899b1 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -16,16 +16,22 @@ #include "artemis.hpp" #include "dust/dust.hpp" #include "geometry/geometry.hpp" +#include "utils/units.hpp" namespace Dust { namespace Coagulation { //---------------------------------------------------------------------------------------- //! \fn StateDescriptor Coagulalation::Initialize //! \brief Adds intialization function for coagulation package -std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars) { +std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars, + ArtemisUtils::Units &units, + ArtemisUtils::Constants &constants) { auto coag = std::make_shared("coagulation"); Params ¶ms = coag->AllParams(); + PARTHENON_REQUIRE(units.GetPhysicalUnits() == ArtemisUtils::PhysicalUnits::cgs, + "coagulation physics requires physical_units = cgs"); + CoagParams cpars; const int nm = dustPars.template Get("nspecies"); @@ -41,17 +47,8 @@ std::shared_ptr Initialize(ParameterInput *pin, Params &dustPar cpars.nCall_mx = pin->GetOrAddInteger("dust/coagulation", "coag_nsteps_mx", 1000); cpars.rho_p = rho_p; - const Real M_SUN = 1.988409870698051e33; // gram (sun) - const Real GRAV_CONST = 6.674299999999999e-8; // gravitational const in cm^3 g^-1 s^-2 - const Real mstar = pin->GetOrAddReal("problem", "mstar", 1.0) * M_SUN; - cpars.gm = std::sqrt(GRAV_CONST * mstar); const bool const_omega = pin->GetOrAddBoolean("problem", "const_coag_omega", false); cpars.const_omega = const_omega; - if (const_omega) { - const Real AU_LENGTH = 1.4959787070000e13; // cm - const Real r0 = pin->GetOrAddReal("problem", "r0_length", 1.0) * AU_LENGTH; - cpars.gm /= (std::sqrt(r0) * r0); - } cpars.ibounce = pin->GetOrAddBoolean("dust/coagulation", "coag_bounce", false); @@ -61,6 +58,9 @@ std::shared_ptr Initialize(ParameterInput *pin, Params &dustPar if (isurface_den) coord_type = 1; cpars.coord = coord_type; // 1--surface density, 0: 3D + cpars.rho0 = units.GetMassDensityCodeToPhysical(); + if (isurface_den) cpars.rho0 *= units.GetLengthCodeToPhysical(); + cpars.err_eps = 1.0e-1; cpars.S = 0.9; cpars.cfl = 1.0e-1; @@ -104,7 +104,7 @@ std::shared_ptr Initialize(ParameterInput *pin, Params &dustPar cpars.cpod_notzero = ParArray3D("idx_nzcpod", nm, nm, 4); cpars.cpod_short = ParArray3D("nzcpod", nm, nm, 4); - cpars.dfloor = dfloor; + cpars.dfloor = dfloor * cpars.rho0; Real a = 3.0 * std::log10(h_sizes(0) / h_sizes(nm - 1)) / static_cast(1 - nm); initializeArray(nm, cpars.pGrid, cpars.rho_p, cpars.chi, a, dust_size, cpars.klf, diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index 5e5a8358..659d44b1 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -14,6 +14,7 @@ #define DUST_COAGULATION_HPP_ #include "utils/artemis_utils.hpp" +#include "utils/units.hpp" //#define COAGULATION_DEBUG namespace Dust { @@ -21,7 +22,9 @@ namespace Coagulation { enum coag2DRv { dpod, aFrag, phiFrag, epsFrag, dalp, kdelta, coef_fett, last2 }; -std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars); +std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars, + ArtemisUtils::Units &units, + ArtemisUtils::Constants &constants); struct CoagParams { int coord = 0; // 1--surface density, 0: 3D @@ -45,9 +48,10 @@ struct CoagParams { Real S; // Safety margin for adaptive step sizing Real cfl; Real errcon; // Needed for increasing step size - Real gm; // sqrt(grav_const * mstar); bool const_omega; // for shearing-box or testing + Real rho0; // physical-to-code unit conversion + // pre-calculated array, once-for-all ParArray2D klf; ParArray1D mass_grid; diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index 15e4121c..d6785c06 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -347,6 +347,7 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt using parthenon::MakePackDescriptor; auto pm = md->GetParentPointer(); + auto &artemis_pkg = pm->packages.Get("artemis"); auto &dust_pkg = pm->packages.Get("dust"); IndexRange ib = md->GetBoundsI(IndexDomain::interior); IndexRange jb = md->GetBoundsJ(IndexDomain::interior); @@ -374,6 +375,13 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt if (coag.coord) nvel = 2; // surface-density auto &dfloor = dust_pkg->template Param("dfloor"); + // unit: coagulation using cgs physical unit + auto &units = artemis_pkg->template Param("units"); + const Real time0 = units.GetTimeCodeToPhysical(); + const Real length0 = units.GetLengthCodeToPhysical(); + const Real rho0 = coag.rho0; + const Real vel0 = length0 / time0; + const int scr_level = coag_pkg->template Param("coag_scr_level"); auto info_out_flag = coag_pkg->template Param("coag_info_out"); @@ -434,25 +442,26 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt vmesh.GetLowerBound(b, dust::prim::density()) + 1); const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); - Real dt_sync = dt; - const Real time1 = time; + Real dt_sync = dt * time0; geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); const auto &hx = coords.GetScaleFactors(); const auto &xv = coords.GetCellCenter(); const auto &xcyl = coords.ConvertToCyl(xv); - const Real rad = xcyl[0]; // cylindrical - const Real Omega_k = - coag.const_omega ? coag.gm : coag.gm / std::sqrt(rad) / rad; // code unit + const Real rad = coag.const_omega ? 1.0 : xcyl[0]; // cylindrical + + const Real Omega_k = 1.0 / std::sqrt(rad) / rad; int nCall1 = 0; const Real sie = vmesh(b, gas::prim::sie(0), k, j, i); const Real bulk = eos_d.BulkModulusFromDensityInternalEnergy(dens_g, sie); - const Real cs = std::sqrt(bulk / dens_g); - const Real omega1 = Omega_k; + const Real cs1 = std::sqrt(bulk / dens_g) * vel0; + const Real omega1 = Omega_k / time0; const int nm = nspecies; + const Real time1 = time * time0; + const Real dens_g1 = dens_g * rho0; ScratchPad1D rhod(mbr.team_scratch(scr_level), nspecies); ScratchPad1D stime(mbr.team_scratch(scr_level), nspecies); @@ -468,9 +477,9 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt // calculate the stopping time on the fly Real st0 = 1.0; if (coag.coord) { // surface density - st0 = 0.5 * M_PI * coag.rho_p / dens_g / omega1; + st0 = 0.5 * M_PI * coag.rho_p / dens_g1 / omega1; } else { - st0 = std::sqrt(M_PI / 8.0) * coag.rho_p / dens_g / cs; + st0 = std::sqrt(M_PI / 8.0) * coag.rho_p / dens_g1 / cs1; } parthenon::par_for_inner( @@ -478,9 +487,10 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt // calculate the stopping time on fly stime(n) = st0 * dust_size(n); if (vmesh(b, dust::prim::density(n), k, j, i) > dfloor) { - rhod(n) = vmesh(b, dust::prim::density(n), k, j, i); + rhod(n) = vmesh(b, dust::prim::density(n), k, j, i) * rho0; for (int d = 0; d < nvel; d++) { - vel(VI(n, d)) = vmesh(b, dust::prim::velocity(VI(n, d)), k, j, i); + vel(VI(n, d)) = + vmesh(b, dust::prim::velocity(VI(n, d)), k, j, i) * vel0; } } else { rhod(n) = 0.0; @@ -490,8 +500,8 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt } }); - Coagulation::CoagulationOneCell(mbr, i, time1, dt_sync, dens_g, rhod, stime, - vel, nvel, Q, nQs, alpha, cs, omega1, coag, + Coagulation::CoagulationOneCell(mbr, i, time1, dt_sync, dens_g1, rhod, stime, + vel, nvel, Q, nQs, alpha, cs1, omega1, coag, source, nCall1, Q2); if (info_out_flag) nCalls(k, j, i) = nCall1; @@ -502,10 +512,10 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt // for (int n = 0; n < nspecies; ++n) { if (rhod(n) > 0.0) { const Real rhod1 = rhod(n); - vmesh(b, dust::cons::density(n), k, j, i) = rhod1; + vmesh(b, dust::cons::density(n), k, j, i) = rhod1 / rho0; for (int d = 0; d < nvel; d++) { vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = - rhod1 * vel(VI(n, d)) * hx[d]; + rhod1 * vel(VI(n, d)) * hx[d] / vel0; } } else { vmesh(b, dust::cons::density(n), k, j, i) = 0.0; @@ -592,10 +602,9 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt //---------------------------------------------------------------------------------------- //! \fn TaskCollection Dust::OperatorSplitDust -//! \brief dust operator split task collection +//! \brief dust wrapper function for operatorsplitDust template -TaskCollection OperatorSplitDustSelect(Mesh *pm, parthenon::SimTime &tm) { - TaskCollection tc; +TaskListStatus OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm) { auto &coag_pkg = pm->packages.Get("coagulation"); auto *dtCoag = coag_pkg->MutableParam("dtCoag"); int nstep1Coag = coag_pkg->template Param("nstep1Coag"); @@ -605,7 +614,7 @@ TaskCollection OperatorSplitDustSelect(Mesh *pm, parthenon::SimTime &tm) { *dtCoag += tm.dt; if ((tm.ncycle + 1) % nstep1Coag != 0) { - return tc; + return TaskListStatus::complete; } const Real time_local = tm.time + tm.dt - (*dtCoag); @@ -615,6 +624,7 @@ TaskCollection OperatorSplitDustSelect(Mesh *pm, parthenon::SimTime &tm) { << tm.ncycle << std::endl; } + TaskCollection tc; TaskID none(0); // Assemble tasks @@ -650,32 +660,7 @@ TaskCollection OperatorSplitDustSelect(Mesh *pm, parthenon::SimTime &tm) { } *dtCoag = 0.0; - return tc; -} - -//---------------------------------------------------------------------------------------- -//! \fn TaskStatus Dust::OperatorSplit -// \brief Wrapper function for Dust::OperatorSplitDust -TaskListStatus OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm) { - auto &dust_pkg = pm->packages.Get("dust"); - typedef Coordinates C; - const C coords = dust_pkg->template Param("coords"); - - if (coords == C::cartesian) { - return OperatorSplitDustSelect(pm, tm).Execute(); - } else if (coords == C::spherical1D) { - return OperatorSplitDustSelect(pm, tm).Execute(); - } else if (coords == C::spherical2D) { - return OperatorSplitDustSelect(pm, tm).Execute(); - } else if (coords == C::spherical3D) { - return OperatorSplitDustSelect(pm, tm).Execute(); - } else if (coords == C::cylindrical) { - return OperatorSplitDustSelect(pm, tm).Execute(); - } else if (coords == C::axisymmetric) { - return OperatorSplitDustSelect(pm, tm).Execute(); - } else { - PARTHENON_FAIL("Invalid artemis/coordinate system!"); - } + return tc.Execute(); } //---------------------------------------------------------------------------------------- @@ -784,5 +769,17 @@ template TaskStatus CoagulationOneStep(MeshData template TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt); +template TaskListStatus OperatorSplitDust(Mesh *pm, + parthenon::SimTime &tm); +template TaskListStatus +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); +template TaskListStatus +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); +template TaskListStatus +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); +template TaskListStatus +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); +template TaskListStatus +OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); } // namespace Dust diff --git a/src/dust/dust.hpp b/src/dust/dust.hpp index be355d0a..1145d11a 100644 --- a/src/dust/dust.hpp +++ b/src/dust/dust.hpp @@ -34,6 +34,7 @@ TaskStatus FluxSource(MeshData *md, const Real dt); void AddHistory(Coordinates coords, Params ¶ms); // OperatorSplit tasks +template TaskListStatus OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); template diff --git a/src/pgen/dust_coagulation.hpp b/src/pgen/dust_coagulation.hpp index 9e2daae3..5c50b072 100644 --- a/src/pgen/dust_coagulation.hpp +++ b/src/pgen/dust_coagulation.hpp @@ -59,51 +59,6 @@ struct DustCoagulationVariable { namespace dust_coagulation { -struct CGSUnit { - Real mass0 = 1.0; - Real time0 = 1.0; - Real length0 = 1.0; - Real vol0 = 1.0; - bool isurface_den = true; - bool Code2PhysicalUnit_Set = false; - - bool isSet() const { return Code2PhysicalUnit_Set; } - - void SetCGSUnit(const Real &mass0_in, const Real &length0_in, const Real &time0_in, - const int isurf) { - if (!Code2PhysicalUnit_Set) { - mass0 = mass0_in; - length0 = length0_in; - vol0 = SQR(length0_in); - if (isurf == 0) vol0 *= length0_in; // 3D volume - time0 = time0_in; - Code2PhysicalUnit_Set = true; - } - } - - void SetCGSUnit(ParameterInput *pin) { - if (!Code2PhysicalUnit_Set) { - const Real M_SUN = 1.988409870698051e33; // gram (sun) - const Real AU_LENGTH = 1.4959787070000e13; // cm - const Real GRAV_CONST = - 6.674299999999999e-8; // gravitational const in cm^3 g^-1 s^-2 - - Real mstar = pin->GetOrAddReal("problem", "mstar", 1.0) * M_SUN; - length0 = pin->GetOrAddReal("problem", "r0_length", 1.0) * AU_LENGTH; - const Real omega0 = std::sqrt(GRAV_CONST * mstar / (length0 * length0 * length0)); - time0 = 1. / omega0; - - const Real rho0 = pin->GetReal("problem", "rho0"); - mass0 = rho0 * mstar; - - isurface_den = pin->GetOrAddBoolean("dust", "surface_density_flag", true); - vol0 = SQR(length0); - if (isurface_den == 0) vol0 *= length0; // 3D volume - Code2PhysicalUnit_Set = true; - } - } -}; - DustCoagulationVariable dcv; //---------------------------------------------------------------------------------------- @@ -134,57 +89,23 @@ inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { // using MRN distribution for the initial dust setup ParArray1D dust_size = dust_pkg->template Param>("sizes"); - // convert input "AU" and "mstar" to CGS unit - CGSUnit *cgsunit = new CGSUnit(); - cgsunit->SetCGSUnit(pin); - const Real den0 = cgsunit->mass0 / cgsunit->vol0; // density - const Real time0 = cgsunit->time0; - const Real vel0 = cgsunit->length0 / cgsunit->time0; - - const Real tlim_in = pin->GetReal("parthenon/time", "tlim"); - pin->SetReal("parthenon/time", "tlim", tlim_in * time0); - - if (pin->DoesBlockExist("parthenon/output0")) { - const Real dt = pin->GetReal("parthenon/output0", "dt"); - pin->SetReal("parthenon/output0", "dt", dt * time0); - } - - if (pin->DoesBlockExist("parthenon/output1")) { - const Real dt = pin->GetReal("parthenon/output1", "dt"); - pin->SetReal("parthenon/output1", "dt", dt * time0); - } - - if (pin->DoesBlockExist("parthenon/output2")) { - const Real dt = pin->GetReal("parthenon/output2", "dt"); - pin->SetReal("parthenon/output2", "dt", dt * time0); - } - - const Real x1max = pin->GetReal("parthenon/mesh", "x1max"); - if (x1max < 1e10) { - std::stringstream msg; - msg << " reset x1min and x1max using cgs unit = " << cgsunit->length0 << std::endl; - PARTHENON_FAIL(msg); - } auto gas_pkg = pmb->packages.Get("gas"); auto eos_d = gas_pkg->template Param("eos_d"); dcv.gamma = gas_pkg->Param("adiabatic_index"); dcv.gm1 = dcv.gamma - 1.0; dcv.iso_cs = pin->GetOrAddReal("gas", "iso_sound_speed", 1e-1); - dcv.iso_cs *= vel0; - const Real gdens = 1.0 * den0; + const Real gdens = 1.0; const Real gtemp = SQR(dcv.iso_cs); const Real gsie = eos_d.InternalEnergyFromDensityTemperature(gdens, gtemp); if (pmb->gid == 0) { - std::cout << "gamma,cs,temp=" << dcv.gamma << " " << dcv.iso_cs << " " - << gsie * dcv.gm1 << ", time0,length0,mass0,den0,vel0=" << time0 << " " - << cgsunit->length0 << " " << cgsunit->mass0 << " " << den0 << " " << vel0 - << std::endl; + std::cout << "gamma,cs,pre=" << dcv.gamma << " " << dcv.iso_cs << " " + << gsie * dcv.gm1 * gdens << std::endl; } - const Real vx_g = 0.0 * vel0; - const Real vx_d = 0.0 * vel0; + const Real vx_g = 0.0; + const Real vx_d = 0.0; // packing and capture variables for kernel auto &md = pmb->meshblock_data.Get(); diff --git a/src/pgen/dust_collision.hpp b/src/pgen/dust_collision.hpp deleted file mode 100644 index b7983c09..00000000 --- a/src/pgen/dust_collision.hpp +++ /dev/null @@ -1,239 +0,0 @@ -//======================================================================================== -// (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved. -// -// This program was produced under U.S. Government contract 89233218CNA000001 for Los -// Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC -// for the U.S. Department of Energy/National Nuclear Security Administration. All rights -// in the program are reserved by Triad National Security, LLC, and the U.S. Department -// of Energy/National Nuclear Security Administration. The Government is granted for -// itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide -// license in this material to reproduce, prepare derivative works, distribute copies to -// the public, perform publicly and display publicly, and to permit others to do so. -//======================================================================================== -// AthenaXXX astrophysical plasma code -// Copyright(C) 2020 James M. Stone and the Athena code team -// Licensed under the 3-clause BSD License (the "LICENSE") -//======================================================================================== - -// NOTE(@Shengtai): The following is taken directly from the open-source -// Athena++-dustfluid software, and adapted for Parthenon/Artemis by @Shengtai on 4/12/24 - -//! \file dust_collision.cpp -//! \brief dust collision problem generator for 1D problems. - -#ifndef PGEN_DUST_COLLISION_HPP_ -#define PGEN_DUST_COLLISION_HPP_ - -// C/C++ headers -#include -#include -#include -#include -#include -#include -#include - -// Artemis headers -#include "artemis.hpp" -#include "geometry/geometry.hpp" -//#include "pgen/pgen.hpp" -#include "utils/artemis_utils.hpp" -#include "utils/eos/eos.hpp" - -using ArtemisUtils::EOS; - -namespace { - -//---------------------------------------------------------------------------------------- -//! \struct DustCollisionVariable -//! \brief container for variables shared with dust collision pgen -struct DustCollisionVariable { - int prob_flag; - int nDust; - Real gamma, gm1; - Real iso_cs; -}; - -} // end anonymous namespace - -namespace dust_collision { - -DustCollisionVariable dcv; - -//---------------------------------------------------------------------------------------- -//! \fn void ProblemGenerator::DustCollision_() -//! \brief Sets initial conditions for dust collision tests -template -inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { - using parthenon::MakePackDescriptor; - - auto artemis_pkg = pmb->packages.Get("artemis"); - const auto geom = artemis_pkg->Param("coords"); - PARTHENON_REQUIRE(geom == Coordinates::cartesian, - "dust_collision pgen requires Cartesian geometry!"); - const bool do_dust = artemis_pkg->Param("do_dust"); - PARTHENON_REQUIRE(do_dust, "dust_collision pgen requires do_dust=true!"); - bool const_stopping_time = pin->GetOrAddBoolean("dust", "const_stopping_time", true); - PARTHENON_REQUIRE(do_dust, "dust_collision pgen requires const_stopping_time=true!"); - - // read global parameters - dcv.prob_flag = pin->GetOrAddInteger("problem", "iprob", 1); - dcv.nDust = pin->GetOrAddReal("dust", "nspecies", 2); - PARTHENON_REQUIRE(dcv.nDust == 2, "dust_collision pgen requires dust nspecies == 2!"); - - auto gas_pkg = pmb->packages.Get("gas"); - auto eos_d = gas_pkg->template Param("eos_d"); - - dcv.gamma = gas_pkg->Param("adiabatic_index"); - dcv.gm1 = dcv.gamma - 1.0; - dcv.iso_cs = pin->GetOrAddReal("gas", "iso_sound_speed", 1e-1); - - const Real gdens = 1.0; - const Real gtemp = SQR(dcv.iso_cs); - const Real vx_g = 1.0; - const Real gsie = eos_d.InternalEnergyFromDensityTemperature(gdens, gtemp); - - // packing and capture variables for kernel - auto &md = pmb->meshblock_data.Get(); - for (auto &var : md->GetVariableVector()) { - if (!var->IsAllocated()) pmb->AllocateSparse(var->label()); - } - static auto desc = - MakePackDescriptor( - (pmb->resolved_packages).get()); - auto v = desc.GetPack(md.get()); - IndexRange ib = pmb->cellbounds.GetBoundsI(IndexDomain::entire); - IndexRange jb = pmb->cellbounds.GetBoundsJ(IndexDomain::entire); - IndexRange kb = pmb->cellbounds.GetBoundsK(IndexDomain::entire); - auto &dcol = dcv; - - pmb->par_for( - "pgen_dustCollision", kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(const int k, const int j, const int i) { - v(0, gas::prim::density(), k, j, i) = gdens; - v(0, gas::prim::velocity(0), k, j, i) = vx_g; - v(0, gas::prim::velocity(1), k, j, i) = 0.0; - v(0, gas::prim::velocity(2), k, j, i) = 0.0; - v(0, gas::prim::sie(), k, j, i) = gsie; - - // dust initial condition - if (dcol.prob_flag == 1) { // stiff problem with smaller stopping time - v(0, dust::prim::density(0), k, j, i) = 1.0; - v(0, dust::prim::density(1), k, j, i) = 1.0; - } else { - v(0, dust::prim::density(0), k, j, i) = 10.0; - v(0, dust::prim::density(1), k, j, i) = 100.0; - } - v(0, dust::prim::velocity(0 * 3 + 0), k, j, i) = 2.0; - v(0, dust::prim::velocity(0 * 3 + 1), k, j, i) = 0.0; - v(0, dust::prim::velocity(0 * 3 + 2), k, j, i) = 0.0; - - v(0, dust::prim::velocity(1 * 3 + 0), k, j, i) = 0.5; - v(0, dust::prim::velocity(1 * 3 + 1), k, j, i) = 0.0; - v(0, dust::prim::velocity(1 * 3 + 2), k, j, i) = 0.0; - }); -} - -//---------------------------------------------------------------------------------------- -//! \fn void PreStepUserworkInLoop -//! \brief output numerical solution and analytic solution before each step -//! and writing to file. -inline void PreStepUserWorkInLoop(Mesh *pmesh, ParameterInput *pin, - parthenon::SimTime &tm) { - - // packing and capture variables for kernel - auto &md = pmesh->mesh_data.GetOrAdd("base", 0); - auto pmb = md->GetBlockData(0)->GetBlockPointer(); - static auto desc = MakePackDescriptor( - (pmb->resolved_packages).get()); - auto v = desc.GetPack(md.get()); - - IndexRange ib = pmb->cellbounds.GetBoundsI(IndexDomain::interior); - IndexRange jb = pmb->cellbounds.GetBoundsJ(IndexDomain::interior); - IndexRange kb = pmb->cellbounds.GetBoundsK(IndexDomain::interior); - - // root process opens output file and writes out data - if (parthenon::Globals::my_rank == 0) { - std::string fname; - fname.assign(pin->GetString("parthenon/job", "problem_id")); - fname.append("-solu1.dat"); - static FILE *pfile = NULL; - - // The file exists -- reopen the file in append mode - if (pfile == NULL) { - if ((pfile = std::fopen(fname.c_str(), "r")) != nullptr) { - if ((pfile = std::freopen(fname.c_str(), "a", pfile)) == nullptr) { - PARTHENON_FAIL("Error output file could not be opened"); - } - // The file does not exist -- open the file in write mode and add headers - } else { - if ((pfile = std::fopen(fname.c_str(), "w")) == nullptr) { - PARTHENON_FAIL("Error output file could not be opened"); - } - std::fprintf(pfile, "# time vel-g vel-ge vel-d1 vel-d1e vel-d2 vel-d2e \n"); - } - } - - // analytic solution - Real v_com, c1_g, c2_g, lam1, lam2, c1_d1, c2_d1, c1_d2, c2_d2; - Real v_g, v_d1, v_d2; - if (dcv.prob_flag == 1) { - v_com = 7. / 6.; - c1_g = -0.35610569612832; - c2_g = 0.18943902946166; - lam1 = -141.742430504416, lam2 = -1058.25756949558; - c1_d1 = 0.85310244713865; - c2_d1 = -0.01976911380532; - c1_d2 = -0.49699675101033; - c2_d2 = -0.16966991565634; - } else { - v_com = 0.63963963963963; - c1_g = -0.06458203330249; - c2_g = 0.42494239366285; - lam1 = -0.52370200744224; - lam2 = -105.976297992557; - c1_d1 = 1.36237475791577; - c2_d1 = -0.00201439755542; - c1_d2 = -0.13559165545855; - c2_d2 = -0.00404798418109; - } - - v_g = v_com + c1_g * std::exp(lam1 * tm.time) + c2_g * std::exp(lam2 * tm.time); - v_d1 = v_com + c1_d1 * std::exp(lam1 * tm.time) + c2_d1 * std::exp(lam2 * tm.time); - v_d2 = v_com + c1_d2 * std::exp(lam1 * tm.time) + c2_d2 * std::exp(lam2 * tm.time); - - // write data - - ParArray1D vel("outdat", 3); - - Real vg0 = 0.0, vd10 = 0.0, vd20 = 0.0; - pmb->par_for( - "out_dustCollision", kb.s, kb.e, jb.s, jb.e, ib.s, ib.s, - KOKKOS_LAMBDA(const int k, const int j, const int i) { - vel(0) = v(0, gas::prim::velocity(0), k, j, i); - vel(1) = v(0, dust::prim::velocity(0), k, j, i); - vel(2) = v(0, dust::prim::velocity(3), k, j, i); - }); - - auto dat = Kokkos::create_mirror_view_and_copy(parthenon::HostMemSpace(), vel); - vg0 = dat(0); - vd10 = dat(1); - vd20 = dat(2); - - std::fprintf(pfile, " %e ", tm.time); - std::fprintf(pfile, " %e ", vg0); - std::fprintf(pfile, " %e ", v_g); - std::fprintf(pfile, " %e ", vd10); - std::fprintf(pfile, " %e ", v_d1); - std::fprintf(pfile, " %e ", vd20); - std::fprintf(pfile, " %e ", v_d2); - - std::fprintf(pfile, "\n"); - // std::fclose(pfile); - } -} - -} // namespace dust_collision - -#endif // PGEN_DUST_COLLISION_HPP_ diff --git a/src/pgen/pgen.hpp b/src/pgen/pgen.hpp index 37228c14..ef69677c 100644 --- a/src/pgen/pgen.hpp +++ b/src/pgen/pgen.hpp @@ -24,7 +24,6 @@ #include "constant.hpp" #include "disk.hpp" #include "dust_coagulation.hpp" -#include "dust_collision.hpp" #include "gaussian_bump.hpp" #include "linear_wave.hpp" #include "shock.hpp" @@ -60,8 +59,6 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { strat::ProblemGenerator(pmb, pin); } else if (name == "thermalization") { thermalization::ProblemGenerator(pmb, pin); - } else if (name == "dust_collision") { - dust_collision::ProblemGenerator(pmb, pin); } else if (name == "dust_coagulation") { dust_coagulation::ProblemGenerator(pmb, pin); } else { diff --git a/src/pgen/problem_modifier.hpp b/src/pgen/problem_modifier.hpp index 88f39564..1b93dee1 100644 --- a/src/pgen/problem_modifier.hpp +++ b/src/pgen/problem_modifier.hpp @@ -126,8 +126,6 @@ void ProblemModifier(parthenon::ParthenonManager *pman) { strat::ExtrapInnerX3); pman->app_input->RegisterBoundaryCondition(BF::outer_x3, "extrap", strat::ExtrapOuterX3); - } else if (artemis_problem == "dust_collision") { - pman->app_input->PreStepMeshUserWorkInLoop = dust_collision::PreStepUserWorkInLoop; } // Register jaybenne swarm boundary conditions diff --git a/src/utils/units.cpp b/src/utils/units.cpp index 86f26af7..92f004a8 100644 --- a/src/utils/units.cpp +++ b/src/utils/units.cpp @@ -45,9 +45,11 @@ Units::Units(ParameterInput *pin, std::shared_ptr pkg) { time_ = pin->GetReal("artemis", "time"); mass_ = pin->GetReal("artemis", "mass"); } else if (unit_conversion == "ppd") { - length_ = AU; - mass_ = Msolar; - time_ = Year / (2. * M_PI); + const Real r0_length = pin->GetOrAddReal("artemis", "r0_length", 1.0); // in AU + const Real mstar = pin->GetOrAddReal("artemis", "mstar", 1.0); // M_sun + length_ = r0_length * AU; + mass_ = mstar * Msolar * pin->GetReal("artemis", "rho0"); + time_ = Year / (2. * M_PI) * std::sqrt(r0_length / mstar) * r0_length; } else { PARTHENON_FAIL("Unit conversion not recognized! Choices are [base, ppd]"); } From 0198b3b9fb3df07950a043b0468ca3537cc4ced1 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Fri, 3 Jan 2025 16:25:37 -0700 Subject: [PATCH 09/38] new output file name based on problem_id --- inputs/dust/dust_coagulation.in | 32 ++++++++++++++--------------- inputs/dust/dust_coagulation_den.in | 32 ++++++++++++++--------------- src/dust/dust.cpp | 5 ++--- 3 files changed, 32 insertions(+), 37 deletions(-) diff --git a/inputs/dust/dust_coagulation.in b/inputs/dust/dust_coagulation.in index 4ebd23ac..151f5ea1 100644 --- a/inputs/dust/dust_coagulation.in +++ b/inputs/dust/dust_coagulation.in @@ -15,9 +15,9 @@ problem = dust_coagulation # name of the pgen coordinates = cartesian # coordinate system unit_conversion = ppd # ppd (code unit: AU, Msun, year/(2*pi) -r0_length = 10. # AU +r0_length = 10. # AU mstar = 1.0 # M_sun -rho0 = 2e-5 +rho0 = 2e-5 # prefactor for density profile physical_units = cgs # @@ -47,7 +47,6 @@ ncycle_out = 1 # interval for stdout summary info nghost = 2 refinement = none -# numlevel = 1 nx1 = 16 # Number of zones in X1-direction x1min = 9.0 # minimum value of X1 @@ -78,34 +77,33 @@ dust = true coagulation = true -cfl = 0.9 -gamma = 1.00001 +cfl = 0.9 # gas cfl number +gamma = 1.00001 # adiabatic index iso_sound_speed = 0.05 # code unit -cv = 1e5 # 1/(gamma-1) +cv = 1e5 # code unit: 1/(gamma-1) -cfl = 0.9 -nspecies = 121 -size_input = logspace +cfl = 0.9 # dust cfl number +nspecies = 121 # number of dust size +size_input = logspace # dust size distribution scr_level = 1 # for reconstruction surface_density_flag = true # surface or volume density grain_density = 1.25 # dust internal density g/cc -min_size = 1e-5 #cm -max_size = 10.0 #cm +min_size = 1e-5 #cm +max_size = 10.0 #cm vfrag = 1000.0 #cm/s coag_int = 1 -coag_use_adaptiveStep = false -coag_mom_preserve = false -coag_info_out = true +coag_use_adaptiveStep = false +coag_mom_preserve = false +coag_info_out = true nInit_dust = 11 # number of dust species initially -dust_to_gas = 0.01 -nstep1Coag = 1 -#rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 +dust_to_gas = 0.01 # init dust-to-gas ratio +nstep1Coag = 10 # number of steps for one coagulation call const_coag_omega = true # using omega at r0_length diff --git a/inputs/dust/dust_coagulation_den.in b/inputs/dust/dust_coagulation_den.in index c1bb60a3..91684e59 100644 --- a/inputs/dust/dust_coagulation_den.in +++ b/inputs/dust/dust_coagulation_den.in @@ -15,9 +15,9 @@ problem = dust_coagulation # name of the pgen coordinates = cartesian # coordinate system unit_conversion = ppd # ppd (code unit: AU, Msun, year/(2*pi) -r0_length = 10. # AU +r0_length = 10. # AU mstar = 1.0 # M_sun -rho0 = 1.59577e-4 # 3D rho (mstar/r0^3) +rho0 = 1.59577e-4 # prefactor for 3D density profile physical_units = cgs # @@ -47,7 +47,6 @@ ncycle_out = 1 # interval for stdout summary info nghost = 2 refinement = none -# numlevel = 1 nx1 = 16 # Number of zones in X1-direction x1min = 9.0 # minimum value of X1 @@ -78,34 +77,33 @@ dust = true coagulation = true -cfl = 0.9 -gamma = 1.00001 +cfl = 0.9 # gas cfl number +gamma = 1.00001 # adiabatic index iso_sound_speed = 0.05 # code unit -cv = 1e5 # 1/(gamma-1) +cv = 1e5 # code unit: 1/(gamma-1) -cfl = 0.9 -nspecies = 121 -size_input = logspace +cfl = 0.9 # dust cfl number +nspecies = 121 # number of dust size +size_input = logspace # dust size distribution scr_level = 1 # for reconstruction surface_density_flag = false # surface or volume density grain_density = 1.25 # dust internal density g/cc -min_size = 1e-5 #cm -max_size = 10.0 #cm +min_size = 1e-5 #cm +max_size = 10.0 #cm vfrag = 1000.0 #cm/s coag_int = 1 -coag_use_adaptiveStep = false -coag_mom_preserve = false -coag_info_out = true +coag_use_adaptiveStep = false +coag_mom_preserve = false +coag_info_out = true nInit_dust = 11 # number of dust species initially -dust_to_gas = 0.01 -nstep1Coag = 1 -#rho0 = 2e-5 # code unit value of 1 m_star/r0_length^2 +dust_to_gas = 0.01 # init dust-to-gas ratio +nstep1Coag = 10 # number of steps for one coagulation call const_coag_omega = true # using omega at r0_length diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index d6785c06..84bf8a26 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -568,9 +568,8 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt if (parthenon::Globals::my_rank == 0) { std::string fname; - // fname.assign(pin->GetString("parthenon/job", "problem_id")); - fname = "artemis"; - fname.append("_coag_info.dat"); + fname.assign(artemis_pkg->template Param("job_name")); + fname.append("_info.dat"); static FILE *pfile = NULL; // The file exists -- reopen the file in append mode From 22cf399b70fc4fb4cda7798fed00a92c2557a56e Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Mon, 3 Feb 2025 17:32:39 -0700 Subject: [PATCH 10/38] modified coagulation input file for cgs unit --- inputs/dust/dust_coagulation.in | 12 ++++++------ inputs/dust/dust_coagulation_den.in | 11 +++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/inputs/dust/dust_coagulation.in b/inputs/dust/dust_coagulation.in index 151f5ea1..674883bc 100644 --- a/inputs/dust/dust_coagulation.in +++ b/inputs/dust/dust_coagulation.in @@ -13,12 +13,12 @@ problem = dust_coagulation # name of the pgen -coordinates = cartesian # coordinate system -unit_conversion = ppd # ppd (code unit: AU, Msun, year/(2*pi) -r0_length = 10. # AU -mstar = 1.0 # M_sun -rho0 = 2e-5 # prefactor for density profile -physical_units = cgs # +coordinates = cartesian # coordinate system +length = 1.495978707e14 # 10AU in cgs unit +mass = 3.976832e+28 # 2e-5*M_sun in cgs unit +time = 158718203.29271033 # cgs unit in year/(2*pi)/(r0**3/mstar)**0.5 +physical_units = cgs # + problem_id = coag # problem ID: basename of output filenames diff --git a/inputs/dust/dust_coagulation_den.in b/inputs/dust/dust_coagulation_den.in index 91684e59..ee2c6eef 100644 --- a/inputs/dust/dust_coagulation_den.in +++ b/inputs/dust/dust_coagulation_den.in @@ -13,12 +13,11 @@ problem = dust_coagulation # name of the pgen -coordinates = cartesian # coordinate system -unit_conversion = ppd # ppd (code unit: AU, Msun, year/(2*pi) -r0_length = 10. # AU -mstar = 1.0 # M_sun -rho0 = 1.59577e-4 # prefactor for 3D density profile -physical_units = cgs # +coordinates = cartesian # coordinate system +length = 1.495978707e14 # 10AU in cgs unit +mass = 3.17305460032e+29 # 1.59577e-4*M_sun in cgs unit +time = 158718203.29271033 # cgs unit in year/(2*pi)/(r0**3/mstar)**0.5 +physical_units = cgs # problem_id = coag # problem ID: basename of output filenames From 8e804179e4119171ddde69fc8aa4570b741e916f Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 11 Feb 2025 09:47:15 -0700 Subject: [PATCH 11/38] Added CI test for dust coagulation and paml file for coagulation --- src/dust/coagulation/params.yaml | 60 ++++++++++++++++++++++ tst/scripts/coagulation/__init__.py | 0 tst/scripts/coagulation/coagulation.py | 70 ++++++++++++++++++++++++++ 3 files changed, 130 insertions(+) create mode 100644 src/dust/coagulation/params.yaml create mode 100644 tst/scripts/coagulation/__init__.py create mode 100644 tst/scripts/coagulation/coagulation.py diff --git a/src/dust/coagulation/params.yaml b/src/dust/coagulation/params.yaml new file mode 100644 index 00000000..e93e7e8c --- /dev/null +++ b/src/dust/coagulation/params.yaml @@ -0,0 +1,60 @@ +--- +coagulation: + + vfrag: + _type: Real + _default: "1e3" + _description: "Dust fragmentation velocity" + _units: "cm / s" + + coag_int: + _type: int + _default: 3 + _description: "Coagulation time integration method[forward Euler(1), Heun's method(3)]" + + coag_use_adaptiveStep: + _type: bool + _default: "true" + _description: "Turn on adaptive time integration" + + coag_mom_preserve: + _type: bool + _default: "true" + _description: "Turn on momentum-preserving coagulation" + + coag_nsteps_mx: + _type: int + _default: 1000 + _description: "Maximum number of time-steps per coagulation call" + + const_coag_omega: + _type: bool + _default: "false" + _description: "Constant Keplerian angular velcity [e.g, sharingbox]" + + coag_bounce: + _type: bool + _default: "false" + _description: "Turn on the bouncing impact on coagulation" + _units: "cm" + + nstep1Coag: + _type: int + _default: 50 + _description: "Number of hydro steps between two coagulation calls" + + coag_alpha: + _type: Real + _default: 1e-3 + _description: "Turbulence alpha used in the coagulation algorithm" + + coag_scr_level: + _type: int + _default: 0 + _description: "Coagulation scratch memory level" + + coag_info_out: + _type: bool + _default: "false" + _description: "Turn on output coagualtion info after each call" + diff --git a/tst/scripts/coagulation/__init__.py b/tst/scripts/coagulation/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tst/scripts/coagulation/coagulation.py b/tst/scripts/coagulation/coagulation.py new file mode 100644 index 00000000..1d4a966d --- /dev/null +++ b/tst/scripts/coagulation/coagulation.py @@ -0,0 +1,70 @@ +# ======================================================================================== +# (C) (or copyright) 2024. Triad National Security, LLC. All rights reserved. +# +# This program was produced under U.S. Government contract 89233218CNA000001 for Los +# Alamos National Laboratory (LANL), which is operated by Triad National Security, LLC +# for the U.S. Department of Energy/National Nuclear Security Administration. All rights +# in the program are reserved by Triad National Security, LLC, and the U.S. Department +# of Energy/National Nuclear Security Administration. The Government is granted for +# itself and others acting on its behalf a nonexclusive, paid-up, irrevocable worldwide +# license in this material to reproduce, prepare derivative works, distribute copies to +# the public, perform publicly and display publicly, and to permit others to do so. +# ======================================================================================== + +# Regression to test dust coagulation for both surface-density and volume-density + +# Modules +import logging +import numpy as np +import os +import scripts.utils.artemis as artemis +from scipy.interpolate import interp1d + + +logger = logging.getLogger("artemis" + __name__[7:]) # set logger name + +_nranks = 1 +_file_id = "coag" +_massunit = ["3.976832e28", "3.17305460032e29"] +_surfden = ["true", "false"] +_tlim = 3768.0 + +# Run Artemis +def run(**kwargs): + logger.debug("Runnning test " + __name__) + for ii, im in enumeriate(_massunit): + arguments = [ + "artemis/mass=" +_im, + "parthenon/job/problem_id=" + _file_id, + "parthenon/time/tlim={:.8f}".format(_tlim), + "dust/surface_density_flag=" + _surfden[ii], + ] + artemis.run(_nranks, "dust/dust_coagulation.in", arguments) + + +# Analyze outputs +def analyze(): + logger.debug("Analyzing test " + __name__) + + # Grab referenece solution + dat_sden = np.loadtxt( + os.path.join(artemis.get_artemis_dir(), + "tst/scripts/coagulation/coag_info_sden.dat"), + unpack=True, + ) + dat_den = np.loadtxt( + os.path.join(artemis.get_artemis_dir(), + "tst/scripts/coagulation/coag_info_den.dat"), + unpack=True, + ) + + data_ref = np.array([dat_sden[2:5,:], dat_den[2:5,:]]) + + fname = os.path.join(artemis.get_data_dir(), _file_id + "_info.dat") + data = np.loadtxt(fname, unpack=True,) + data_tst = data[2:5,:].reshape([len(_surfden), 3, data_ref.shape[-1]]); + + errs = data_ref - data_tst; + errors = np.array(errs).ravel() + fail = np.any(errors > 0) + return not fail From df9baa0837dacc219fa915885c3cc0b3bf4a7893 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 11 Feb 2025 17:39:56 -0700 Subject: [PATCH 12/38] Add 4D par_for_outer to ArtemisUtils.hpp, rewrite coagulation using the 4D par_for_outer. --- src/dust/dust.cpp | 240 ++++++++++++------------- src/utils/artemis_utils.hpp | 32 ++++ tst/scripts/coagulation/coagulation.py | 30 ++-- 3 files changed, 169 insertions(+), 133 deletions(-) diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index 5690486e..ef3cd45d 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -394,11 +394,12 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt size_t scr_size = ScratchPad1D::shmem_size(isize); auto pmb = md->GetBlockData(0)->GetBlockPointer(); - ParArray3D nCalls; + ParArray4D nCalls; int maxCalls, maxSize, maxSize0; Real massd0, massd; if (info_out_flag) { - nCalls = ParArray3D("coag_nCalls", pmb->cellbounds.ncellsk(IndexDomain::entire), + nCalls = ParArray4D("coag_nCalls", md->NumBlocks(), + pmb->cellbounds.ncellsk(IndexDomain::entire), pmb->cellbounds.ncellsj(IndexDomain::entire), pmb->cellbounds.ncellsi(IndexDomain::entire)); maxCalls = 0; @@ -435,134 +436,131 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt #endif // MPI_PARALLEL } // end if (info_out_flag) - for (int b = 0; b < md->NumBlocks(); b++) { - parthenon::par_for_outer( - DEFAULT_OUTER_LOOP_PATTERN, "Dust::Coagulation", parthenon::DevExecSpace(), - scr_size, scr_level, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(parthenon::team_mbr_t mbr, const int k, const int j, const int i) { - // code-to-physical unit - // one-cell coagulation - const int nDust_live = (vmesh.GetUpperBound(b, dust::prim::density()) - - vmesh.GetLowerBound(b, dust::prim::density()) + 1); + ArtemisUtils::par_for_outer( + DEFAULT_OUTER_LOOP_PATTERN, "Dust::Coagulation", parthenon::DevExecSpace(), + scr_size, scr_level, 0, md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(parthenon::team_mbr_t mbr, const int b, const int k, const int j, + const int i) { + // code-to-physical unit + // one-cell coagulation + const int nDust_live = (vmesh.GetUpperBound(b, dust::prim::density()) - + vmesh.GetLowerBound(b, dust::prim::density()) + 1); - const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); - Real dt_sync = dt * time0; + const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); + Real dt_sync = dt * time0; - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - const auto &hx = coords.GetScaleFactors(); - const auto &xv = coords.GetCellCenter(); - const auto &xcyl = coords.ConvertToCyl(xv); - - const Real rad = coag.const_omega ? 1.0 : xcyl[0]; // cylindrical - - const Real Omega_k = 1.0 / std::sqrt(rad) / rad; - - int nCall1 = 0; - - const Real sie = vmesh(b, gas::prim::sie(0), k, j, i); - const Real bulk = eos_d.BulkModulusFromDensityInternalEnergy(dens_g, sie); - const Real cs1 = std::sqrt(bulk / dens_g) * vel0; - const Real omega1 = Omega_k / time0; - const int nm = nspecies; - const Real time1 = time * time0; - const Real dens_g1 = dens_g * rho0; - - ScratchPad1D rhod(mbr.team_scratch(scr_level), nspecies); - ScratchPad1D stime(mbr.team_scratch(scr_level), nspecies); - ScratchPad1D vel(mbr.team_scratch(scr_level), nvel * nspecies); - ScratchPad1D source(mbr.team_scratch(scr_level), nspecies); - ScratchPad1D Q(mbr.team_scratch(scr_level), nspecies); - ScratchPad1D nQs(mbr.team_scratch(scr_level), nspecies); - [[maybe_unused]] ScratchPad1D Q2; - if (coag.integrator == 3 && coag.mom_coag) { - Q2 = ScratchPad1D(mbr.team_scratch(scr_level), nspecies); - } + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const auto &hx = coords.GetScaleFactors(); + const auto &xv = coords.GetCellCenter(); + const auto &xcyl = coords.ConvertToCyl(xv); + + const Real rad = coag.const_omega ? 1.0 : xcyl[0]; // cylindrical + + const Real Omega_k = 1.0 / std::sqrt(rad) / rad; + + int nCall1 = 0; + + const Real sie = vmesh(b, gas::prim::sie(0), k, j, i); + const Real bulk = eos_d.BulkModulusFromDensityInternalEnergy(dens_g, sie); + const Real cs1 = std::sqrt(bulk / dens_g) * vel0; + const Real omega1 = Omega_k / time0; + const int nm = nspecies; + const Real time1 = time * time0; + const Real dens_g1 = dens_g * rho0; + + ScratchPad1D rhod(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D stime(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D vel(mbr.team_scratch(scr_level), nvel * nspecies); + ScratchPad1D source(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D Q(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D nQs(mbr.team_scratch(scr_level), nspecies); + [[maybe_unused]] ScratchPad1D Q2; + if (coag.integrator == 3 && coag.mom_coag) { + Q2 = ScratchPad1D(mbr.team_scratch(scr_level), nspecies); + } - // calculate the stopping time on the fly - Real st0 = 1.0; - if (coag.coord) { // surface density - st0 = 0.5 * M_PI * coag.rho_p / dens_g1 / omega1; - } else { - st0 = std::sqrt(M_PI / 8.0) * coag.rho_p / dens_g1 / cs1; - } + // calculate the stopping time on the fly + Real st0 = 1.0; + if (coag.coord) { // surface density + st0 = 0.5 * M_PI * coag.rho_p / dens_g1 / omega1; + } else { + st0 = std::sqrt(M_PI / 8.0) * coag.rho_p / dens_g1 / cs1; + } - parthenon::par_for_inner( - DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { - // calculate the stopping time on fly - stime(n) = st0 * dust_size(n) * length0; - if (vmesh(b, dust::prim::density(n), k, j, i) > dfloor) { - rhod(n) = vmesh(b, dust::prim::density(n), k, j, i) * rho0; - for (int d = 0; d < nvel; d++) { - vel(VI(n, d)) = - vmesh(b, dust::prim::velocity(VI(n, d)), k, j, i) * vel0; - } - } else { - rhod(n) = 0.0; - for (int d = 0; d < nvel; d++) { - vel(VI(n, d)) = 0.0; - } + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { + // calculate the stopping time on fly + stime(n) = st0 * dust_size(n) * length0; + if (vmesh(b, dust::prim::density(n), k, j, i) > dfloor) { + rhod(n) = vmesh(b, dust::prim::density(n), k, j, i) * rho0; + for (int d = 0; d < nvel; d++) { + vel(VI(n, d)) = + vmesh(b, dust::prim::velocity(VI(n, d)), k, j, i) * vel0; } - }); - - Coagulation::CoagulationOneCell(mbr, i, time1, dt_sync, dens_g1, rhod, stime, - vel, nvel, Q, nQs, alpha, cs1, omega1, coag, - source, nCall1, Q2); - - if (info_out_flag) nCalls(k, j, i) = nCall1; - - // update dust density and velocity after coagulation - parthenon::par_for_inner( - DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { - // for (int n = 0; n < nspecies; ++n) { - if (rhod(n) > 0.0) { - const Real rhod1 = rhod(n); - vmesh(b, dust::cons::density(n), k, j, i) = rhod1 / rho0; - for (int d = 0; d < nvel; d++) { - vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = - rhod1 * vel(VI(n, d)) * hx[d] / vel0; - } - } else { - vmesh(b, dust::cons::density(n), k, j, i) = 0.0; - for (int d = 0; d < nvel; d++) { - vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = 0.0; - } + } else { + rhod(n) = 0.0; + for (int d = 0; d < nvel; d++) { + vel(VI(n, d)) = 0.0; } - }); - }); - - if (info_out_flag) { - Real sumd0 = 0.0; - int maxCalls1 = 1, maxSize1 = 1; - Kokkos::parallel_reduce( - "coag::nCallsMaximum", - Kokkos::MDRangePolicy>({kb.s, jb.s, ib.s}, - {kb.e + 1, jb.e + 1, ib.e + 1}), - KOKKOS_LAMBDA(const int k, const int j, const int i, Real &lsum, int &lmax1, - int &lmax2) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - const Real vol00 = coords.Volume(); - for (int n = 0; n < nspecies; ++n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - lsum += dens_d * vol00; - } - lmax1 = std::max(lmax1, nCalls(k, j, i)); - for (int n = nspecies - 1; n >= 0; --n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - if (dens_d > dfloor) { - lmax2 = std::max(lmax2, n); - break; } - } - }, - Kokkos::Sum(sumd0), Kokkos::Max(maxCalls1), - Kokkos::Max(maxSize1)); - massd += sumd0; - maxCalls = std::max(maxCalls, maxCalls1); - maxSize = std::max(maxSize, maxSize1); - } // end if (info_out_flag) - } // loop of blocks + }); + + Coagulation::CoagulationOneCell(mbr, i, time1, dt_sync, dens_g1, rhod, stime, vel, + nvel, Q, nQs, alpha, cs1, omega1, coag, source, + nCall1, Q2); + + if (info_out_flag) nCalls(b, k, j, i) = nCall1; + + // update dust density and velocity after coagulation + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { + // for (int n = 0; n < nspecies; ++n) { + if (rhod(n) > 0.0) { + const Real rhod1 = rhod(n); + vmesh(b, dust::cons::density(n), k, j, i) = rhod1 / rho0; + for (int d = 0; d < nvel; d++) { + vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = + rhod1 * vel(VI(n, d)) * hx[d] / vel0; + } + } else { + vmesh(b, dust::cons::density(n), k, j, i) = 0.0; + for (int d = 0; d < nvel; d++) { + vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = 0.0; + } + } + }); + }); // end of par_for_outer if (info_out_flag) { + Real sumd0 = 0.0; + int maxCalls1 = 1, maxSize1 = 1; + Kokkos::parallel_reduce( + "coag::nCallsMaximum", + Kokkos::MDRangePolicy>( + {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, + int &lmax1, int &lmax2) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const Real vol00 = coords.Volume(); + for (int n = 0; n < nspecies; ++n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + lsum += dens_d * vol00; + } + lmax1 = std::max(lmax1, nCalls(b, k, j, i)); + for (int n = nspecies - 1; n >= 0; --n) { + Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + if (dens_d > dfloor) { + lmax2 = std::max(lmax2, n); + break; + } + } + }, + Kokkos::Sum(sumd0), Kokkos::Max(maxCalls1), + Kokkos::Max(maxSize1)); + massd += sumd0; + maxCalls = std::max(maxCalls, maxCalls1); + maxSize = std::max(maxSize, maxSize1); + #ifdef MPI_PARALLEL // over all processors MPI_Reduce(MPI_IN_PLACE, &maxCalls, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); diff --git a/src/utils/artemis_utils.hpp b/src/utils/artemis_utils.hpp index 1e3a7473..964d6aef 100644 --- a/src/utils/artemis_utils.hpp +++ b/src/utils/artemis_utils.hpp @@ -183,6 +183,38 @@ void PrintArtemisConfiguration(Packages_t &packages); void EnrollArtemisRefinementOps(parthenon::Metadata &m, Coordinates coords); std::vector> loadtxt(std::string fname); +// 4D outer parallel loop using Kokkos Teams +template +inline void par_for_outer(OuterLoopPatternTeams, const std::string &name, + DevExecSpace exec_space, size_t scratch_size_in_bytes, + const int scratch_level, const int nl, const int nu, + const int kl, const int ku, const int jl, const int ju, + const int il, const int iu, const Function &function) { + const int Nn = nu - nl + 1; + const int Nk = ku - kl + 1; + const int Nj = ju - jl + 1; + const int Ni = iu - il + 1; + const int NjNi = Nj * Ni; + const int NkNjNi = Nk * Nj * Ni; + const int NnNkNjNi = Nn * Nk * Nj * Ni; + + team_policy policy(exec_space, NnNkNjNi, Kokkos::AUTO); + + Kokkos::parallel_for( + name, + policy.set_scratch_size(scratch_level, Kokkos::PerTeam(scratch_size_in_bytes)), + KOKKOS_LAMBDA(team_mbr_t team_member) { + int n = team_member.league_rank() / NkNjNi; + int k = (team_member.league_rank() - n * NkNjNi) / NjNi; + int j = (team_member.league_rank() - n * NkNjNi - k * NjNi) / Ni; + const int i = team_member.league_rank() - n * NkNjNi - k * NjNi - j * Ni + il; + n += nl; + k += kl; + j += jl; + function(team_member, n, k, j, i); + }); +} + } // namespace ArtemisUtils #endif // UTILS_ARTEMIS_UTILS_HPP_ diff --git a/tst/scripts/coagulation/coagulation.py b/tst/scripts/coagulation/coagulation.py index 1d4a966d..b3feb1ff 100644 --- a/tst/scripts/coagulation/coagulation.py +++ b/tst/scripts/coagulation/coagulation.py @@ -28,13 +28,14 @@ _massunit = ["3.976832e28", "3.17305460032e29"] _surfden = ["true", "false"] _tlim = 3768.0 - + + # Run Artemis def run(**kwargs): logger.debug("Runnning test " + __name__) - for ii, im in enumeriate(_massunit): + for ii, im in enumerate(_massunit): arguments = [ - "artemis/mass=" +_im, + "artemis/mass=" + _im, "parthenon/job/problem_id=" + _file_id, "parthenon/time/tlim={:.8f}".format(_tlim), "dust/surface_density_flag=" + _surfden[ii], @@ -48,23 +49,28 @@ def analyze(): # Grab referenece solution dat_sden = np.loadtxt( - os.path.join(artemis.get_artemis_dir(), - "tst/scripts/coagulation/coag_info_sden.dat"), + os.path.join( + artemis.get_artemis_dir(), "tst/scripts/coagulation/coag_info_sden.dat" + ), unpack=True, ) dat_den = np.loadtxt( - os.path.join(artemis.get_artemis_dir(), - "tst/scripts/coagulation/coag_info_den.dat"), + os.path.join( + artemis.get_artemis_dir(), "tst/scripts/coagulation/coag_info_den.dat" + ), unpack=True, ) - data_ref = np.array([dat_sden[2:5,:], dat_den[2:5,:]]) - + data_ref = np.array([dat_sden[2:5, :], dat_den[2:5, :]]) + fname = os.path.join(artemis.get_data_dir(), _file_id + "_info.dat") - data = np.loadtxt(fname, unpack=True,) - data_tst = data[2:5,:].reshape([len(_surfden), 3, data_ref.shape[-1]]); + data = np.loadtxt( + fname, + unpack=True, + ) + data_tst = data[2:5, :].reshape([len(_surfden), 3, data_ref.shape[-1]]) - errs = data_ref - data_tst; + errs = data_ref - data_tst errors = np.array(errs).ravel() fail = np.any(errors > 0) return not fail From c6f02e547ddc06a72e528a1974bc767092032395 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Wed, 12 Feb 2025 08:00:32 -0700 Subject: [PATCH 13/38] fixed a typo in CI routine coagulation.py --- tst/scripts/coagulation/coagulation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tst/scripts/coagulation/coagulation.py b/tst/scripts/coagulation/coagulation.py index b3feb1ff..324f0797 100644 --- a/tst/scripts/coagulation/coagulation.py +++ b/tst/scripts/coagulation/coagulation.py @@ -35,7 +35,7 @@ def run(**kwargs): logger.debug("Runnning test " + __name__) for ii, im in enumerate(_massunit): arguments = [ - "artemis/mass=" + _im, + "artemis/mass=" + im, "parthenon/job/problem_id=" + _file_id, "parthenon/time/tlim={:.8f}".format(_tlim), "dust/surface_density_flag=" + _surfden[ii], From f4866cf5c4f97e958d6e4d35a2b3bb4c940d5efb Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 25 Feb 2025 13:35:51 -0700 Subject: [PATCH 14/38] add compress=on to CMakePresets.json --- CMakePresets.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 7e126381..1173b28e 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -22,7 +22,8 @@ "CMAKE_MAKE_PROGRAM": "$env{MAKE_PROGRAM}", "CMAKE_C_COMPILER": "gcc", "CMAKE_CXX_COMPILER": "g++", - "CMAKE_BUILD_TYPE": "RelWithDebInfo" + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON" } }, { @@ -33,7 +34,8 @@ "Kokkos_ENABLE_DEBUG_BOUNDS_CHECK": "ON", "CMAKE_CXX_COMPILER": "$env{ARTEMIS_HOME}/external/parthenon/external/Kokkos/bin/nvcc_wrapper", "ARTEMIS_ENABLE_CUDA": "ON", - "Kokkos_ARCH_VOLTA70": "ON" + "Kokkos_ARCH_VOLTA70": "ON", + "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON" } }, { @@ -43,7 +45,8 @@ "CMAKE_BUILD_TYPE": "Release", "CMAKE_CXX_COMPILER": "$env{ARTEMIS_HOME}/external/parthenon/external/Kokkos/bin/nvcc_wrapper", "ARTEMIS_ENABLE_CUDA": "ON", - "Kokkos_ARCH_VOLTA70": "ON" + "Kokkos_ARCH_VOLTA70": "ON", + "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON" } }, { From 55edfc6f085fb187da83f1034a13ad7a45071d00 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 25 Feb 2025 16:49:10 -0700 Subject: [PATCH 15/38] add reference data file for coagulation CI test --- inputs/dust/dust_coagulation.in | 2 +- tst/scripts/coagulation/coag_info_den.dat | 168 +++++++++++++++++++++ tst/scripts/coagulation/coag_info_sden.dat | 168 +++++++++++++++++++++ 3 files changed, 337 insertions(+), 1 deletion(-) create mode 100644 tst/scripts/coagulation/coag_info_den.dat create mode 100644 tst/scripts/coagulation/coag_info_sden.dat diff --git a/inputs/dust/dust_coagulation.in b/inputs/dust/dust_coagulation.in index 39a60ed4..9e3adca9 100644 --- a/inputs/dust/dust_coagulation.in +++ b/inputs/dust/dust_coagulation.in @@ -43,7 +43,7 @@ dt = 628 nlim = -1 # cycle limit tlim = 3768. # time limit integrator = rk2 # time integration algorithm -ncycle_out = 1 # interval for stdout summary info +ncycle_out = 10 # interval for stdout summary info nghost = 2 diff --git a/tst/scripts/coagulation/coag_info_den.dat b/tst/scripts/coagulation/coag_info_den.dat new file mode 100644 index 00000000..9c81f60f --- /dev/null +++ b/tst/scripts/coagulation/coag_info_den.dat @@ -0,0 +1,168 @@ +# time dt maxCall end_maxSize beg_massSize end_total_massd beg_total_massd diff_massd + 0.000000e+00 2.250000e+01 7 20 10 1.256637e-01 1.256637e-01 0.000000e+00 + 2.250000e+01 2.250000e+01 6 24 20 1.256637e-01 1.256637e-01 4.417437e-16 + 4.500000e+01 2.250000e+01 5 27 24 1.256637e-01 1.256637e-01 1.546103e-15 + 6.750000e+01 2.250000e+01 5 29 27 1.256637e-01 1.256637e-01 -1.104359e-15 + 9.000000e+01 2.250000e+01 4 30 29 1.256637e-01 1.256637e-01 1.546103e-15 + 1.125000e+02 2.250000e+01 4 32 30 1.256637e-01 1.256637e-01 -3.754821e-15 + 1.350000e+02 2.250000e+01 4 33 32 1.256637e-01 1.256637e-01 1.766975e-15 + 1.575000e+02 2.250000e+01 3 35 33 1.256637e-01 1.256637e-01 6.626156e-16 + 1.800000e+02 2.250000e+01 3 36 35 1.256637e-01 1.256637e-01 6.626156e-16 + 2.025000e+02 2.250000e+01 3 37 36 1.256637e-01 1.256637e-01 1.104359e-15 + 2.250000e+02 2.250000e+01 3 38 37 1.256637e-01 1.256637e-01 -8.834874e-16 + 2.475000e+02 2.250000e+01 3 39 38 1.256637e-01 1.256637e-01 -2.208719e-16 + 2.700000e+02 2.250000e+01 3 40 39 1.256637e-01 1.256637e-01 -6.626156e-16 + 2.925000e+02 2.250000e+01 3 41 40 1.256637e-01 1.256637e-01 2.208719e-16 + 3.150000e+02 2.250000e+01 3 42 41 1.256637e-01 1.256637e-01 -3.313078e-15 + 3.375000e+02 2.250000e+01 2 43 42 1.256637e-01 1.256637e-01 3.533950e-15 + 3.600000e+02 2.250000e+01 2 44 43 1.256637e-01 1.256637e-01 -4.417437e-16 + 3.825000e+02 2.250000e+01 2 45 44 1.256637e-01 1.256637e-01 3.313078e-15 + 4.050000e+02 2.250000e+01 2 46 45 1.256637e-01 1.256637e-01 -6.626156e-16 + 4.275000e+02 2.250000e+01 2 47 46 1.256637e-01 1.256637e-01 -4.417437e-16 + 4.500000e+02 2.250000e+01 2 48 47 1.256637e-01 1.256637e-01 -2.650462e-15 + 4.725000e+02 2.250000e+01 2 49 48 1.256637e-01 1.256637e-01 2.429590e-15 + 4.950000e+02 2.250000e+01 2 50 49 1.256637e-01 1.256637e-01 -5.080053e-15 + 5.175000e+02 2.250000e+01 2 51 50 1.256637e-01 1.256637e-01 3.092206e-15 + 5.400000e+02 2.250000e+01 2 52 51 1.256637e-01 1.256637e-01 2.871334e-15 + 5.625000e+02 2.250000e+01 2 53 52 1.256637e-01 1.256637e-01 -4.417437e-16 + 5.850000e+02 2.250000e+01 2 53 53 1.256637e-01 1.256637e-01 0.000000e+00 + 6.075000e+02 2.250000e+01 2 54 53 1.256637e-01 1.256637e-01 -2.208719e-15 + 6.300000e+02 2.250000e+01 2 55 54 1.256637e-01 1.256637e-01 3.313078e-15 + 6.525000e+02 2.250000e+01 2 56 55 1.256637e-01 1.256637e-01 -8.834874e-16 + 6.750000e+02 2.250000e+01 2 56 56 1.256637e-01 1.256637e-01 -1.766975e-15 + 6.975000e+02 2.250000e+01 2 57 56 1.256637e-01 1.256637e-01 -3.313078e-15 + 7.200000e+02 2.250000e+01 2 58 57 1.256637e-01 1.256637e-01 5.300924e-15 + 7.425000e+02 2.250000e+01 2 58 58 1.256637e-01 1.256637e-01 -4.417437e-15 + 7.650000e+02 2.250000e+01 2 59 58 1.256637e-01 1.256637e-01 1.325231e-15 + 7.875000e+02 2.250000e+01 2 60 59 1.256637e-01 1.256637e-01 -2.208719e-16 + 8.100000e+02 2.250000e+01 2 60 60 1.256637e-01 1.256637e-01 8.834874e-16 + 8.325000e+02 2.250000e+01 2 61 60 1.256637e-01 1.256637e-01 3.754821e-15 + 8.550000e+02 2.250000e+01 2 62 61 1.256637e-01 1.256637e-01 -2.429590e-15 + 8.775000e+02 2.250000e+01 2 62 62 1.256637e-01 1.256637e-01 -2.208719e-16 + 9.000000e+02 2.250000e+01 2 63 62 1.256637e-01 1.256637e-01 -1.325231e-15 + 9.225000e+02 2.250000e+01 2 63 63 1.256637e-01 1.256637e-01 2.208719e-16 + 9.450000e+02 2.250000e+01 2 64 63 1.256637e-01 1.256637e-01 3.975693e-15 + 9.675000e+02 2.250000e+01 2 64 64 1.256637e-01 1.256637e-01 -4.417437e-16 + 9.900000e+02 2.250000e+01 2 65 64 1.256637e-01 1.256637e-01 -6.405284e-15 + 1.012500e+03 2.250000e+01 2 65 65 1.256637e-01 1.256637e-01 2.429590e-15 + 1.035000e+03 2.250000e+01 2 66 65 1.256637e-01 1.256637e-01 -1.325231e-15 + 1.057500e+03 2.250000e+01 2 66 66 1.256637e-01 1.256637e-01 3.754821e-15 + 1.080000e+03 2.250000e+01 2 67 66 1.256637e-01 1.256637e-01 6.626156e-16 + 1.102500e+03 2.250000e+01 2 67 67 1.256637e-01 1.256637e-01 -2.208719e-16 + 1.125000e+03 2.250000e+01 2 68 67 1.256637e-01 1.256637e-01 -1.546103e-15 + 1.147500e+03 2.250000e+01 2 68 68 1.256637e-01 1.256637e-01 8.834874e-16 + 1.170000e+03 2.250000e+01 2 69 68 1.256637e-01 1.256637e-01 -1.987847e-15 + 1.192500e+03 2.250000e+01 2 69 69 1.256637e-01 1.256637e-01 6.626156e-16 + 1.215000e+03 2.250000e+01 2 70 69 1.256637e-01 1.256637e-01 -1.325231e-15 + 1.237500e+03 2.250000e+01 2 70 70 1.256637e-01 1.256637e-01 1.546103e-15 + 1.260000e+03 2.250000e+01 2 70 70 1.256637e-01 1.256637e-01 5.742668e-15 + 1.282500e+03 2.250000e+01 2 71 70 1.256637e-01 1.256637e-01 -9.276618e-15 + 1.305000e+03 2.250000e+01 2 71 71 1.256637e-01 1.256637e-01 3.313078e-15 + 1.327500e+03 2.250000e+01 2 72 71 1.256637e-01 1.256637e-01 1.546103e-15 + 1.350000e+03 2.250000e+01 2 72 72 1.256637e-01 1.256637e-01 -8.834874e-16 + 1.372500e+03 2.250000e+01 2 72 72 1.256637e-01 1.256637e-01 -8.834874e-16 + 1.395000e+03 2.250000e+01 2 73 72 1.256637e-01 1.256637e-01 1.987847e-15 + 1.417500e+03 2.250000e+01 2 73 73 1.256637e-01 1.256637e-01 -1.546103e-15 + 1.440000e+03 2.250000e+01 2 74 73 1.256637e-01 1.256637e-01 0.000000e+00 + 1.462500e+03 2.250000e+01 2 74 74 1.256637e-01 1.256637e-01 1.104359e-15 + 1.485000e+03 2.250000e+01 2 74 74 1.256637e-01 1.256637e-01 -2.208719e-16 + 1.507500e+03 2.250000e+01 2 75 74 1.256637e-01 1.256637e-01 -4.196565e-15 + 1.530000e+03 2.250000e+01 2 75 75 1.256637e-01 1.256637e-01 -6.626156e-16 + 1.552500e+03 2.250000e+01 2 76 75 1.256637e-01 1.256637e-01 6.184412e-15 + 1.575000e+03 2.250000e+01 2 76 76 1.256637e-01 1.256637e-01 -2.871334e-15 + 1.597500e+03 2.250000e+01 2 76 76 1.256637e-01 1.256637e-01 8.834874e-16 + 1.620000e+03 2.250000e+01 2 77 76 1.256637e-01 1.256637e-01 -2.650462e-15 + 1.642500e+03 2.250000e+01 2 77 77 1.256637e-01 1.256637e-01 2.429590e-15 + 1.665000e+03 2.250000e+01 2 77 77 1.256637e-01 1.256637e-01 5.080053e-15 + 1.687500e+03 2.250000e+01 2 78 77 1.256637e-01 1.256637e-01 -1.987847e-15 + 1.710000e+03 2.250000e+01 2 78 78 1.256637e-01 1.256637e-01 2.208719e-16 + 1.732500e+03 2.250000e+01 2 78 78 1.256637e-01 1.256637e-01 -3.533950e-15 + 1.755000e+03 2.250000e+01 2 79 78 1.256637e-01 1.256637e-01 -1.104359e-15 + 1.777500e+03 2.250000e+01 2 79 79 1.256637e-01 1.256637e-01 6.847027e-15 + 1.800000e+03 2.250000e+01 2 79 79 1.256637e-01 1.256637e-01 -7.067899e-15 + 1.822500e+03 2.250000e+01 2 80 79 1.256637e-01 1.256637e-01 0.000000e+00 + 1.845000e+03 2.250000e+01 2 80 80 1.256637e-01 1.256637e-01 1.766975e-15 + 1.867500e+03 2.250000e+01 2 80 80 1.256637e-01 1.256637e-01 2.429590e-15 + 1.890000e+03 2.250000e+01 2 81 80 1.256637e-01 1.256637e-01 -8.834874e-16 + 1.912500e+03 2.250000e+01 1 81 81 1.256637e-01 1.256637e-01 -2.429590e-15 + 1.935000e+03 2.250000e+01 1 81 81 1.256637e-01 1.256637e-01 3.092206e-15 + 1.957500e+03 2.250000e+01 1 81 81 1.256637e-01 1.256637e-01 1.546103e-15 + 1.980000e+03 2.250000e+01 1 82 81 1.256637e-01 1.256637e-01 2.208719e-16 + 2.002500e+03 2.250000e+01 1 82 82 1.256637e-01 1.256637e-01 -6.626156e-16 + 2.025000e+03 2.250000e+01 1 82 82 1.256637e-01 1.256637e-01 -1.987847e-15 + 2.047500e+03 2.250000e+01 1 82 82 1.256637e-01 1.256637e-01 1.766975e-15 + 2.070000e+03 2.250000e+01 1 83 82 1.256637e-01 1.256637e-01 -8.834874e-16 + 2.092500e+03 2.250000e+01 1 83 83 1.256637e-01 1.256637e-01 1.104359e-15 + 2.115000e+03 2.250000e+01 1 83 83 1.256637e-01 1.256637e-01 6.626156e-16 + 2.137500e+03 2.250000e+01 1 84 83 1.256637e-01 1.256637e-01 -4.417437e-15 + 2.160000e+03 2.250000e+01 1 84 84 1.256637e-01 1.256637e-01 3.313078e-15 + 2.182500e+03 2.250000e+01 1 84 84 1.256637e-01 1.256637e-01 -8.834874e-16 + 2.205000e+03 2.250000e+01 1 84 84 1.256637e-01 1.256637e-01 2.650462e-15 + 2.227500e+03 2.250000e+01 1 85 84 1.256637e-01 1.256637e-01 -1.325231e-15 + 2.250000e+03 2.250000e+01 1 85 85 1.256637e-01 1.256637e-01 -8.834874e-16 + 2.272500e+03 2.250000e+01 1 85 85 1.256637e-01 1.256637e-01 4.638309e-15 + 2.295000e+03 2.250000e+01 1 85 85 1.256637e-01 1.256637e-01 -4.196565e-15 + 2.317500e+03 2.250000e+01 1 86 85 1.256637e-01 1.256637e-01 -5.521796e-15 + 2.340000e+03 2.250000e+01 1 86 86 1.256637e-01 1.256637e-01 4.638309e-15 + 2.362500e+03 2.250000e+01 1 86 86 1.256637e-01 1.256637e-01 -3.533950e-15 + 2.385000e+03 2.250000e+01 1 86 86 1.256637e-01 1.256637e-01 5.080053e-15 + 2.407500e+03 2.250000e+01 1 87 86 1.256637e-01 1.256637e-01 -8.834874e-16 + 2.430000e+03 2.250000e+01 1 87 87 1.256637e-01 1.256637e-01 -3.975693e-15 + 2.452500e+03 2.250000e+01 1 87 87 1.256637e-01 1.256637e-01 4.859181e-15 + 2.475000e+03 2.250000e+01 1 87 87 1.256637e-01 1.256637e-01 -4.196565e-15 + 2.497500e+03 2.250000e+01 1 87 87 1.256637e-01 1.256637e-01 2.208719e-15 + 2.520000e+03 2.250000e+01 1 88 87 1.256637e-01 1.256637e-01 0.000000e+00 + 2.542500e+03 2.250000e+01 1 88 88 1.256637e-01 1.256637e-01 -2.208719e-16 + 2.565000e+03 2.250000e+01 1 88 88 1.256637e-01 1.256637e-01 2.429590e-15 + 2.587500e+03 2.250000e+01 1 88 88 1.256637e-01 1.256637e-01 -3.092206e-15 + 2.610000e+03 2.250000e+01 1 88 88 1.256637e-01 1.256637e-01 -4.417437e-16 + 2.632500e+03 2.250000e+01 1 89 88 1.256637e-01 1.256637e-01 3.092206e-15 + 2.655000e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 0.000000e+00 + 2.677500e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 -1.766975e-15 + 2.700000e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 5.521796e-15 + 2.722500e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 -4.417437e-15 + 2.745000e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 -3.092206e-15 + 2.767500e+03 2.250000e+01 1 90 89 1.256637e-01 1.256637e-01 -3.313078e-15 + 2.790000e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 7.730515e-15 + 2.812500e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 -3.092206e-15 + 2.835000e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 -5.521796e-15 + 2.857500e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 3.754821e-15 + 2.880000e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 1.987847e-15 + 2.902500e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 -4.417437e-16 + 2.925000e+03 2.250000e+01 1 91 90 1.256637e-01 1.256637e-01 3.754821e-15 + 2.947500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -1.987847e-15 + 2.970000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 4.196565e-15 + 2.992500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -5.742668e-15 + 3.015000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -4.417437e-16 + 3.037500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 1.766975e-15 + 3.060000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -4.417437e-16 + 3.082500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -1.104359e-15 + 3.105000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 2.208719e-15 + 3.127500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -8.834874e-16 + 3.150000e+03 2.250000e+01 1 92 91 1.256637e-01 1.256637e-01 1.546103e-15 + 3.172500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 -4.859181e-15 + 3.195000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 1.987847e-15 + 3.217500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 0.000000e+00 + 3.240000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 -1.766975e-15 + 3.262500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.417437e-16 + 3.285000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.417437e-16 + 3.307500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.417437e-16 + 3.330000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 -6.626156e-16 + 3.352500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 -3.975693e-15 + 3.375000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.859181e-15 + 3.397500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 3.533950e-15 + 3.420000e+03 2.250000e+01 1 93 92 1.256637e-01 1.256637e-01 -7.288771e-15 + 3.442500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 6.626156e-15 + 3.465000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 0.000000e+00 + 3.487500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -3.533950e-15 + 3.510000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 5.080053e-15 + 3.532500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -4.417437e-15 + 3.555000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 5.300924e-15 + 3.577500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -5.080053e-15 + 3.600000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 1.987847e-15 + 3.622500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 1.104359e-15 + 3.645000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -1.104359e-15 + 3.667500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -1.546103e-15 + 3.690000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 0.000000e+00 + 3.712500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -1.546103e-15 + 3.735000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 6.626156e-16 diff --git a/tst/scripts/coagulation/coag_info_sden.dat b/tst/scripts/coagulation/coag_info_sden.dat new file mode 100644 index 00000000..cfd91bdd --- /dev/null +++ b/tst/scripts/coagulation/coag_info_sden.dat @@ -0,0 +1,168 @@ +# time dt maxCall end_maxSize beg_massSize end_total_massd beg_total_massd diff_massd + 0.000000e+00 2.250000e+01 6 19 10 1.256637e-01 1.256637e-01 1.546103e-15 + 2.250000e+01 2.250000e+01 5 23 19 1.256637e-01 1.256637e-01 8.834874e-16 + 4.500000e+01 2.250000e+01 4 26 23 1.256637e-01 1.256637e-01 -8.834874e-16 + 6.750000e+01 2.250000e+01 4 28 26 1.256637e-01 1.256637e-01 -1.104359e-15 + 9.000000e+01 2.250000e+01 4 29 28 1.256637e-01 1.256637e-01 2.208719e-16 + 1.125000e+02 2.250000e+01 3 31 29 1.256637e-01 1.256637e-01 -8.834874e-16 + 1.350000e+02 2.250000e+01 3 32 31 1.256637e-01 1.256637e-01 3.313078e-15 + 1.575000e+02 2.250000e+01 3 34 32 1.256637e-01 1.256637e-01 -1.766975e-15 + 1.800000e+02 2.250000e+01 3 35 34 1.256637e-01 1.256637e-01 -2.429590e-15 + 2.025000e+02 2.250000e+01 3 36 35 1.256637e-01 1.256637e-01 1.325231e-15 + 2.250000e+02 2.250000e+01 3 37 36 1.256637e-01 1.256637e-01 2.208719e-15 + 2.475000e+02 2.250000e+01 3 38 37 1.256637e-01 1.256637e-01 4.417437e-16 + 2.700000e+02 2.250000e+01 2 39 38 1.256637e-01 1.256637e-01 -1.546103e-15 + 2.925000e+02 2.250000e+01 2 40 39 1.256637e-01 1.256637e-01 8.834874e-16 + 3.150000e+02 2.250000e+01 2 41 40 1.256637e-01 1.256637e-01 -2.429590e-15 + 3.375000e+02 2.250000e+01 2 42 41 1.256637e-01 1.256637e-01 4.417437e-15 + 3.600000e+02 2.250000e+01 2 43 42 1.256637e-01 1.256637e-01 -6.626156e-16 + 3.825000e+02 2.250000e+01 2 44 43 1.256637e-01 1.256637e-01 -2.208719e-15 + 4.050000e+02 2.250000e+01 2 45 44 1.256637e-01 1.256637e-01 1.766975e-15 + 4.275000e+02 2.250000e+01 2 46 45 1.256637e-01 1.256637e-01 -1.766975e-15 + 4.500000e+02 2.250000e+01 2 47 46 1.256637e-01 1.256637e-01 -6.626156e-16 + 4.725000e+02 2.250000e+01 2 48 47 1.256637e-01 1.256637e-01 8.834874e-16 + 4.950000e+02 2.250000e+01 2 49 48 1.256637e-01 1.256637e-01 8.834874e-16 + 5.175000e+02 2.250000e+01 2 50 49 1.256637e-01 1.256637e-01 -8.834874e-16 + 5.400000e+02 2.250000e+01 2 51 50 1.256637e-01 1.256637e-01 -8.834874e-16 + 5.625000e+02 2.250000e+01 2 52 51 1.256637e-01 1.256637e-01 3.975693e-15 + 5.850000e+02 2.250000e+01 2 52 52 1.256637e-01 1.256637e-01 0.000000e+00 + 6.075000e+02 2.250000e+01 2 53 52 1.256637e-01 1.256637e-01 4.417437e-16 + 6.300000e+02 2.250000e+01 2 54 53 1.256637e-01 1.256637e-01 -4.196565e-15 + 6.525000e+02 2.250000e+01 2 55 54 1.256637e-01 1.256637e-01 4.417437e-16 + 6.750000e+02 2.250000e+01 2 56 55 1.256637e-01 1.256637e-01 1.546103e-15 + 6.975000e+02 2.250000e+01 2 56 56 1.256637e-01 1.256637e-01 -3.754821e-15 + 7.200000e+02 2.250000e+01 2 57 56 1.256637e-01 1.256637e-01 5.521796e-15 + 7.425000e+02 2.250000e+01 2 58 57 1.256637e-01 1.256637e-01 -1.546103e-15 + 7.650000e+02 2.250000e+01 2 58 58 1.256637e-01 1.256637e-01 -3.092206e-15 + 7.875000e+02 2.250000e+01 2 59 58 1.256637e-01 1.256637e-01 -6.626156e-16 + 8.100000e+02 2.250000e+01 2 60 59 1.256637e-01 1.256637e-01 1.766975e-15 + 8.325000e+02 2.250000e+01 2 60 60 1.256637e-01 1.256637e-01 2.208719e-15 + 8.550000e+02 2.250000e+01 2 61 60 1.256637e-01 1.256637e-01 -4.417437e-15 + 8.775000e+02 2.250000e+01 2 62 61 1.256637e-01 1.256637e-01 4.638309e-15 + 9.000000e+02 2.250000e+01 2 62 62 1.256637e-01 1.256637e-01 -1.325231e-15 + 9.225000e+02 2.250000e+01 2 63 62 1.256637e-01 1.256637e-01 8.834874e-16 + 9.450000e+02 2.250000e+01 2 63 63 1.256637e-01 1.256637e-01 -2.871334e-15 + 9.675000e+02 2.250000e+01 2 64 63 1.256637e-01 1.256637e-01 6.626156e-16 + 9.900000e+02 2.250000e+01 2 64 64 1.256637e-01 1.256637e-01 4.417437e-16 + 1.012500e+03 2.250000e+01 2 65 64 1.256637e-01 1.256637e-01 -2.208719e-16 + 1.035000e+03 2.250000e+01 2 65 65 1.256637e-01 1.256637e-01 -4.417437e-16 + 1.057500e+03 2.250000e+01 2 66 65 1.256637e-01 1.256637e-01 3.313078e-15 + 1.080000e+03 2.250000e+01 2 66 66 1.256637e-01 1.256637e-01 -2.429590e-15 + 1.102500e+03 2.250000e+01 2 67 66 1.256637e-01 1.256637e-01 2.208719e-15 + 1.125000e+03 2.250000e+01 2 67 67 1.256637e-01 1.256637e-01 -3.975693e-15 + 1.147500e+03 2.250000e+01 2 68 67 1.256637e-01 1.256637e-01 2.208719e-16 + 1.170000e+03 2.250000e+01 2 68 68 1.256637e-01 1.256637e-01 2.650462e-15 + 1.192500e+03 2.250000e+01 2 69 68 1.256637e-01 1.256637e-01 -4.417437e-16 + 1.215000e+03 2.250000e+01 2 69 69 1.256637e-01 1.256637e-01 -2.871334e-15 + 1.237500e+03 2.250000e+01 2 70 69 1.256637e-01 1.256637e-01 2.650462e-15 + 1.260000e+03 2.250000e+01 2 70 70 1.256637e-01 1.256637e-01 -1.546103e-15 + 1.282500e+03 2.250000e+01 2 71 70 1.256637e-01 1.256637e-01 -6.626156e-16 + 1.305000e+03 2.250000e+01 2 71 71 1.256637e-01 1.256637e-01 2.429590e-15 + 1.327500e+03 2.250000e+01 2 72 71 1.256637e-01 1.256637e-01 2.429590e-15 + 1.350000e+03 2.250000e+01 2 72 72 1.256637e-01 1.256637e-01 -5.300924e-15 + 1.372500e+03 2.250000e+01 2 73 72 1.256637e-01 1.256637e-01 6.626156e-16 + 1.395000e+03 2.250000e+01 2 73 73 1.256637e-01 1.256637e-01 1.987847e-15 + 1.417500e+03 2.250000e+01 2 74 73 1.256637e-01 1.256637e-01 -2.429590e-15 + 1.440000e+03 2.250000e+01 2 74 74 1.256637e-01 1.256637e-01 3.754821e-15 + 1.462500e+03 2.250000e+01 2 75 74 1.256637e-01 1.256637e-01 1.987847e-15 + 1.485000e+03 2.250000e+01 2 75 75 1.256637e-01 1.256637e-01 -2.208719e-16 + 1.507500e+03 2.250000e+01 2 76 75 1.256637e-01 1.256637e-01 -6.626156e-15 + 1.530000e+03 2.250000e+01 2 76 76 1.256637e-01 1.256637e-01 3.533950e-15 + 1.552500e+03 2.250000e+01 2 77 76 1.256637e-01 1.256637e-01 2.429590e-15 + 1.575000e+03 2.250000e+01 2 77 77 1.256637e-01 1.256637e-01 2.208719e-16 + 1.597500e+03 2.250000e+01 2 78 77 1.256637e-01 1.256637e-01 -1.987847e-15 + 1.620000e+03 2.250000e+01 2 78 78 1.256637e-01 1.256637e-01 0.000000e+00 + 1.642500e+03 2.250000e+01 2 79 78 1.256637e-01 1.256637e-01 -1.104359e-15 + 1.665000e+03 2.250000e+01 2 80 79 1.256637e-01 1.256637e-01 4.417437e-16 + 1.687500e+03 2.250000e+01 2 80 80 1.256637e-01 1.256637e-01 1.325231e-15 + 1.710000e+03 2.250000e+01 2 81 80 1.256637e-01 1.256637e-01 1.546103e-15 + 1.732500e+03 2.250000e+01 2 82 81 1.256637e-01 1.256637e-01 -2.429590e-15 + 1.755000e+03 2.250000e+01 2 82 82 1.256637e-01 1.256637e-01 2.871334e-15 + 1.777500e+03 2.250000e+01 2 83 82 1.256637e-01 1.256637e-01 -8.834874e-16 + 1.800000e+03 2.250000e+01 2 84 83 1.256637e-01 1.256637e-01 2.208719e-15 + 1.822500e+03 2.250000e+01 2 84 84 1.256637e-01 1.256637e-01 -4.417437e-15 + 1.845000e+03 2.250000e+01 2 85 84 1.256637e-01 1.256637e-01 1.987847e-15 + 1.867500e+03 2.250000e+01 2 86 85 1.256637e-01 1.256637e-01 -2.871334e-15 + 1.890000e+03 2.250000e+01 2 87 86 1.256637e-01 1.256637e-01 0.000000e+00 + 1.912500e+03 2.250000e+01 2 87 87 1.256637e-01 1.256637e-01 2.650462e-15 + 1.935000e+03 2.250000e+01 2 88 87 1.256637e-01 1.256637e-01 3.092206e-15 + 1.957500e+03 2.250000e+01 2 89 88 1.256637e-01 1.256637e-01 -1.546103e-15 + 1.980000e+03 2.250000e+01 2 89 89 1.256637e-01 1.256637e-01 3.798996e-14 + 2.002500e+03 2.250000e+01 2 90 89 1.256637e-01 1.256637e-01 1.201543e-13 + 2.025000e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 3.361670e-13 + 2.047500e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 7.776898e-13 + 2.070000e+03 2.250000e+01 1 91 90 1.256637e-01 1.256637e-01 1.454220e-12 + 2.092500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 2.226388e-12 + 2.115000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 2.981549e-12 + 2.137500e+03 2.250000e+01 1 92 91 1.256637e-01 1.256637e-01 3.563767e-12 + 2.160000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 3.906560e-12 + 2.182500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.043280e-12 + 2.205000e+03 2.250000e+01 1 93 92 1.256637e-01 1.256637e-01 3.997560e-12 + 2.227500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 3.827488e-12 + 2.250000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 3.559129e-12 + 2.272500e+03 2.250000e+01 1 94 93 1.256637e-01 1.256637e-01 3.277959e-12 + 2.295000e+03 2.250000e+01 1 94 94 1.256637e-01 1.256637e-01 2.964321e-12 + 2.317500e+03 2.250000e+01 1 94 94 1.256637e-01 1.256637e-01 2.657530e-12 + 2.340000e+03 2.250000e+01 1 94 94 1.256637e-01 1.256637e-01 2.377906e-12 + 2.362500e+03 2.250000e+01 1 94 94 1.256637e-01 1.256637e-01 2.121695e-12 + 2.385000e+03 2.250000e+01 1 95 94 1.256637e-01 1.256637e-01 1.889780e-12 + 2.407500e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.690332e-12 + 2.430000e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.511205e-12 + 2.452500e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.368743e-12 + 2.475000e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.234011e-12 + 2.497500e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.129980e-12 + 2.520000e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.038539e-12 + 2.542500e+03 2.250000e+01 1 96 95 1.256637e-01 1.256637e-01 9.621178e-13 + 2.565000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 8.967397e-13 + 2.587500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 8.432887e-13 + 2.610000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 8.006605e-13 + 2.632500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 7.673088e-13 + 2.655000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 7.388163e-13 + 2.677500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 7.134161e-13 + 2.700000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.913289e-13 + 2.722500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.796227e-13 + 2.745000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.544433e-13 + 2.767500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.573146e-13 + 2.790000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.330187e-13 + 2.812500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.323561e-13 + 2.835000e+03 2.250000e+01 1 97 96 1.256637e-01 1.256637e-01 6.208708e-13 + 2.857500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 6.115942e-13 + 2.880000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 6.065141e-13 + 2.902500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.979001e-13 + 2.925000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.925992e-13 + 2.947500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.806721e-13 + 2.970000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.744877e-13 + 2.992500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.627815e-13 + 3.015000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.588058e-13 + 3.037500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.495292e-13 + 3.060000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.389273e-13 + 3.082500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.345099e-13 + 3.105000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.236872e-13 + 3.127500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.168401e-13 + 3.150000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.097722e-13 + 3.172500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.885685e-13 + 3.195000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.974034e-13 + 3.217500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.810589e-13 + 3.240000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.803963e-13 + 3.262500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.682483e-13 + 3.285000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.605178e-13 + 3.307500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.647144e-13 + 3.330000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.439524e-13 + 3.352500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.488116e-13 + 3.375000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.373263e-13 + 3.397500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.368845e-13 + 3.420000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.260618e-13 + 3.442500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.227487e-13 + 3.465000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.223070e-13 + 3.487500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.174478e-13 + 3.510000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.097173e-13 + 3.532500e+03 2.250000e+01 1 98 97 1.256637e-01 1.256637e-01 4.064042e-13 + 3.555000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 4.136930e-13 + 3.577500e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.966858e-13 + 3.600000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 4.066251e-13 + 3.622500e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.982320e-13 + 3.645000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.988946e-13 + 3.667500e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.913849e-13 + 3.690000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.865257e-13 + 3.712500e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.885136e-13 + 3.735000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.860840e-13 From c60e520cb3dd948f06d30a565586d5c9b558ddc9 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Wed, 26 Feb 2025 17:33:17 -0700 Subject: [PATCH 16/38] fixed a bug in CI routine coagulation.py --- tst/scripts/coagulation/coagulation.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tst/scripts/coagulation/coagulation.py b/tst/scripts/coagulation/coagulation.py index 324f0797..51291b74 100644 --- a/tst/scripts/coagulation/coagulation.py +++ b/tst/scripts/coagulation/coagulation.py @@ -61,14 +61,13 @@ def analyze(): unpack=True, ) - data_ref = np.array([dat_sden[2:5, :], dat_den[2:5, :]]) + data_ref = np.hstack([dat_sden[2:5, :], dat_den[2:5, :]]) fname = os.path.join(artemis.get_data_dir(), _file_id + "_info.dat") - data = np.loadtxt( + data_tst = np.loadtxt( fname, unpack=True, ) - data_tst = data[2:5, :].reshape([len(_surfden), 3, data_ref.shape[-1]]) errs = data_ref - data_tst errors = np.array(errs).ravel() From 6fec291927d622e7e782b8beb3145e2bf4df38ca Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Thu, 27 Feb 2025 07:57:48 -0700 Subject: [PATCH 17/38] fixed a bug in coagulation.py --- tst/scripts/coagulation/coagulation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tst/scripts/coagulation/coagulation.py b/tst/scripts/coagulation/coagulation.py index 51291b74..eaa16a01 100644 --- a/tst/scripts/coagulation/coagulation.py +++ b/tst/scripts/coagulation/coagulation.py @@ -69,7 +69,7 @@ def analyze(): unpack=True, ) - errs = data_ref - data_tst + errs = data_ref - data_tst[2:5, :] errors = np.array(errs).ravel() fail = np.any(errors > 0) return not fail From 7dbe6b66f2691825a52ce9fdc9d7a69e78f8edee Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Thu, 27 Feb 2025 14:16:07 -0700 Subject: [PATCH 18/38] using develop branch submodule --- .gitmodules | 2 ++ external/jaybenne | 2 +- external/parthenon | 2 +- external/rebound | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index fd85689b..d1858b90 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,7 @@ [submodule "external/singularity-eos"] path = external/singularity-eos url = https://github.com/lanl/singularity-eos.git + branch = develop [submodule "external/rebound"] path = external/rebound url = https://github.com/hannorein/rebound @@ -13,3 +14,4 @@ [submodule "external/jaybenne"] path = external/jaybenne url = https://github.com/lanl/jaybenne.git + branch = develop diff --git a/external/jaybenne b/external/jaybenne index cba65c76..04947dfa 160000 --- a/external/jaybenne +++ b/external/jaybenne @@ -1 +1 @@ -Subproject commit cba65c76535f1cfd5a06fe0d737246ed3b6a5114 +Subproject commit 04947dfa359c77caac32dd72a115dff2c009f1b7 diff --git a/external/parthenon b/external/parthenon index b5594528..14363c96 160000 --- a/external/parthenon +++ b/external/parthenon @@ -1 +1 @@ -Subproject commit b5594528e31cbcb3bd5d2aaa0f944d36d10b2c8f +Subproject commit 14363c9672e9eb7120aafb1cd8ed554ff666d695 diff --git a/external/rebound b/external/rebound index 4cabad08..69b93d06 160000 --- a/external/rebound +++ b/external/rebound @@ -1 +1 @@ -Subproject commit 4cabad08374c46a96f2d2bdfdf3c6569cfb3de6b +Subproject commit 69b93d065d5e93b04afd085a739165fa8c09c1a4 From 6a7faa709205be94fded59acbb2a8102082635a4 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Thu, 27 Feb 2025 14:49:21 -0700 Subject: [PATCH 19/38] modified .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index d1858b90..b2e9222e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,10 +1,10 @@ [submodule "external/parthenon"] path = external/parthenon url = https://github.com/parthenon-hpc-lab/parthenon.git + branch = develop [submodule "external/singularity-eos"] path = external/singularity-eos url = https://github.com/lanl/singularity-eos.git - branch = develop [submodule "external/rebound"] path = external/rebound url = https://github.com/hannorein/rebound From 0f99bfbb90c6bc622a6aac851f14eb8c9fef2fa3 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Thu, 27 Feb 2025 15:16:12 -0700 Subject: [PATCH 20/38] change the submodules --- .gitmodules | 2 -- external/jaybenne | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index b2e9222e..fd85689b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,6 @@ [submodule "external/parthenon"] path = external/parthenon url = https://github.com/parthenon-hpc-lab/parthenon.git - branch = develop [submodule "external/singularity-eos"] path = external/singularity-eos url = https://github.com/lanl/singularity-eos.git @@ -14,4 +13,3 @@ [submodule "external/jaybenne"] path = external/jaybenne url = https://github.com/lanl/jaybenne.git - branch = develop diff --git a/external/jaybenne b/external/jaybenne index 04947dfa..8a2fd666 160000 --- a/external/jaybenne +++ b/external/jaybenne @@ -1 +1 @@ -Subproject commit 04947dfa359c77caac32dd72a115dff2c009f1b7 +Subproject commit 8a2fd6665dc210c74896985dcfe638b1264c1b16 From 0b53da66b23e6768c0c5fbf026cb05fc577f4b67 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Thu, 27 Feb 2025 15:57:31 -0700 Subject: [PATCH 21/38] using old commit of parthenon 9b045ae --- external/parthenon | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/parthenon b/external/parthenon index 14363c96..9b045aec 160000 --- a/external/parthenon +++ b/external/parthenon @@ -1 +1 @@ -Subproject commit 14363c9672e9eb7120aafb1cd8ed554ff666d695 +Subproject commit 9b045aec7ed88be4aab1337ed0a9839f50974a3c From f5f20d1102e7cb9ae7c0a959f8c45438a8c794a4 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 4 Mar 2025 11:03:41 -0700 Subject: [PATCH 22/38] update submodule to be consistent with develop branch --- external/singularity-eos | 2 +- external/singularity-opac | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/singularity-eos b/external/singularity-eos index f7df74f9..3f78b830 160000 --- a/external/singularity-eos +++ b/external/singularity-eos @@ -1 +1 @@ -Subproject commit f7df74f90d53e97d048cd230eec1d6203d7c37d2 +Subproject commit 3f78b8306701c8265eb54e4572a3d382a7a727e4 diff --git a/external/singularity-opac b/external/singularity-opac index de8c6523..b05c6e12 160000 --- a/external/singularity-opac +++ b/external/singularity-opac @@ -1 +1 @@ -Subproject commit de8c6523d04a5ab923550d7b5d374e699729e0b1 +Subproject commit b05c6e12f003edae4cea38f6aa279c395aa11098 From fb760a6efa32cd421b29cc395f460bf20efd3641 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Mon, 30 Jun 2025 11:23:14 -0600 Subject: [PATCH 23/38] move rho0 factor from units/mass to problem session --- inputs/dust/dust_coagulation.in | 129 ++++++++++++------------ inputs/dust/dust_coagulation_den.in | 133 +++++++++++++------------ src/dust/coagulation/coagulation.cpp | 6 ++ src/dust/coagulation/coagulation.hpp | 7 ++ src/dust/dust.cpp | 6 +- src/pgen/dust_coagulation.hpp | 12 ++- src/utils/units.cpp | 2 +- tst/scripts/coagulation/coagulation.py | 8 +- 8 files changed, 159 insertions(+), 144 deletions(-) diff --git a/inputs/dust/dust_coagulation.in b/inputs/dust/dust_coagulation.in index 9e3adca9..718ea098 100644 --- a/inputs/dust/dust_coagulation.in +++ b/inputs/dust/dust_coagulation.in @@ -12,99 +12,100 @@ # ======================================================================================== -problem = dust_coagulation # name of the pgen -coordinates = cartesian # coordinate system -length = 1.495978707e14 # 10AU in cgs unit -mass = 3.976832e+28 # 2e-5*M_sun in cgs unit -time = 158718203.29271033 # cgs unit in year/(2*pi)/(r0**3/mstar)**0.5 -temperature = 24753.531 # kevin (vel**2/kb*mu*mp) -physical_units = cgs # +problem = dust_coagulation # name of the pgen +coordinates = cartesian # coordinate system +length = 1.495978707e14 # 10AU in cgs unit +mass = 1.988416e33 # central-star mass (M_sun) in cgs unit +time = 158718203.29271033 # cgs unit in year/(2*pi)*(r0**3/mstar)**0.5 +temperature = 24753.531 # kevin (vel**2/kb*mu*mp) +physical_units = cgs # -problem_id = coag # problem ID: basename of output filenames +problem_id = coag # problem ID: basename of output filenames -file_type = hst -dt = 0.628 +file_type = hst +dt = 0.628 -variables = gas.prim.density, & - dust.prim.density -file_type = hdf5 # tab data dump -dt = 62.8 # time increment between outputs +variables = gas.prim.density, dust.prim.density +file_type = hdf5 # hdf5 data dump +dt = 62.8 # time increment between outputs -file_type = rst -dt = 628 +file_type = rst +dt = 628 -nlim = -1 # cycle limit -tlim = 3768. # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 10 # interval for stdout summary info +nlim = -1 # cycle limit +tlim = 3768. # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 10 # interval for stdout summary info -nghost = 2 -refinement = none - -nx1 = 16 # Number of zones in X1-direction -x1min = 9.0 # minimum value of X1 -x1max = 11.0 # maximum value of X1 -ix1_bc = outflow # Inner-X1 boundary condition flag -ox1_bc = outflow # Outer-X1 boundary condition flag - -nx2 = 1 # Number of zones in X2-direction -x2min = 0.0 # minimum value of X2 -x2max = 6.283185307179586 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag +nghost = 2 +refinement = none + +nx1 = 16 # Number of zones in X1-direction +x1min = 9.0 # minimum value of X1 +x1max = 11.0 # maximum value of X1 +ix1_bc = outflow # Inner-X1 boundary condition flag +ox1_bc = outflow # Outer-X1 boundary condition flag + +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 +x2max = 6.283185307179586 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir -gas = true -dust = true -coagulation = true +gas = true +dust = true +coagulation = true -cfl = 0.9 # gas cfl number -gamma = 1.00001 # adiabatic index -iso_sound_speed = 0.05 # code unit -mu = 2.3 # mean molecular weight +cfl = 0.9 # gas cfl number +gamma = 1.00001 # adiabatic index +mu = 2.3 # mean molecular weight -cfl = 0.9 # dust cfl number -nspecies = 121 # number of dust size -size_input = logspace # dust size distribution +cfl = 0.9 # dust cfl number +dfloor = 2e-25 # floor(1e-20)*rho0 +nspecies = 121 # number of dust size +size_input = logspace # dust size distribution -scr_level = 1 # for reconstruction +scr_level = 1 # for reconstruction -surface_density_flag = true # surface or volume density -grain_density = 1.25 # dust internal density g/cc -min_size = 1e-5 #cm -max_size = 10.0 #cm +surface_density_flag = true # surface or volume density +grain_density = 1.25 # dust internal density g/cc +min_size = 1e-5 #cm +max_size = 10.0 #cm -vfrag = 1000.0 #cm/s -coag_int = 1 +vfrag = 1000.0 #cm/s +coag_int = 1 coag_use_adaptiveStep = false coag_mom_preserve = false coag_info_out = true -nInit_dust = 11 # number of dust species initially -dust_to_gas = 0.01 # init dust-to-gas ratio -nstep1Coag = 10 # number of steps for one coagulation call -const_coag_omega = true # using omega at r0_length +h0 = 0.05 # scaled height at r0 +rho0 = 2e-5 # sigma_0 +nInit_dust = 11 # number of dust species initially +dust_to_gas = 0.01 # init dust-to-gas ratio +nstep1Coag = 10 # number of steps for one coagulation call +const_coag_omega = true # using omega at r0_length diff --git a/inputs/dust/dust_coagulation_den.in b/inputs/dust/dust_coagulation_den.in index 4e31addb..6592e4fe 100644 --- a/inputs/dust/dust_coagulation_den.in +++ b/inputs/dust/dust_coagulation_den.in @@ -12,99 +12,100 @@ # ======================================================================================== -problem = dust_coagulation # name of the pgen -coordinates = cartesian # coordinate system -length = 1.495978707e14 # 10AU in cgs unit -mass = 3.17305460032e+29 # 1.59577e-4*M_sun in cgs unit -time = 158718203.29271033 # cgs unit in year/(2*pi)/(r0**3/mstar)**0.5 -temperature = 24753.531 # kevin (vel**2/kb*mu*mp) -physical_units = cgs # +problem = dust_coagulation # name of the pgen +coordinates = cartesian # coordinate system +length = 1.495978707e14 # 10AU in cgs unit +mass = 1.988416e33 # central-star mass (M_sun) in cgs unit +time = 158718203.29271033 # cgs unit in year/(2*pi)*(r0**3/mstar)**0.5 +temperature = 24753.531 # kevin (vel**2/kb*mu*mp) +physical_units = cgs # + -problem_id = coag # problem ID: basename of output filenames +problem_id = coag # problem ID: basename of output filenames -file_type = hst -dt = 0.628 +file_type = hst +dt = 0.628 -variables = gas.prim.density, & - dust.prim.density -file_type = hdf5 # tab data dump -dt = 62.8 # time increment between outputs +variables = gas.prim.density, dust.prim.density +file_type = hdf5 # hdf5 data dump +dt = 62.8 # time increment between outputs -file_type = rst -dt = 628 +file_type = rst +dt = 628 -nlim = -1 # cycle limit -tlim = 3768. # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 1 # interval for stdout summary info +nlim = -1 # cycle limit +tlim = 3768. # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 10 # interval for stdout summary info -nghost = 2 -refinement = none - -nx1 = 16 # Number of zones in X1-direction -x1min = 9.0 # minimum value of X1 -x1max = 11.0 # maximum value of X1 -ix1_bc = outflow # Inner-X1 boundary condition flag -ox1_bc = outflow # Outer-X1 boundary condition flag - -nx2 = 1 # Number of zones in X2-direction -x2min = 0.0 # minimum value of X2 -x2max = 6.283185307179586 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag +nghost = 2 +refinement = none + +nx1 = 16 # Number of zones in X1-direction +x1min = 9.0 # minimum value of X1 +x1max = 11.0 # maximum value of X1 +ix1_bc = outflow # Inner-X1 boundary condition flag +ox1_bc = outflow # Outer-X1 boundary condition flag + +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 +x2max = 6.283185307179586 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir -gas = true -dust = true -coagulation = true +gas = true +dust = true +coagulation = true -cfl = 0.9 # gas cfl number -gamma = 1.00001 # adiabatic index -iso_sound_speed = 0.05 # code unit -mu = 2.3 # mean molecular weight - +cfl = 0.9 # gas cfl number +gamma = 1.00001 # adiabatic index +mu = 2.3 # mean molecular weight - -cfl = 0.9 # dust cfl number -nspecies = 121 # number of dust size -size_input = logspace # dust size distribution + +cfl = 0.9 # dust cfl number +dfloor = 1.59577e-24 # density floor=1e-20*rho0 +nspecies = 121 # number of dust size +size_input = logspace # dust size distribution -scr_level = 1 # for reconstruction +scr_level = 1 # for reconstruction -surface_density_flag = false # surface or volume density -grain_density = 1.25 # dust internal density g/cc -min_size = 1e-5 #cm -max_size = 10.0 #cm +surface_density_flag = false # surface or volume density +grain_density = 1.25 # dust internal density g/cc +min_size = 1e-5 #cm +max_size = 10.0 #cm -vfrag = 1000.0 #cm/s -coag_int = 1 +vfrag = 1000.0 #cm/s +coag_int = 1 coag_use_adaptiveStep = false coag_mom_preserve = false coag_info_out = true -nInit_dust = 11 # number of dust species initially -dust_to_gas = 0.01 # init dust-to-gas ratio -nstep1Coag = 10 # number of steps for one coagulation call -const_coag_omega = true # using omega at r0_length +h0 = 0.05 # scaled height at r0 +rho0 = 1.59577e-4 # rh0 = sigma_0/sqrt(2*pi)/h0 +nInit_dust = 11 # number of dust species initially +dust_to_gas = 0.01 # init dust-to-gas ratio +nstep1Coag = 10 # number of steps for one coagulation call +const_coag_omega = true # using omega at r0_length diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index e72cd0a0..2b95d986 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -10,6 +10,12 @@ // license in this material to reproduce, prepare derivative works, distribute copies to // the public, perform publicly and display publicly, and to permit others to do so. //======================================================================================== +// NOTE(@Shengtai +// The dust coagulation code is modified from public available Dustpy package +// https://github.com/stammler/dustpy +// and from their paper (Stammler and Birnstiel (2022) ApJ 935:35) +// "DustPy: A Python Package for Dust Evolution in Protoplanetary Disks" +//======================================================================================== // Artemis includes #include "dust/coagulation/coagulation.hpp" diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index 659d44b1..b46fcc5a 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -10,6 +10,13 @@ // license in this material to reproduce, prepare derivative works, distribute copies to // the public, perform publicly and display publicly, and to permit others to do so. //======================================================================================== +// NOTE(@Shengtai +// The dust coagulation code is modified from public available Dustpy package +// https://github.com/stammler/dustpy +// and from their paper (Stammler and Birnstiel (2022) ApJ 935:35) +// "DustPy: A Python Package for Dust Evolution in Protoplanetary Disks" +//======================================================================================== + #ifndef DUST_COAGULATION_HPP_ #define DUST_COAGULATION_HPP_ diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index ef3cd45d..2c808560 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -90,10 +90,6 @@ std::shared_ptr Initialize(ParameterInput *pin, const Real cfl_number = pin->GetOrAddReal("dust", "cfl", 0.8); params.Add("cfl", cfl_number); - // possible user_dt - const Real user_dt = pin->GetOrAddReal("dust", "user_dt", 1.0e10); - params.Add("user_dt", user_dt); - // Floors const Real dfloor = pin->GetOrAddReal("dust", "dfloor", 1.0e-20); params.Add("dfloor", dfloor); @@ -456,7 +452,7 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt const Real rad = coag.const_omega ? 1.0 : xcyl[0]; // cylindrical - const Real Omega_k = 1.0 / std::sqrt(rad) / rad; + const Real Omega_k = 1.0 / std::sqrt(rad) / rad; // code-unit int nCall1 = 0; diff --git a/src/pgen/dust_coagulation.hpp b/src/pgen/dust_coagulation.hpp index c76dc797..93f5563a 100644 --- a/src/pgen/dust_coagulation.hpp +++ b/src/pgen/dust_coagulation.hpp @@ -51,8 +51,9 @@ struct DustCoagulationVariable { int nDust; int nInit_dust; Real gamma, gm1; - Real iso_cs; + Real h0; Real d2g; + Real rho0; }; } // end anonymous namespace @@ -85,6 +86,7 @@ inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { dcv.nDust = pin->GetOrAddReal("dust", "nspecies", 121); dcv.nInit_dust = pin->GetOrAddReal("problem", "nInit_dust", 1); dcv.d2g = pin->GetOrAddReal("problem", "dust_to_gas", 0.01); + dcv.rho0 = pin->GetOrAddReal("problem", "rho0", 1.0); // using MRN distribution for the initial dust setup ParArray1D dust_size = dust_pkg->template Param>("sizes"); @@ -94,17 +96,17 @@ inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { dcv.gamma = gas_pkg->Param("adiabatic_index"); dcv.gm1 = dcv.gamma - 1.0; - dcv.iso_cs = pin->GetOrAddReal("gas", "iso_sound_speed", 1e-1); + dcv.h0 = pin->GetOrAddReal("problem", "h0", 0.05); - const Real gdens = 1.0; + const Real gdens = dcv.rho0; const auto mu = gas_pkg->Param("mu"); auto &constants = artemis_pkg->Param("constants"); const Real kbmu = constants.GetKBCode() / (mu * constants.GetAMUCode()); - const Real gtemp = SQR(dcv.iso_cs) / kbmu / dcv.gamma; + const Real gtemp = SQR(dcv.h0) / kbmu / dcv.gamma; const Real gsie = eos_d.InternalEnergyFromDensityTemperature(gdens, gtemp); const Real pres = eos_d.PressureFromDensityTemperature(gdens, gtemp); if (pmb->gid == 0) { - std::cout << "gamma,cs,pre=" << dcv.gamma << " " << dcv.iso_cs << " " + std::cout << "gamma,cs,pre=" << dcv.gamma << " " << dcv.h0 << " " << gsie * dcv.gm1 * gdens << " " << pres << std::endl; } diff --git a/src/utils/units.cpp b/src/utils/units.cpp index da9809e1..1d6e7ee3 100644 --- a/src/utils/units.cpp +++ b/src/utils/units.cpp @@ -106,7 +106,7 @@ Constants::Constants(Units &units) { const Real energy = mass * std::pow(length / time, 2); // Convert constants to code units - G_code_ = G_ * std::pow(length, -3) / mass * std::pow(time, 2); + G_code_ = G_ * std::pow(length, -3) * mass * std::pow(time, 2); kb_code_ = kb_ * temp / energy; c_code_ = c_ * time / length; h_code_ = h_ / (energy * time); diff --git a/tst/scripts/coagulation/coagulation.py b/tst/scripts/coagulation/coagulation.py index eaa16a01..1d107967 100644 --- a/tst/scripts/coagulation/coagulation.py +++ b/tst/scripts/coagulation/coagulation.py @@ -25,7 +25,8 @@ _nranks = 1 _file_id = "coag" -_massunit = ["3.976832e28", "3.17305460032e29"] +_rho0 = ["2e-5", "1.59577e-4"] +_dfloor = ["2e-25", "1.59577e-24"] _surfden = ["true", "false"] _tlim = 3768.0 @@ -33,12 +34,13 @@ # Run Artemis def run(**kwargs): logger.debug("Runnning test " + __name__) - for ii, im in enumerate(_massunit): + for ii, im in enumerate(_rho0): arguments = [ - "artemis/mass=" + im, "parthenon/job/problem_id=" + _file_id, "parthenon/time/tlim={:.8f}".format(_tlim), "dust/surface_density_flag=" + _surfden[ii], + "dust/dfloor=" + _dfloor[ii], + "problem/rho0=" + im, ] artemis.run(_nranks, "dust/dust_coagulation.in", arguments) From d99ae9c2ddeb0fbccb76de7fdf4a9e24f53ed2aa Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Mon, 30 Jun 2025 12:05:45 -0600 Subject: [PATCH 24/38] merge with origin/develop --- external/jaybenne | 2 +- external/parthenon | 2 +- src/artemis_driver.cpp | 3 +-- src/artemis_driver.hpp | 12 +----------- src/utils/artemis_utils.hpp | 1 - 5 files changed, 4 insertions(+), 16 deletions(-) diff --git a/external/jaybenne b/external/jaybenne index 8a2fd666..9bd9e13b 160000 --- a/external/jaybenne +++ b/external/jaybenne @@ -1 +1 @@ -Subproject commit 8a2fd6665dc210c74896985dcfe638b1264c1b16 +Subproject commit 9bd9e13b5bf21e8d70f8c424ba3d9948d9cf99f5 diff --git a/external/parthenon b/external/parthenon index 9b045aec..1144ada6 160000 --- a/external/parthenon +++ b/external/parthenon @@ -1 +1 @@ -Subproject commit 9b045aec7ed88be4aab1337ed0a9839f50974a3c +Subproject commit 1144ada6bba6c2f637aa8a251fc325c1ef82c2f9 diff --git a/src/artemis_driver.cpp b/src/artemis_driver.cpp index cabb937e..b6a5f252 100644 --- a/src/artemis_driver.cpp +++ b/src/artemis_driver.cpp @@ -67,10 +67,9 @@ ArtemisDriver::ArtemisDriver(ParameterInput *pin, ApplicationInput *app_in do_conduction = artemis_pkg->template Param("do_conduction"); do_nbody = artemis_pkg->template Param("do_nbody"); do_diffusion = do_viscosity || do_conduction; - do_radiation = artemis_pkg->template Param("do_radiation"); - do_coagulation = artemis_pkg->template Param("do_coagulation"); do_imc = artemis_pkg->template Param("do_imc"); do_moment = artemis_pkg->template Param("do_moment"); + do_coagulation = artemis_pkg->template Param("do_coagulation"); // Moments integrator if (do_moment) { diff --git a/src/artemis_driver.hpp b/src/artemis_driver.hpp index 2ccfb22a..eda6dcd7 100644 --- a/src/artemis_driver.hpp +++ b/src/artemis_driver.hpp @@ -52,25 +52,15 @@ class ArtemisDriver : public EvolutionDriver { protected: IntegratorPtr_t integrator, nbody_integrator, rad_integrator; StateDescriptor *artemis_pkg; -<<<<<<< HEAD - bool do_gas, do_dust, do_gravity, do_rotating_frame, do_cooling, do_drag, do_viscosity, - do_nbody, do_conduction, do_diffusion, do_radiation, do_coagulation; - const bool is_restart; -}; - -// using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, const Real time, const Real -// dt); -======= bool do_gas, do_dust, do_moment, do_imc; bool do_gravity, do_nbody, do_rotating_frame, do_shear; - bool do_cooling, do_drag, do_viscosity, do_conduction, do_diffusion; + bool do_cooling, do_drag, do_viscosity, do_conduction, do_diffusion, do_coagulation; const bool is_restart; }; //---------------------------------------------------------------------------------------- using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, const Real time, const Real dt); ->>>>>>> origin/develop Packages_t ProcessPackages(std::unique_ptr &pin); } // namespace artemis diff --git a/src/utils/artemis_utils.hpp b/src/utils/artemis_utils.hpp index 770a8337..05027274 100644 --- a/src/utils/artemis_utils.hpp +++ b/src/utils/artemis_utils.hpp @@ -269,7 +269,6 @@ Real CutCell2D(const std::array &x, const std::array &y, vol_inside += ((clipi + clipj) <= 1) * contrib(x1, y1, x2, y2); } return vol_inside / vol; ->>>>>>> origin/develop } } // namespace ArtemisUtils From 6d6393f032c5212637cbc93e0bb6739b512622b6 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Mon, 30 Jun 2025 17:24:24 -0600 Subject: [PATCH 25/38] rewrite to dust size conversion --- external/singularity-eos | 2 +- external/singularity-opac | 2 +- src/dust/coagulation/coagulation.cpp | 13 +++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/external/singularity-eos b/external/singularity-eos index 3f78b830..bef20b27 160000 --- a/external/singularity-eos +++ b/external/singularity-eos @@ -1 +1 @@ -Subproject commit 3f78b8306701c8265eb54e4572a3d382a7a727e4 +Subproject commit bef20b27935b563aee5e63096fc141e44accf3a5 diff --git a/external/singularity-opac b/external/singularity-opac index b05c6e12..dbea3a1b 160000 --- a/external/singularity-opac +++ b/external/singularity-opac @@ -1 +1 @@ -Subproject commit b05c6e12f003edae4cea38f6aa279c395aa11098 +Subproject commit dbea3a1bcbda6fbdf37fbfe1743dcc552186f640 diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index 2b95d986..91b3307b 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -95,16 +95,17 @@ std::shared_ptr Initialize(ParameterInput *pin, Params &dustPar } ParArray1D dust_size("dsize", nm); - auto h_sizes = dust_size.GetHostMirror(); - auto hsizes = dustPars.template Get>("h_sizes"); // convert back to CGS unit const Real length0 = units.GetLengthCodeToPhysical(); - for (int i = 0; i < nm; i++) { - h_sizes(i) = hsizes(i) * length0; - } - dust_size.DeepCopy(h_sizes); + // using device + auto sizes = dustPars.template Get>("sizes"); + parthenon::par_for( + parthenon::loop_pattern_flatrange_tag, "code2phys", parthenon::DevExecSpace(), 0, + nm - 1, KOKKOS_LAMBDA(const int i) { dust_size(i) = sizes(i) * length0; }); + + auto h_sizes = dust_size.GetHostMirrorAndCopy(); const Real cond = 3.0 / (1.0 - nm) * std::log(h_sizes(0) / h_sizes(nm - 1)); if (std::exp(cond) > std::sqrt(2.0)) { From 0626fe5f1168d1d7eca3509b086e4ecf1bc6f9a0 Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 1 Jul 2025 10:05:06 -0600 Subject: [PATCH 26/38] replace external with develop/external --- external | 1 + external/jaybenne | 1 - external/parthenon | 1 - external/rebound | 1 - external/singularity-eos | 1 - external/singularity-opac | 1 - src/artemis.cpp | 14 ++------------ src/artemis.hpp | 3 +-- src/artemis_driver.hpp | 1 - src/dust/dust.cpp | 6 ++---- 10 files changed, 6 insertions(+), 24 deletions(-) create mode 120000 external delete mode 160000 external/jaybenne delete mode 160000 external/parthenon delete mode 160000 external/rebound delete mode 160000 external/singularity-eos delete mode 160000 external/singularity-opac diff --git a/external b/external new file mode 120000 index 00000000..233d91ff --- /dev/null +++ b/external @@ -0,0 +1 @@ +../artemis_dev/external/ \ No newline at end of file diff --git a/external/jaybenne b/external/jaybenne deleted file mode 160000 index 9bd9e13b..00000000 --- a/external/jaybenne +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9bd9e13b5bf21e8d70f8c424ba3d9948d9cf99f5 diff --git a/external/parthenon b/external/parthenon deleted file mode 160000 index 1144ada6..00000000 --- a/external/parthenon +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 1144ada6bba6c2f637aa8a251fc325c1ef82c2f9 diff --git a/external/rebound b/external/rebound deleted file mode 160000 index 69b93d06..00000000 --- a/external/rebound +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 69b93d065d5e93b04afd085a739165fa8c09c1a4 diff --git a/external/singularity-eos b/external/singularity-eos deleted file mode 160000 index bef20b27..00000000 --- a/external/singularity-eos +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bef20b27935b563aee5e63096fc141e44accf3a5 diff --git a/external/singularity-opac b/external/singularity-opac deleted file mode 160000 index dbea3a1b..00000000 --- a/external/singularity-opac +++ /dev/null @@ -1 +0,0 @@ -Subproject commit dbea3a1bcbda6fbdf37fbfe1743dcc552186f640 diff --git a/src/artemis.cpp b/src/artemis.cpp index 833b8715..af77e3c7 100644 --- a/src/artemis.cpp +++ b/src/artemis.cpp @@ -34,8 +34,6 @@ namespace artemis { -std::vector OperatorSplitTasks; - //---------------------------------------------------------------------------------------- //! \fn Packages_t Artemis::ProcessPackages //! \brief Process and initialize relevant packages @@ -99,6 +97,8 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { "Radiation requires the gas package, but there is not gas!"); PARTHENON_REQUIRE(!(do_imc && do_moment), "Cannot simultaneously evolve IMC and moments radiation"); + PARTHENON_REQUIRE(!(do_coagulation) || (do_coagulation && do_dust), + "Coagulation requires the dust package, but there is not dust!"); // Store configuration choices in params artemis->AddParam("do_gas", do_gas); @@ -113,16 +113,6 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { artemis->AddParam("do_diffusion", do_conduction || do_viscosity); artemis->AddParam("do_radiation", do_radiation); artemis->AddParam("do_coagulation", do_coagulation); - PARTHENON_REQUIRE(!(do_cooling) || (do_cooling && do_gas), - "Cooling requires the gas package, but there is not gas!"); - PARTHENON_REQUIRE(!(do_viscosity) || (do_viscosity && do_gas), - "Viscosity requires the gas package, but there is not gas!"); - PARTHENON_REQUIRE(!(do_conduction) || (do_conduction && do_gas), - "Conduction requires the gas package, but there is not gas!"); - PARTHENON_REQUIRE(!(do_radiation) || (do_radiation && do_gas), - "Radiation requires the gas package, but there is not gas!"); - PARTHENON_REQUIRE(!(do_coagulation) || (do_coagulation && do_dust), - "Coagulation requires the dust package, but there is not dust!"); artemis->AddParam("do_imc", do_imc); artemis->AddParam("do_moment", do_moment); artemis->AddParam("do_shear", do_shear); diff --git a/src/artemis.hpp b/src/artemis.hpp index f2beb6ed..df0105d6 100644 --- a/src/artemis.hpp +++ b/src/artemis.hpp @@ -95,7 +95,7 @@ using BYTE = char; #endif // TaskCollection function pointer for operator split tasks -using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, parthenon::SimTime &tm); +using TaskCollectionFnPtr = TaskCollection (*)(Mesh *pm, const Real time, const Real dt); // Constants that enumerate... // ...Coordinate systems @@ -181,7 +181,6 @@ inline int ProblemDimension(parthenon::ParameterInput *pin) { // Custom AMR criteria namespace artemis { extern std::function *mbd)> ProblemCheckRefinementBlock; -// extern std::vector OperatorSplitTasks; } // namespace artemis #endif // ARTEMIS_ARTEMIS_HPP_ diff --git a/src/artemis_driver.hpp b/src/artemis_driver.hpp index eda6dcd7..033f9a43 100644 --- a/src/artemis_driver.hpp +++ b/src/artemis_driver.hpp @@ -52,7 +52,6 @@ class ArtemisDriver : public EvolutionDriver { protected: IntegratorPtr_t integrator, nbody_integrator, rad_integrator; StateDescriptor *artemis_pkg; - bool do_gas, do_dust, do_moment, do_imc; bool do_gravity, do_nbody, do_rotating_frame, do_shear; bool do_cooling, do_drag, do_viscosity, do_conduction, do_diffusion, do_coagulation; diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index 29c00df0..c38a298b 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -240,9 +240,6 @@ Real EstimateTimestepMesh(MeshData *md) { auto &dust_pkg = pm->packages.Get("dust"); auto ¶ms = dust_pkg->AllParams(); - auto nspecies = params.template Get("nspecies"); - - const auto cfl_number = params.template Get("cfl"); static auto desc = MakePackDescriptor(resolved_pkgs.get()); auto vmesh = desc.GetPack(md); @@ -270,7 +267,8 @@ Real EstimateTimestepMesh(MeshData *md) { }, Kokkos::Min(min_dt)); - return (cfl_number * min_dt); + const auto cfl_number = params.template Get("cfl"); + return cfl_number * min_dt; } //---------------------------------------------------------------------------------------- From eeabe97fa06b5748a97b6bcd2b4595ff45561cae Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 1 Jul 2025 10:44:24 -0600 Subject: [PATCH 27/38] remove old external --- external | 1 - 1 file changed, 1 deletion(-) delete mode 120000 external diff --git a/external b/external deleted file mode 120000 index 233d91ff..00000000 --- a/external +++ /dev/null @@ -1 +0,0 @@ -../artemis_dev/external/ \ No newline at end of file From bad23a33dafd148a31ebbb0048b72db325e30e3a Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Tue, 1 Jul 2025 12:13:30 -0600 Subject: [PATCH 28/38] updated submodules --- external/jaybenne | 1 + external/parthenon | 1 + external/rebound | 1 + external/singularity-eos | 1 + external/singularity-opac | 1 + 5 files changed, 5 insertions(+) create mode 160000 external/jaybenne create mode 160000 external/parthenon create mode 160000 external/rebound create mode 160000 external/singularity-eos create mode 160000 external/singularity-opac diff --git a/external/jaybenne b/external/jaybenne new file mode 160000 index 00000000..9bd9e13b --- /dev/null +++ b/external/jaybenne @@ -0,0 +1 @@ +Subproject commit 9bd9e13b5bf21e8d70f8c424ba3d9948d9cf99f5 diff --git a/external/parthenon b/external/parthenon new file mode 160000 index 00000000..1144ada6 --- /dev/null +++ b/external/parthenon @@ -0,0 +1 @@ +Subproject commit 1144ada6bba6c2f637aa8a251fc325c1ef82c2f9 diff --git a/external/rebound b/external/rebound new file mode 160000 index 00000000..4cabad08 --- /dev/null +++ b/external/rebound @@ -0,0 +1 @@ +Subproject commit 4cabad08374c46a96f2d2bdfdf3c6569cfb3de6b diff --git a/external/singularity-eos b/external/singularity-eos new file mode 160000 index 00000000..bef20b27 --- /dev/null +++ b/external/singularity-eos @@ -0,0 +1 @@ +Subproject commit bef20b27935b563aee5e63096fc141e44accf3a5 diff --git a/external/singularity-opac b/external/singularity-opac new file mode 160000 index 00000000..dbea3a1b --- /dev/null +++ b/external/singularity-opac @@ -0,0 +1 @@ +Subproject commit dbea3a1bcbda6fbdf37fbfe1743dcc552186f640 From 0e1eab0ecce89251cc6c98959b585850e868858b Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Wed, 20 Aug 2025 11:22:14 -0600 Subject: [PATCH 29/38] fixed a bug in coagulation call in dust.cpp and modified exponential disk parameters --- src/dust/coagulation/coagulation.hpp | 2 +- src/dust/dust.cpp | 4 ++-- src/pgen/disk.hpp | 6 +++++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index b46fcc5a..6846289e 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -23,7 +23,7 @@ #include "utils/artemis_utils.hpp" #include "utils/units.hpp" -//#define COAGULATION_DEBUG +// #define COAGULATION_DEBUG namespace Dust { namespace Coagulation { diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index c38a298b..3092c42c 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -412,7 +412,7 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt MPI_Reduce(MPI_IN_PLACE, &maxSize0, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); MPI_Reduce(MPI_IN_PLACE, &massd0, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); #endif // MPI_PARALLEL - } // end if (info_out_flag) + } // end if (info_out_flag) ArtemisUtils::par_for_outer( DEFAULT_OUTER_LOOP_PATTERN, "Dust::Coagulation", parthenon::DevExecSpace(), @@ -498,7 +498,7 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt vmesh(b, dust::cons::density(n), k, j, i) = rhod1 / rho0; for (int d = 0; d < nvel; d++) { vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = - rhod1 * vel(VI(n, d)) * hx[d] / vel0; + rhod1 / rho0 * vel(VI(n, d)) * hx[d] / vel0; } } else { vmesh(b, dust::cons::density(n), k, j, i) = 0.0; diff --git a/src/pgen/disk.hpp b/src/pgen/disk.hpp index 78e4a826..d5b530ba 100644 --- a/src/pgen/disk.hpp +++ b/src/pgen/disk.hpp @@ -59,6 +59,7 @@ struct DiskParams { Real omf; Real dust_to_gas; Real rexp; + Real exp_power; Real rcav; Real Gamma, gamma_gas; Real alpha, nu0, nu_indx; @@ -78,7 +79,9 @@ Real DenProfile(struct DiskParams pgen, const Real R, const Real z) { const Real r = std::sqrt(R * R + z * z); const Real h = pgen.h0 * std::pow(R / pgen.r0, pgen.flare); const Real sig0 = pgen.rho0; // / (std::sqrt(2.0 * M_PI) * pgen.h0 * pgen.r0); - const Real exp_fac = (pgen.rexp == 0.) ? 1. : std::exp(-SQR(R / pgen.rexp)); + // const Real exp_fac = (pgen.rexp == 0.) ? 1. : std::exp(-SQR(R / pgen.rexp)); + const Real exp_fac = + (pgen.rexp == 0.) ? 1. : std::exp(-std::pow(R / pgen.rexp, pgen.exp_power)); const Real dmid = (sig0 * std::pow(R / pgen.r0, pgen.p)) * (1. - pgen.l0 * std::sqrt(pgen.r0 / R)) * // correction for an inner binary @@ -277,6 +280,7 @@ inline void InitDiskParams(MeshBlock *pmb, ParameterInput *pin) { disk_params.dens_min = pin->GetOrAddReal("problem", "dens_min", 1.0e-20); disk_params.pres_min = pin->GetOrAddReal("problem", "pres_min", 1.0e-24); disk_params.rexp = pin->GetOrAddReal("problem", "rexp", 0.0); + disk_params.exp_power = pin->GetOrAddReal("problem", "exp_power", 2.0); disk_params.rcav = pin->GetOrAddReal("problem", "rcav", 0.0); disk_params.l0 = pin->GetOrAddReal("problem", "l0", 0.0); disk_params.dust_to_gas = pin->GetOrAddReal("problem", "dust_to_gas", 0.01); From c132fd1603871752ad2c0d58d98e396cd374619b Mon Sep 17 00:00:00 2001 From: Shengtai Li Date: Wed, 20 Aug 2025 18:09:10 -0600 Subject: [PATCH 30/38] modified for logr grid --- src/dust/dust.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index 5289732f..a355d26e 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -377,6 +377,9 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt size_t scr_size = ScratchPad1D::shmem_size(isize); auto pmb = md->GetBlockData(0)->GetBlockPointer(); + const auto &cpars = + pm->packages.Get("artemis")->template Param("coord_params"); + ParArray4D nCalls; int maxCalls, maxSize, maxSize0; Real massd0, massd; @@ -398,7 +401,7 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, int &lmax) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + geometry::Coords coords(cpars, vmesh.GetCoordinates(b), k, j, i); for (int n = 0; n < nspecies; ++n) { Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); lsum += dens_d * coords.Volume(); @@ -432,7 +435,7 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); Real dt_sync = dt * time0; - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + geometry::Coords coords(cpars, vmesh.GetCoordinates(b), k, j, i); const auto &hx = coords.GetScaleFactors(); const auto &xv = coords.GetCellCenter(); const auto &xcyl = coords.ConvertToCyl(xv); @@ -523,7 +526,7 @@ TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, int &lmax1, int &lmax2) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + geometry::Coords coords(cpars, vmesh.GetCoordinates(b), k, j, i); const Real vol00 = coords.Volume(); for (int n = 0; n < nspecies; ++n) { Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); From 94fbecc3cd5e03b5769dfa062de493a3082b3e90 Mon Sep 17 00:00:00 2001 From: Patrick Mullen Date: Thu, 21 Aug 2025 16:01:57 -0400 Subject: [PATCH 31/38] Coagulation edits part I --- CMakeLists.txt | 1 + CMakePresets.json | 9 - inputs/dust/dust_coagulation.in | 146 ++-- inputs/dust/dust_coagulation_den.in | 142 ++-- src/CMakeLists.txt | 1 + src/artemis.cpp | 8 +- src/artemis.hpp | 3 + src/artemis_driver.cpp | 4 +- src/dust/coagulation/coagulation.cpp | 518 +++++++------ src/dust/coagulation/coagulation.hpp | 781 ++++++++++++++------ src/dust/coagulation/params.yaml | 8 +- src/dust/dust.cpp | 419 +---------- src/dust/dust.hpp | 7 - src/dust/params.yaml | 6 +- src/pgen/{dust_coagulation.hpp => coag.hpp} | 85 ++- src/pgen/pgen.hpp | 6 +- tst/scripts/coagulation/coag_info_den.dat | 336 ++++----- tst/scripts/coagulation/coag_info_sden.dat | 336 ++++----- tst/scripts/coagulation/coagulation.py | 2 +- 19 files changed, 1398 insertions(+), 1420 deletions(-) rename src/pgen/{dust_coagulation.hpp => coag.hpp} (74%) diff --git a/CMakeLists.txt b/CMakeLists.txt index de3559f4..cc46c5b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -148,6 +148,7 @@ if (NOT TARGET parthenon) set(PARTHENON_ENABLE_INIT_PACKING ON CACHE BOOL "" FORCE) set(PARTHENON_LINT_DEFAULT OFF CACHE BOOL "" FORCE) set(PARTHENON_DISABLE_EXAMPLES ON CACHE BOOL "" FORCE) + set(PARTHENON_DISABLE_HDF5_COMPRESSION "Disable HDF5 compression" ON) set(BUILD_TESTING OFF CACHE BOOL "" FORCE) add_subdirectory(external/parthenon parthenon) else() diff --git a/CMakePresets.json b/CMakePresets.json index 714b9154..ae493a4c 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -34,7 +34,6 @@ "CMAKE_C_COMPILER": "gcc", "CMAKE_CXX_COMPILER": "g++", "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON" } }, { @@ -46,7 +45,6 @@ "CMAKE_CXX_COMPILER": "$env{ARTEMIS_HOME}/external/parthenon/external/Kokkos/bin/nvcc_wrapper", "ARTEMIS_ENABLE_CUDA": "ON", "Kokkos_ARCH_VOLTA70": "ON", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON" } }, { @@ -57,7 +55,6 @@ "CMAKE_CXX_COMPILER": "$env{ARTEMIS_HOME}/external/parthenon/external/Kokkos/bin/nvcc_wrapper", "ARTEMIS_ENABLE_CUDA": "ON", "Kokkos_ARCH_VOLTA70": "ON", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON" } }, { @@ -68,7 +65,6 @@ "Kokkos_ENABLE_DEBUG_BOUNDS_CHECK": "ON", "CMAKE_CXX_COMPILER": "CC", "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON" } }, { @@ -78,7 +74,6 @@ "CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_CXX_COMPILER": "CC", "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON" } }, { @@ -92,7 +87,6 @@ "ARTEMIS_ENABLE_CUDA": "ON", "Kokkos_ARCH_AMPERE80": "ON", "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON", "NUM_GPU_DEVICES_PER_NODE": "4" } }, @@ -106,7 +100,6 @@ "ARTEMIS_ENABLE_CUDA": "ON", "Kokkos_ARCH_AMPERE80": "ON", "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON", "NUM_GPU_DEVICES_PER_NODE": "4" } }, @@ -121,7 +114,6 @@ "ARTEMIS_ENABLE_CUDA": "ON", "Kokkos_ARCH_HOPPER90": "ON", "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON", "NUM_GPU_DEVICES_PER_NODE": "4" } }, @@ -134,7 +126,6 @@ "CMAKE_CXX_COMPILER": "$env{ARTEMIS_HOME}/external/parthenon/external/Kokkos/bin/nvcc_wrapper", "ARTEMIS_ENABLE_CUDA": "ON", "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include", - "PARTHENON_DISABLE_HDF5_COMPRESSION": "ON", "Kokkos_ARCH_HOPPER90": "ON", "NUM_GPU_DEVICES_PER_NODE": "4" } diff --git a/inputs/dust/dust_coagulation.in b/inputs/dust/dust_coagulation.in index 718ea098..21171eda 100644 --- a/inputs/dust/dust_coagulation.in +++ b/inputs/dust/dust_coagulation.in @@ -12,100 +12,96 @@ # ======================================================================================== -problem = dust_coagulation # name of the pgen -coordinates = cartesian # coordinate system -length = 1.495978707e14 # 10AU in cgs unit -mass = 1.988416e33 # central-star mass (M_sun) in cgs unit -time = 158718203.29271033 # cgs unit in year/(2*pi)*(r0**3/mstar)**0.5 -temperature = 24753.531 # kevin (vel**2/kb*mu*mp) -physical_units = cgs # - +problem = coag # name of the pgen +coordinates = cartesian # coordinate system +length = 1.495978707e14 # 10AU in cgs unit +mass = 1.988416e33 # central-star mass (M_sun) in cgs unit +time = 1.5871820329271033e8 # cgs unit in year/(2*pi)*(r0**3/mstar)**0.5 +temperature = 2.4753531e4 # kevin (vel**2/kb*mu*mp) +physical_units = cgs # physical unit system -problem_id = coag # problem ID: basename of output filenames - +problem_id = coag # problem ID: basename of output filenames -file_type = hst -dt = 0.628 +file_type = hst +dt = 0.628 -variables = gas.prim.density, dust.prim.density -file_type = hdf5 # hdf5 data dump -dt = 62.8 # time increment between outputs +variables = gas.prim.density, & + dust.prim.density +file_type = hdf5 # hdf5 data dump +dt = 62.8 # time increment between outputs -file_type = rst -dt = 628 +file_type = rst +dt = 628.0 -nlim = -1 # cycle limit -tlim = 3768. # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 10 # interval for stdout summary info +nlim = -1 # cycle limit +tlim = 3768.0 # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 10 # interval for stdout summary info -nghost = 2 -refinement = none - -nx1 = 16 # Number of zones in X1-direction -x1min = 9.0 # minimum value of X1 -x1max = 11.0 # maximum value of X1 -ix1_bc = outflow # Inner-X1 boundary condition flag -ox1_bc = outflow # Outer-X1 boundary condition flag - -nx2 = 1 # Number of zones in X2-direction -x2min = 0.0 # minimum value of X2 -x2max = 6.283185307179586 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag +nghost = 2 +refinement = none + +nx1 = 16 # Number of zones in X1-direction +x1min = 9.0 # minimum value of X1 +x1max = 11.0 # maximum value of X1 +ix1_bc = outflow # Inner-X1 boundary condition flag +ox1_bc = outflow # Outer-X1 boundary condition flag + +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 +x2max = 6.283185307179586 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir -gas = true -dust = true -coagulation = true +gas = true +dust = true +coagulation = true -cfl = 0.9 # gas cfl number -gamma = 1.00001 # adiabatic index -mu = 2.3 # mean molecular weight - - -cfl = 0.9 # dust cfl number -dfloor = 2e-25 # floor(1e-20)*rho0 -nspecies = 121 # number of dust size -size_input = logspace # dust size distribution - -scr_level = 1 # for reconstruction - -surface_density_flag = true # surface or volume density -grain_density = 1.25 # dust internal density g/cc -min_size = 1e-5 #cm -max_size = 10.0 #cm +cfl = 0.9 # gas cfl number +gamma = 1.00001 # adiabatic index +mu = 2.3 # mean molecular weight + + +cfl = 0.9 # dust cfl number +dfloor = 2.0e-25 # density floor=1e-20*rho0 +nspecies = 121 # number of dust size +size_input = logspace # dust size distribution +scr_level = 1 # for hier. scratch registers +grain_density = 1.25 # dust internal density g/cc +min_size = 1e-5 # cm +max_size = 10.0 # cm -vfrag = 1000.0 #cm/s -coag_int = 1 -coag_use_adaptiveStep = false -coag_mom_preserve = false -coag_info_out = true +vfrag = 1000.0 # cm/s +coag_int = 1 +coag_use_adaptive_step = false +coag_mom_preserve = false +coag_info_out = true +nstep_coag = 10 # number of steps for one coagulation call +const_coag_omega = true # using omega at r0_length +surface_density_flag = true # surface or volume density -h0 = 0.05 # scaled height at r0 -rho0 = 2e-5 # sigma_0 -nInit_dust = 11 # number of dust species initially -dust_to_gas = 0.01 # init dust-to-gas ratio -nstep1Coag = 10 # number of steps for one coagulation call -const_coag_omega = true # using omega at r0_length - +h0 = 0.05 # scaled height at r0 +rho0 = 2.0e-5 # rh0 = sigma_0/sqrt(2*pi)/h0 +ninit_dust = 11 # number of dust species initially +dust_to_gas = 0.01 # init dust-to-gas ratio diff --git a/inputs/dust/dust_coagulation_den.in b/inputs/dust/dust_coagulation_den.in index 6592e4fe..715f8db8 100644 --- a/inputs/dust/dust_coagulation_den.in +++ b/inputs/dust/dust_coagulation_den.in @@ -12,100 +12,96 @@ # ======================================================================================== -problem = dust_coagulation # name of the pgen -coordinates = cartesian # coordinate system -length = 1.495978707e14 # 10AU in cgs unit -mass = 1.988416e33 # central-star mass (M_sun) in cgs unit -time = 158718203.29271033 # cgs unit in year/(2*pi)*(r0**3/mstar)**0.5 -temperature = 24753.531 # kevin (vel**2/kb*mu*mp) -physical_units = cgs # - +problem = coag # name of the pgen +coordinates = cartesian # coordinate system +length = 1.495978707e14 # 10AU in cgs unit +mass = 1.988416e33 # central-star mass (M_sun) in cgs unit +time = 1.5871820329271033e8 # cgs unit in year/(2*pi)*(r0**3/mstar)**0.5 +temperature = 2.4753531e4 # kevin (vel**2/kb*mu*mp) +physical_units = cgs # physical unit system -problem_id = coag # problem ID: basename of output filenames - +problem_id = coag # problem ID: basename of output filenames -file_type = hst -dt = 0.628 +file_type = hst +dt = 0.628 -variables = gas.prim.density, dust.prim.density -file_type = hdf5 # hdf5 data dump -dt = 62.8 # time increment between outputs +variables = gas.prim.density, & + dust.prim.density +file_type = hdf5 # hdf5 data dump +dt = 62.8 # time increment between outputs -file_type = rst -dt = 628 +file_type = rst +dt = 628.0 -nlim = -1 # cycle limit -tlim = 3768. # time limit -integrator = rk2 # time integration algorithm -ncycle_out = 10 # interval for stdout summary info +nlim = -1 # cycle limit +tlim = 3768.0 # time limit +integrator = rk2 # time integration algorithm +ncycle_out = 10 # interval for stdout summary info -nghost = 2 -refinement = none - -nx1 = 16 # Number of zones in X1-direction -x1min = 9.0 # minimum value of X1 -x1max = 11.0 # maximum value of X1 -ix1_bc = outflow # Inner-X1 boundary condition flag -ox1_bc = outflow # Outer-X1 boundary condition flag - -nx2 = 1 # Number of zones in X2-direction -x2min = 0.0 # minimum value of X2 -x2max = 6.283185307179586 # maximum value of X2 -ix2_bc = periodic # Inner-X2 boundary condition flag -ox2_bc = periodic # Outer-X2 boundary condition flag - -nx3 = 1 # Number of zones in X3-direction -x3min = -0.5 # minimum value of X3 -x3max = 0.5 # maximum value of X3 -ix3_bc = periodic # Inner-X3 boundary condition flag -ox3_bc = periodic # Outer-X3 boundary condition flag +nghost = 2 +refinement = none + +nx1 = 16 # Number of zones in X1-direction +x1min = 9.0 # minimum value of X1 +x1max = 11.0 # maximum value of X1 +ix1_bc = outflow # Inner-X1 boundary condition flag +ox1_bc = outflow # Outer-X1 boundary condition flag + +nx2 = 1 # Number of zones in X2-direction +x2min = 0.0 # minimum value of X2 +x2max = 6.283185307179586 # maximum value of X2 +ix2_bc = periodic # Inner-X2 boundary condition flag +ox2_bc = periodic # Outer-X2 boundary condition flag + +nx3 = 1 # Number of zones in X3-direction +x3min = -0.5 # minimum value of X3 +x3max = 0.5 # maximum value of X3 +ix3_bc = periodic # Inner-X3 boundary condition flag +ox3_bc = periodic # Outer-X3 boundary condition flag -nx1 = 16 # Number of cells in each MeshBlock, X1-dir -nx2 = 1 # Number of cells in each MeshBlock, X2-dir -nx3 = 1 # Number of cells in each MeshBlock, X3-dir +nx1 = 16 # Number of cells in each MeshBlock, X1-dir +nx2 = 1 # Number of cells in each MeshBlock, X2-dir +nx3 = 1 # Number of cells in each MeshBlock, X3-dir -gas = true -dust = true -coagulation = true +gas = true +dust = true +coagulation = true -cfl = 0.9 # gas cfl number -gamma = 1.00001 # adiabatic index -mu = 2.3 # mean molecular weight +cfl = 0.9 # gas cfl number +gamma = 1.00001 # adiabatic index +mu = 2.3 # mean molecular weight -cfl = 0.9 # dust cfl number -dfloor = 1.59577e-24 # density floor=1e-20*rho0 -nspecies = 121 # number of dust size -size_input = logspace # dust size distribution - -scr_level = 1 # for reconstruction - -surface_density_flag = false # surface or volume density -grain_density = 1.25 # dust internal density g/cc -min_size = 1e-5 #cm -max_size = 10.0 #cm +cfl = 0.9 # dust cfl number +dfloor = 1.59577e-24 # density floor=1e-20*rho0 +nspecies = 121 # number of dust size +size_input = logspace # dust size distribution +scr_level = 1 # for hier. scratch registers +grain_density = 1.25 # dust internal density g/cc +min_size = 1e-5 # cm +max_size = 10.0 # cm -vfrag = 1000.0 #cm/s -coag_int = 1 -coag_use_adaptiveStep = false -coag_mom_preserve = false -coag_info_out = true +vfrag = 1000.0 # cm/s +coag_int = 1 +coag_use_adaptive_step = false +coag_mom_preserve = false +coag_info_out = true +nstep_coag = 10 # number of steps for one coagulation call +const_coag_omega = true # using omega at r0_length +surface_density_flag = false # surface or volume density -h0 = 0.05 # scaled height at r0 -rho0 = 1.59577e-4 # rh0 = sigma_0/sqrt(2*pi)/h0 -nInit_dust = 11 # number of dust species initially -dust_to_gas = 0.01 # init dust-to-gas ratio -nstep1Coag = 10 # number of steps for one coagulation call -const_coag_omega = true # using omega at r0_length - +h0 = 0.05 # scaled height at r0 +rho0 = 1.59577e-4 # rh0 = sigma_0/sqrt(2*pi)/h0 +ninit_dust = 11 # number of dust species initially +dust_to_gas = 0.01 # init dust-to-gas ratio diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3935535b..44867fb7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -59,6 +59,7 @@ set (SRC_LIST pgen/advection.hpp pgen/beam.hpp pgen/blast.hpp + pgen/coag.hpp pgen/conduction.hpp pgen/constant.hpp pgen/disk.hpp diff --git a/src/artemis.cpp b/src/artemis.cpp index af77e3c7..da003783 100644 --- a/src/artemis.cpp +++ b/src/artemis.cpp @@ -132,10 +132,14 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { if (do_rotating_frame) packages.Add(RotatingFrame::Initialize(pin.get())); if (do_cooling) packages.Add(Gas::Cooling::Initialize(pin.get())); if (do_drag) packages.Add(Drag::Initialize(pin.get())); + + // Operator split dust coagulation if (do_coagulation) { - auto &dustPars = packages.Get("dust")->AllParams(); - packages.Add(Dust::Coagulation::Initialize(pin.get(), dustPars, units, constants)); + auto &dust_params = packages.Get("dust")->AllParams(); + packages.Add(Dust::Coagulation::Initialize(pin.get(), dust_params, units, constants)); } + + // Operator split radiation if (do_radiation) { // Top-level radiation package packages.Add(Radiation::Initialize(pin.get(), constants, do_imc)); diff --git a/src/artemis.hpp b/src/artemis.hpp index df0105d6..fffe1d5b 100644 --- a/src/artemis.hpp +++ b/src/artemis.hpp @@ -67,6 +67,9 @@ namespace prim { ARTEMIS_VARIABLE(dust.prim, density); ARTEMIS_VARIABLE(dust.prim, velocity); } // namespace prim +namespace coag { +ARTEMIS_VARIABLE(dust.coag, ncalls); +} } // namespace dust namespace rad { diff --git a/src/artemis_driver.cpp b/src/artemis_driver.cpp index b6a5f252..bba0acb7 100644 --- a/src/artemis_driver.cpp +++ b/src/artemis_driver.cpp @@ -22,6 +22,7 @@ #include "artemis.hpp" #include "artemis_driver.hpp" #include "drag/drag.hpp" +#include "dust/coagulation/coagulation.hpp" #include "dust/dust.hpp" #include "gas/cooling/cooling.hpp" #include "gas/gas.hpp" @@ -132,7 +133,8 @@ TaskListStatus ArtemisDriver::Step() { if (do_moment) status = Moments::MomentsDriver(pmesh, tm, rad_integrator.get()); if (status != TaskListStatus::complete) return status; - if (do_coagulation) status = Dust::OperatorSplitDust(pmesh, tm); + // Operator split, dust coagulation + if (do_coagulation) status = Dust::Coagulation::CoagulationDriver(pmesh, tm); if (status != TaskListStatus::complete) return status; // Compute new dt, (de)refine, and handle sparse (if enabled) diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index 91b3307b..825dc906 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -10,8 +10,8 @@ // license in this material to reproduce, prepare derivative works, distribute copies to // the public, perform publicly and display publicly, and to permit others to do so. //======================================================================================== -// NOTE(@Shengtai -// The dust coagulation code is modified from public available Dustpy package +// NOTE(@sli): +// The dust coagulation code is modified from the publicly available DustPy package // https://github.com/stammler/dustpy // and from their paper (Stammler and Birnstiel (2022) ApJ 935:35) // "DustPy: A Python Package for Dust Evolution in Protoplanetary Disks" @@ -22,61 +22,57 @@ #include "artemis.hpp" #include "dust/dust.hpp" #include "geometry/geometry.hpp" +#include "utils/artemis_utils.hpp" +#include "utils/eos/eos.hpp" #include "utils/units.hpp" +using ArtemisUtils::EOS; +using ArtemisUtils::VI; + namespace Dust { namespace Coagulation { //---------------------------------------------------------------------------------------- //! \fn StateDescriptor Coagulalation::Initialize //! \brief Adds intialization function for coagulation package -std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars, +std::shared_ptr Initialize(ParameterInput *pin, Params &dust_params, ArtemisUtils::Units &units, ArtemisUtils::Constants &constants) { auto coag = std::make_shared("coagulation"); Params ¶ms = coag->AllParams(); - PARTHENON_REQUIRE(units.GetPhysicalUnits() == ArtemisUtils::PhysicalUnits::cgs, - "coagulation physics requires physical_units = cgs"); - + // Assign CoagParams CoagParams cpars; - const int nm = dustPars.template Get("nspecies"); - const Real dfloor = dustPars.template Get("dfloor"); - const Real rho_p = dustPars.template Get("grain_density"); - cpars.nm = nm; - cpars.vfrag = pin->GetOrAddReal("dust", "vfrag", 1.e3); // cm/s - cpars.nlim = 1e10; + // Units + cpars.rho0 = units.GetMassDensityCodeToPhysical(); + cpars.length0 = units.GetLengthCodeToPhysical(); + PARTHENON_REQUIRE(units.GetPhysicalUnits() == ArtemisUtils::PhysicalUnits::cgs, + "Coagulation physics requires physical_units = cgs"); + + // Species and properties + cpars.nm = dust_params.Get("nspecies"); + cpars.dfloor = cpars.rho0 * dust_params.Get("dfloor"); + cpars.rho_p = cpars.rho0 * dust_params.Get("grain_density"); + cpars.vfrag = pin->GetOrAddReal("dust/coagulation", "vfrag", 1.e3); // cm/s cpars.integrator = pin->GetOrAddInteger("dust/coagulation", "coag_int", 3); cpars.use_adaptive = - pin->GetOrAddBoolean("dust/coagulation", "coag_use_adaptiveStep", true); + pin->GetOrAddBoolean("dust/coagulation", "coag_use_adaptive_step", true); cpars.mom_coag = pin->GetOrAddBoolean("dust/coagulation", "coag_mom_preserve", true); - cpars.nCall_mx = pin->GetOrAddInteger("dust/coagulation", "coag_nsteps_mx", 1000); - - // convert back to cgs unit - cpars.rho0 = units.GetMassDensityCodeToPhysical(); - cpars.rho_p = rho_p * cpars.rho0; - - const bool const_omega = pin->GetOrAddBoolean("problem", "const_coag_omega", false); - cpars.const_omega = const_omega; - + cpars.ncall_max = pin->GetOrAddInteger("dust/coagulation", "coag_nsteps_max", 1000); + cpars.const_omega = pin->GetOrAddBoolean("dust/coagulation", "const_coag_omega", false); cpars.ibounce = pin->GetOrAddBoolean("dust/coagulation", "coag_bounce", false); - - int coord_type = 0; // density - - const bool isurface_den = pin->GetOrAddBoolean("dust", "surface_density_flag", true); - if (isurface_den) { - cpars.rho0 *= units.GetLengthCodeToPhysical(); - coord_type = 1; - } - - cpars.coord = coord_type; // 1--surface density, 0: 3D - - cpars.err_eps = 1.0e-1; - cpars.S = 0.9; - cpars.cfl = 1.0e-1; - cpars.chi = 1.0; - - // some checks and definition + cpars.err_eps = pin->GetOrAddReal("dust/coagulation", "err_eps", 0.1); + cpars.S = pin->GetOrAddReal("dust/coagulation", "S", 0.9); + cpars.cfl = pin->GetOrAddReal("dust/coagulation", "cfl_coag", 0.1); + cpars.chi = pin->GetOrAddReal("dust/coagulation", "chi", 1.0); + + // Coordinate type + // NOTE(@pdmullen): Following @sli's earlier implementation, rho_p and dfloor use solely + // the density unit in construction, not the one weighted by length unit + cpars.coord = pin->GetOrAddBoolean("dust/coagulation", "surface_density_flag", true); + if (cpars.coord) cpars.rho0 *= cpars.length0; + + // Adaptivity if (cpars.use_adaptive) { if (cpars.integrator == 3) { cpars.pgrow = -0.5; @@ -94,223 +90,289 @@ std::shared_ptr Initialize(ParameterInput *pin, Params &dustPar cpars.errcon = std::pow((5. / cpars.S), (1. / cpars.pgrow)); } - ParArray1D dust_size("dsize", nm); - - // convert back to CGS unit - const Real length0 = units.GetLengthCodeToPhysical(); - - // using device - auto sizes = dustPars.template Get>("sizes"); + // Dust sizes + ParArray1D dust_size("dsize", cpars.nm); + auto sizes = dust_params.Get>("sizes"); parthenon::par_for( parthenon::loop_pattern_flatrange_tag, "code2phys", parthenon::DevExecSpace(), 0, - nm - 1, KOKKOS_LAMBDA(const int i) { dust_size(i) = sizes(i) * length0; }); + cpars.nm - 1, + KOKKOS_LAMBDA(const int i) { dust_size(i) = sizes(i) * cpars.length0; }); + // Cheeck if sizes are compatibile with coagulation model auto h_sizes = dust_size.GetHostMirrorAndCopy(); - - const Real cond = 3.0 / (1.0 - nm) * std::log(h_sizes(0) / h_sizes(nm - 1)); - if (std::exp(cond) > std::sqrt(2.0)) { + if (std::exp(3.0 / (1.0 - cpars.nm) * std::log(h_sizes(0) / h_sizes(cpars.nm - 1))) > + std::sqrt(2.0)) { std::stringstream msg; msg << "### FATAL ERROR in dust with coagulation: using nspecies >" - << 3.0 * std::log(h_sizes(nm - 1) / h_sizes(0)) / (std::log(std::sqrt(2.0))) + 1. - << " instead of " << nm << std::endl; + << 3.0 * std::log(h_sizes(cpars.nm - 1) / h_sizes(0)) / + (std::log(std::sqrt(2.0))) + + 1. + << " instead of " << cpars.nm << std::endl; PARTHENON_FAIL(msg); } - // allocate array and assign values - cpars.klf = ParArray2D("klf", nm, nm); - cpars.mass_grid = ParArray1D("mass_grid", nm); - const int n2DRv = coag2DRv::last2; - cpars.coagR3D = ParArray3D("coagReal3D", n2DRv, nm, nm); - cpars.cpod_notzero = ParArray3D("idx_nzcpod", nm, nm, 4); - cpars.cpod_short = ParArray3D("nzcpod", nm, nm, 4); - - cpars.dfloor = dfloor * cpars.rho0; - Real a = 3.0 * std::log10(h_sizes(0) / h_sizes(nm - 1)) / static_cast(1 - nm); - - initializeArray(nm, cpars.pGrid, cpars.rho_p, cpars.chi, a, dust_size, cpars.klf, + // Allocate CoagParam arrays + const Real a = 3.0 * std::log10(h_sizes(0) / h_sizes(cpars.nm - 1)) / + static_cast(1 - cpars.nm); + const int n2drv = coag2drv::last2; + cpars.klf = ParArray2D("klf", cpars.nm, cpars.nm); + cpars.mass_grid = ParArray1D("mass_grid", cpars.nm); + cpars.coagR3D = ParArray3D("coagReal3D", n2drv, cpars.nm, cpars.nm); + cpars.cpod_notzero = ParArray3D("idx_nzcpod", cpars.nm, cpars.nm, 4); + cpars.cpod_short = ParArray3D("nzcpod", cpars.nm, cpars.nm, 4); + InitializeArray(cpars.nm, cpars.pgrid, cpars.rho_p, cpars.chi, a, dust_size, cpars.klf, cpars.mass_grid, cpars.coagR3D, cpars.cpod_notzero, cpars.cpod_short); + // Stash CoagParams params.Add("coag_pars", cpars); - // other parameters for coagulation - const int nstep1Coag = pin->GetOrAddReal("problem", "nstep1Coag", 50); - params.Add("nstep1Coag", nstep1Coag); - Real dtCoag = 0.0; - params.Add("dtCoag", dtCoag, Params::Mutability::Restart); - const Real alpha = pin->GetOrAddReal("dust/coagulation", "coag_alpha", 1.e-3); - params.Add("coag_alpha", alpha); - const int scr_level = pin->GetOrAddReal("dust/coagulation", "coag_scr_level", 0); - params.Add("coag_scr_level", scr_level); + // Remaining parameters for coagulation package + params.Add("nstep_coag", pin->GetOrAddInteger("dust/coagulation", "nstep_coag", 50)); + params.Add("dt_coag", 0.0, Params::Mutability::Restart); + params.Add("coag_alpha", pin->GetOrAddReal("dust/coagulation", "coag_alpha", 1.e-3)); + params.Add("coag_scr_level", + pin->GetOrAddInteger("dust/coagulation", "coag_scr_level", 0)); + + // Fields for stashing solver diagnostics const bool info_out = pin->GetOrAddBoolean("dust/coagulation", "coag_info_out", false); params.Add("coag_info_out", info_out); + if (info_out) { + Metadata m = Metadata({Metadata::Cell, Metadata::Derived, Metadata::OneCopy}); + coag->AddField(m); + } return coag; } -// using Kokkos par_for() loop -void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &chi, - const Real &a, const ParArray1D dsize, ParArray2D klf, - ParArray1D mass_grid, ParArray3D coag3D, - ParArray3D cpod_notzero, ParArray3D cpod_short) { - - int ikdelta = coag2DRv::kdelta; - int icoef_fett = coag2DRv::coef_fett; - parthenon::par_for( - parthenon::loop_pattern_flatrange_tag, "initializeCoag1", parthenon::DevExecSpace(), - 0, nm - 1, KOKKOS_LAMBDA(const int i) { - // initialize in_idx(*) array - // initialize kdelta array - for (int j = 0; j < nm; j++) { - coag3D(ikdelta, i, j) = 0.0; - } - coag3D(ikdelta, i, i) = 1.0; - mass_grid(i) = 4.0 * M_PI / 3.0 * rho_p * dsize(i) * dsize(i) * dsize(i); - // initialize coag3D(icoef_fett, *,*) - for (int j = 0; j < nm; j++) { - Real tmp1 = (1.0 - 0.5 * coag3D(ikdelta, i, j)); - coag3D(icoef_fett, i, j) = M_PI * SQR(dsize(i) + dsize(j)) * tmp1; - } - }); - - // set fragmentation variables - // Real a = std::log10(massGrid_h(0) / massGrid_h(nm - 1)) / (1 - nm); - Real ten_a = std::pow(10.0, a); - Real ten_ma = 1.0 / ten_a; - int ce = int(-1.0 / a * std::log10(1.0 - ten_ma)) + 1; - - pGrid = floor(1.0 / a); // used in integration - - Real frag_slope = 2.0 - 11.0 / 6.0; - - int iphiFrag = coag2DRv::phiFrag, iepsFrag = coag2DRv::epsFrag; - int iaFrag = coag2DRv::aFrag; - parthenon::par_for( - parthenon::loop_pattern_flatrange_tag, "initializeCoag2", parthenon::DevExecSpace(), - 0, nm - 1, KOKKOS_LAMBDA(const int i) { - Real sum_pF = 0.0; - for (int j = 0; j <= i; j++) { - coag3D(iphiFrag, j, i) = std::pow(mass_grid(j), frag_slope); - sum_pF += coag3D(iphiFrag, j, i); - } - // normalization - for (int j = 0; j <= i; j++) { - coag3D(iphiFrag, j, i) /= sum_pF; // switch (i,j) from fortran - } - - // Cratering - for (int j = 0; j <= i - pGrid - 1; j++) { - // FRAGMENT DISTRIBUTION - // The largest fragment has the mass of the smaller collision partner +//---------------------------------------------------------------------------------------- +//! \fn TaskCollection Dust::CoagulationDriver +//! \brief dust wrapper function for Coagulation +template +TaskListStatus CoagulationDriver(Mesh *pm, parthenon::SimTime &tm) { + auto &coag_pkg = pm->packages.Get("coagulation"); + auto *dt_coag = coag_pkg->MutableParam("dt_coag"); + int nstep_coag = coag_pkg->template Param("nstep_coag"); + + // Increment dt_coag + *dt_coag += tm.dt; + + // Determine if executing coagulation this cycle... + if ((tm.ncycle + 1) % nstep_coag != 0) return TaskListStatus::complete; + + // ...and if so, compute/report time, dt, and cycle for coagulation and reset dt_coag + const Real ltime = tm.time + tm.dt - (*dt_coag); + const Real ldt = (*dt_coag); + *dt_coag = 0.0; + if (Globals::my_rank == 0) { + std::cout << "(Coagulation) " << "cycle=" << tm.ncycle << " time=" << ltime + << " dt=" << ldt << std::endl; + } - // Mass bin of largest fragment - klf(i, j) = j; + // Create MeshData register subset for dust + std::vector coag_names = pm->GetVariableNames( + std::vector{dust::cons::density::name(), dust::cons::momentum::name(), + dust::prim::density::name(), dust::prim::velocity::name()}, + std::vector{}); + auto &md_coag = pm->mesh_data.AddShallow("md_coag", pm->mesh_data.Get(), coag_names); + + // Assemble tasks + TaskCollection tc; + TaskID none(0); + using namespace ::parthenon::Update; + const int num_partitions = pm->DefaultNumPartitions(); + TaskRegion &tr = tc.AddRegion(num_partitions); + for (int i = 0; i < num_partitions; i++) { + auto &tl = tr[i]; + auto &base = pm->mesh_data.GetOrAdd("base", i); + auto &md_coag = pm->mesh_data.GetOrAdd("md_coag", i); + + // Execute coagulation step + auto coag_step = tl.AddTask(none, CoagulationStep, base.get(), ltime, ldt); + + // C2P (on dust species) + auto pre_comm = + tl.AddTask(coag_step, PreCommFillDerived>, md_coag.get()); + + // Set boundary conditions (both physical and logical) + auto bcs = parthenon::AddBoundaryExchangeTasks(pre_comm, tl, md_coag, pm->multilevel); + + // P2C (on dust species) + auto p2c = tl.AddTask(bcs, FillDerived>, md_coag.get()); + } - coag3D(iaFrag, i, j) = (1.0 + chi) * mass_grid(j); - // |_______| - // | - // Mass of fragments - coag3D(iepsFrag, i, j) = chi * mass_grid(j) / (mass_grid(i) * (1.0 - ten_ma)); - } + return tc.Execute(); +} - int i1 = std::max(0, i - pGrid); - for (int j = i1; j <= i; j++) { - // The largest fragment has the mass of the larger collison partner - klf(i, j) = i; - coag3D(iaFrag, i, j) = (mass_grid(i) + mass_grid(j)); - } - }); +//---------------------------------------------------------------------------------------- +//! \fn TaskStatus Dust::CoagulationStep +// \brief Wrapper function for coagulation procedure in one time step +template +TaskStatus CoagulationStep(MeshData *md, const Real time, const Real dt) { + using parthenon::MakePackDescriptor; + auto pm = md->GetParentPointer(); + + // Extract EOS + auto &gas_pkg = pm->packages.Get("gas"); + auto eos_d = gas_pkg->template Param("eos_d"); + + // Extract dust params + auto &dust_pkg = pm->packages.Get("dust"); + const int &nspecies = dust_pkg->template Param("nspecies"); + const auto &dust_size = dust_pkg->template Param>("sizes"); + const Real &dfloor = dust_pkg->template Param("dfloor"); + + // Extract coagulation params + auto &coag_pkg = pm->packages.Get("coagulation"); + auto &coag = coag_pkg->template Param("coag_pars"); + const Real alpha = coag_pkg->template Param("coag_alpha"); + const int nvel = (coag.coord) ? 2 : 3; + const int scr_level = coag_pkg->template Param("coag_scr_level"); + const bool info_out_flag = coag_pkg->template Param("coag_info_out"); + + // Extract units + auto &artemis_pkg = pm->packages.Get("artemis"); + const auto &units = artemis_pkg->template Param("units"); + const Real time0 = units.GetTimeCodeToPhysical(); + const Real length0 = units.GetLengthCodeToPhysical(); + const Real rho0 = coag.rho0; + const Real vel0 = length0 / time0; + + // Indexing + IndexRange ib = md->GetBoundsI(IndexDomain::interior); + IndexRange jb = md->GetBoundsJ(IndexDomain::interior); + IndexRange kb = md->GetBoundsK(IndexDomain::interior); + + // Packing + auto &resolved_pkgs = pm->resolved_packages; + static auto desc = + MakePackDescriptor(resolved_pkgs.get()); + auto vmesh = desc.GetPack(md); + + // Global reduction of sizes (max) and dust mass (sum) before coagulation + Real mass_d0 = Null(); + int max_size0 = Null(); + if (info_out_flag) { + PreCoagulationDiagnostics(md, vmesh, dfloor, mass_d0, max_size0); + } - // initialize dalp array - // Calculate the D matrix - // Calculate the E matrix - ParArray2D e("epod", nm, nm); - int idalp = coag2DRv::dalp, idpod = coag2DRv::dpod; - parthenon::par_for( - parthenon::loop_pattern_flatrange_tag, "initializeCoag4", parthenon::DevExecSpace(), - 0, nm - 1, KOKKOS_LAMBDA(const int k) { - for (int j = 0; j < nm; j++) { - if (j <= k + 1 - ce) { - coag3D(idalp, k, j) = 1.0; - coag3D(idpod, k, j) = -mass_grid(j) / (mass_grid(k) * (ten_a - 1.0)); - } else { - coag3D(idpod, k, j) = -1.0; - coag3D(idalp, k, j) = 0.0; - } - } - // for E matrix------------- - Real mkkme = mass_grid(k) * (1.0 - ten_ma); - Real mkpek = mass_grid(k) * (ten_a - 1.0); - Real mkpeme = mass_grid(k) * (ten_a - ten_ma); - for (int j = 0; j < nm; ++j) { - if (j <= k - ce) { - e(k, j) = mass_grid(j) / mkkme; - } else { - Real theta1 = (mkpeme - mass_grid(j) < 0.0) ? 0.0 : 1.0; - e(k, j) = (1.0 - (mass_grid(j) - mkkme) / mkpek) * theta1; - } + // Coagulation + size_t isize = (5 + nvel + (coag.integrator == 3 && coag.mom_coag)) * nspecies; + size_t scr_size = ScratchPad1D::shmem_size(isize); + ArtemisUtils::par_for_outer( + DEFAULT_OUTER_LOOP_PATTERN, "Dust::Coagulation", parthenon::DevExecSpace(), + scr_size, scr_level, 0, md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, + KOKKOS_LAMBDA(parthenon::team_mbr_t mbr, const int b, const int k, const int j, + const int i) { + // Allocate scratch + ScratchPad1D stime(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D rhod(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D vel(mbr.team_scratch(scr_level), nvel * nspecies); + ScratchPad1D source(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D Q(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D nQs(mbr.team_scratch(scr_level), nspecies); + ScratchPad1D Q2(mbr.team_scratch(scr_level), + (coag.integrator == 3 && coag.mom_coag) * nspecies); + + // Actual npecies this block reported by SparsePack + const int nm = vmesh.GetSize(b, dust::prim::density()); + + // Extract geometry + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const auto &hx = coords.GetScaleFactors(); + const auto &xv = coords.GetCellCenter(); + const auto &xcyl = coords.ConvertToCyl(xv); + const Real irad = coag.const_omega ? 1.0 : 1.0 / xcyl[0]; // cylindrical + const Real omega1 = irad * std::sqrt(irad) / time0; // code-units + + // Extract gas state vector + const Real &gdens = vmesh(b, gas::prim::density(0), k, j, i); + const Real &gsie = vmesh(b, gas::prim::sie(0), k, j, i); + const Real &gbulk = eos_d.BulkModulusFromDensityInternalEnergy(gdens, gsie); + const Real cs1 = std::sqrt(gbulk / gdens) * vel0; + const Real gdens1 = gdens * rho0; + + // Extract time(step) + const Real time1 = time * time0; + Real dt_sync = dt * time0; + + // Set stopping times, rhod, and veld in scratch memory + const Real st0 = (coag.coord) ? 0.5 * M_PI * coag.rho_p / gdens1 / omega1 + : std::sqrt(M_PI / 8.0) * coag.rho_p / gdens1 / cs1; + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { + // Calculate the stopping time + stime(n) = st0 * dust_size(n) * length0; + + // Calculate rhod, vel + const bool gtf = vmesh(b, dust::prim::density(n), k, j, i) > dfloor; + rhod(n) = gtf * vmesh(b, dust::prim::density(n), k, j, i) * rho0; + for (int d = 0; d < nvel; d++) { + const int vidx = VI(n, d); + vel(vidx) = gtf * vmesh(b, dust::prim::velocity(vidx), k, j, i) * vel0; + } + }); + mbr.team_barrier(); + + // Coagulation Kernel + int ncall = 0; + Coagulation::CoagulationOneCell(mbr, i, time1, dt_sync, gdens1, rhod, stime, vel, + nvel, Q, nQs, alpha, cs1, omega1, coag, source, + ncall, Q2); + // NOTE(@pdmullen): mbr.team_barrier() included at end of CoagulationOneCell... + + // Update dust density and momentum after coagulation + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { + const bool gt0 = (rhod(n) > 0.0); + vmesh(b, dust::cons::density(n), k, j, i) = gt0 * (rhod(n) / rho0); + for (int d = 0; d < nvel; d++) { + const int vidx = VI(n, d); + vmesh(b, dust::cons::momentum(vidx), k, j, i) = + gt0 * rhod(n) * vel(vidx) * hx[d] / (rho0 * vel0); + } + }); + + // Diagnostics + if (info_out_flag) { + Kokkos::single(Kokkos::PerTeam(mbr), + [&]() { vmesh(b, dust::coag::ncalls(), k, j, i) = ncall; }); } }); - // calculate the coagualtion variables - ParArray3D cpod("cpod", nm, nm, nm); - - // initialize cpod array; - parthenon::par_for( - parthenon::loop_pattern_mdrange_tag, "initializeCoag6", parthenon::DevExecSpace(), - 0, nm - 1, 0, nm - 1, KOKKOS_LAMBDA(const int i, const int j) { - // initialize to zero first - for (int k = 0; k < nm; k++) { - cpod(i, j, k) = 0.0; - } - Real mloc = mass_grid(i) + mass_grid(j); - if (mloc < mass_grid(nm - 1)) { - int gg = 0; - for (int k = std::max(i, j); k < nm - 1; k++) { - if (mloc >= mass_grid(k) && mloc < mass_grid(k + 1)) { - gg = k; - break; - } - } - - cpod(i, j, gg) = - (mass_grid(gg + 1) - mloc) / (mass_grid(gg + 1) - mass_grid(gg)); - cpod(i, j, gg + 1) = 1.0 - cpod(i, j, gg); - - // modified cpod(*) array------------------------- - Real dtheta_ji = (j - i - 0.5 < 0.0) ? 0.0 : 1.0; // theta(j - i - 0.5); - for (int k = 0; k < nm; k++) { - Real theta_kj = (k - j - 1.5 < 0.0) ? 0.0 : 1.0; // theta(k - j - 1.5) - cpod(i, j, k) = (0.5 * coag3D(ikdelta, i, j) * cpod(i, j, k) + - cpod(i, j, k) * theta_kj * dtheta_ji); - } - cpod(i, j, j) += coag3D(idpod, j, i); - cpod(i, j, j + 1) += e(j + 1, i) * dtheta_ji; - - } // end if - }); + // Global reduction of sizes (max) and dust mass (sum) before coagulation. Report + // diagnostics to file, including max_ncalls + Real mass_d1 = Null(); + int max_size1 = Null(); + int max_calls = Null(); + if (info_out_flag) { + PostCoagulationDiagnostics(md, vmesh, dfloor, mass_d1, max_size1, max_calls); + WriteCoagulationDiagnostics(md, time, dt, max_calls, max_size1, max_size0, mass_d1, + mass_d0); + } - // initialize cpod_nonzero and cpod_short array - parthenon::par_for( - parthenon::loop_pattern_mdrange_tag, "initializeCoag7", parthenon::DevExecSpace(), - 0, nm - 1, 0, nm - 1, KOKKOS_LAMBDA(const int i, const int j) { - if (j <= i) { - // initialize cpod_notzero(i, j, 4) and cpod_short(i, j, 4) - for (int k = 0; k < 4; k++) { - cpod_notzero(i, j, k) = 0; - cpod_short(i, j, k) = 0.0; - } - int inc = 0; - for (int k = 0; k < nm; ++k) { - Real dum = cpod(i, j, k) + cpod(j, i, k); - if (dum != 0.0) { - cpod_notzero(i, j, inc) = k; - cpod_short(i, j, inc) = dum; - inc++; - } - } - } - }); + return TaskStatus::complete; } +//---------------------------------------------------------------------------------------- +//! template instantiations +typedef Coordinates G; +typedef Mesh M; +typedef MeshData MD; +typedef parthenon::SimTime ST; +template TaskListStatus CoagulationDriver(M *pm, ST &tm); +template TaskListStatus CoagulationDriver(M *pm, ST &tm); +template TaskListStatus CoagulationDriver(M *pm, ST &tm); +template TaskListStatus CoagulationDriver(M *pm, ST &tm); +template TaskListStatus CoagulationDriver(M *pm, ST &tm); +template TaskListStatus CoagulationDriver(M *pm, ST &tm); +template TaskStatus CoagulationStep(MD *md, const Real t, const Real dt); +template TaskStatus CoagulationStep(MD *md, const Real t, const Real dt); +template TaskStatus CoagulationStep(MD *md, const Real t, const Real dt); +template TaskStatus CoagulationStep(MD *md, const Real t, const Real dt); +template TaskStatus CoagulationStep(MD *md, const Real t, const Real dt); +template TaskStatus CoagulationStep(MD *md, const Real t, const Real dt); + } // namespace Coagulation } // namespace Dust diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index b46fcc5a..00f34161 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -10,56 +10,63 @@ // license in this material to reproduce, prepare derivative works, distribute copies to // the public, perform publicly and display publicly, and to permit others to do so. //======================================================================================== -// NOTE(@Shengtai +// NOTE(@sli): // The dust coagulation code is modified from public available Dustpy package // https://github.com/stammler/dustpy // and from their paper (Stammler and Birnstiel (2022) ApJ 935:35) // "DustPy: A Python Package for Dust Evolution in Protoplanetary Disks" //======================================================================================== - -#ifndef DUST_COAGULATION_HPP_ -#define DUST_COAGULATION_HPP_ +#ifndef DUST_COAGULATION_COAGULATION_HPP_ +#define DUST_COAGULATION_COAGULATION_HPP_ #include "utils/artemis_utils.hpp" #include "utils/units.hpp" -//#define COAGULATION_DEBUG namespace Dust { namespace Coagulation { -enum coag2DRv { dpod, aFrag, phiFrag, epsFrag, dalp, kdelta, coef_fett, last2 }; - std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars, ArtemisUtils::Units &units, ArtemisUtils::Constants &constants); +// OperatorSplit tasks +template +TaskListStatus CoagulationDriver(Mesh *pm, parthenon::SimTime &tm); + +template +TaskStatus CoagulationStep(MeshData *md, const Real time, const Real dt); + +// Constants that enumerate coagulation kernel +enum coag2drv { dpod, afrag, phifrag, epsfrag, dalp, kdelta, coef_fett, last2 }; + +// Struct that holds coagulation parameters struct CoagParams { - int coord = 0; // 1--surface density, 0: 3D - - int nm; - int nCall_mx = 1000; - bool ibounce = false; - Real nlim; - Real rho_p; - Real vfrag; - Real dfloor; - int integrator; - bool use_adaptive; // adaptive step size - bool mom_coag; // mom-preserving coagulation - - int pGrid; - Real chi; - Real pgrow; // Power for increasing step size - Real pshrink; // Power for decreasing step size - Real err_eps; // Relative tolerance for adaptive step sizing - Real S; // Safety margin for adaptive step sizing - Real cfl; + bool coord = false; // true--surface density, false: 3D + + int nm; // nspecies + int ncall_max = 1000; // max coag calls + bool ibounce = false; // include bouncing + Real rho_p; // grain density + Real vfrag; // fragmentation velocity + Real dfloor; // dust density floor + int integrator; // coag time integrator + bool use_adaptive; // adaptive step size + bool mom_coag; // mom-preserving coagulation + + int pgrid; // dust grid + Real chi; // chi parameter + Real pgrow; // Power for increasing step size + Real pshrink; // Power for decreasing step size + Real err_eps; // Relative tolerance for adaptive step sizing + Real S; // Safety margin for adaptive step sizing + Real cfl; // CFL number Real errcon; // Needed for increasing step size bool const_omega; // for shearing-box or testing - Real rho0; // physical-to-code unit conversion + Real rho0; // physical-to-code unit conversion density + Real length0; // physical-to-code unit conversion length - // pre-calculated array, once-for-all + // pre-calculated arrays ParArray2D klf; ParArray1D mass_grid; ParArray3D coagR3D; @@ -67,19 +74,336 @@ struct CoagParams { ParArray3D cpod_short; }; -void initializeArray(const int nm, int &pGrid, const Real &rho_p, const Real &chi, - const Real &a, const ParArray1D dsize, ParArray2D klf, - ParArray1D mass_grid, ParArray3D coag3D, - ParArray3D cpod_notzero, ParArray3D cpod_short); +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::PreCoagulationDiagnostics +// \brief Gather pre-coagulation diagnostics +template +static void PreCoagulationDiagnostics(MeshData *md, T &vmesh, const Real &dfloor, + Real &mass_d0, int &max_size0) { + // Indexing + IndexRange ib = md->GetBoundsI(IndexDomain::interior); + IndexRange jb = md->GetBoundsJ(IndexDomain::interior); + IndexRange kb = md->GetBoundsK(IndexDomain::interior); + + // Reduction + Real lmass_d0 = 0.0; + int lmax_size0 = 1; + Kokkos::parallel_reduce( + "coag::pre-diag", + Kokkos::MDRangePolicy>( + {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, + int &lmax) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const Real &vol = coords.Volume(); + + // Sum over nspecies + for (int n = 0; n < vmesh.GetSize(b, dust::cons::density()); ++n) { + lsum += vmesh(b, dust::cons::density(n), k, j, i) * vol; + } + + // Max + for (int n = vmesh.GetSize(b, dust::cons::density()) - 1; n >= 0; --n) { + const Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + if (dens_d > dfloor) { + lmax = std::max(lmax, n); + break; + } + } + }, + lmass_d0, Kokkos::Max(lmax_size0)); + Kokkos::fence(); + +#ifdef MPI_PARALLEL + // Sum over all processors + MPI_Allreduce(MPI_IN_PLACE, &lmax_size0, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(MPI_IN_PLACE, &lmass_d0, 1, MPI_PARTHENON_REAL, MPI_SUM, MPI_COMM_WORLD); +#endif // MPI_PARALLEL + + mass_d0 = lmass_d0; + max_size0 = lmax_size0; +} + +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::PostCoagulationDiagnostics +// \brief Gather post-coagulation diagnostics +template +static void PostCoagulationDiagnostics(MeshData *md, T &vmesh, const Real &dfloor, + Real &mass_d1, int &max_size1, int &max_calls) { + // Indexing + IndexRange ib = md->GetBoundsI(IndexDomain::interior); + IndexRange jb = md->GetBoundsJ(IndexDomain::interior); + IndexRange kb = md->GetBoundsK(IndexDomain::interior); + + // Reduction + Real lmass_d1 = 0.0; + int lmax_size1 = 1; + int lmax_calls = 1; + Kokkos::parallel_reduce( + "coag::post-diag", + Kokkos::MDRangePolicy>( + {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), + KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, + int &lmax1, int &lmax2) { + geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); + const Real &vol = coords.Volume(); + + // Sum over nspecies + for (int n = 0; n < vmesh.GetSize(b, dust::cons::density()); ++n) { + const Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + lsum += dens_d * vol; + } + + // Maxes + for (int n = vmesh.GetSize(b, dust::cons::density()) - 1; n >= 0; --n) { + const Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); + if (dens_d > dfloor) { + lmax1 = std::max(lmax1, n); + break; + } + } + lmax2 = + std::max(lmax2, static_cast(vmesh(b, dust::coag::ncalls(), k, j, i))); + }, + Kokkos::Sum(lmass_d1), Kokkos::Max(lmax_size1), + Kokkos::Max(lmax_calls)); + Kokkos::fence(); + +#ifdef MPI_PARALLEL + // over all processors + MPI_Allreduce(MPI_IN_PLACE, &lmass_d1, 1, MPI_PARTHENON_REAL, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(MPI_IN_PLACE, &lmax_size1, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(MPI_IN_PLACE, &lmax_calls, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); +#endif // MPI_PARALLEL + + mass_d1 = lmass_d1; + max_size1 = lmax_size1; + max_calls = lmax_calls; +} + +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::WriteCoagulationDiagnostics +// \brief Write coagulation diagnostics to file +static void WriteCoagulationDiagnostics(MeshData *md, const Real time, + const Real dt, const int max_calls, + const int max_size1, const int max_size0, + const Real mass_d1, const Real mass_d0) { + if (parthenon::Globals::my_rank == 0) { + auto pm = md->GetParentPointer(); + auto &artemis_pkg = pm->packages.Get("artemis"); + std::string fname; + fname.assign(artemis_pkg->template Param("job_name")); + fname.append("_info.dat"); + static FILE *pfile = NULL; + + // The file exists -- reopen the file in append mode + if (pfile == NULL) { + if ((pfile = std::fopen(fname.c_str(), "r")) != nullptr) { + if ((pfile = std::freopen(fname.c_str(), "a", pfile)) == nullptr) { + PARTHENON_FAIL("Error output file could not be opened"); + } + // The file does not exist -- open the file in write mode and add headers + } else { + if ((pfile = std::fopen(fname.c_str(), "w")) == nullptr) { + PARTHENON_FAIL("Error output file could not be opened"); + } + std::string label = "# time dt max_calls max_size1 max_size0 "; + label.append("mass_d1 mass_d0 delta \n"); + std::fprintf(pfile, "%s", label.c_str()); + } + } + std::fprintf(pfile, " %24.16e ", time); + std::fprintf(pfile, " %24.16e ", dt); + std::fprintf(pfile, " %d %d %d ", max_calls, max_size1, max_size0); + std::fprintf(pfile, " %24.16e %24.16e %24.16e", mass_d1, mass_d0, + 1.0 - mass_d0 / mass_d1); + std::fprintf(pfile, "\n"); + } +} + +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::InitializeArray +// \brief Initialize static coagulation arrays +static void InitializeArray(const int nm, int &pgrid, const Real &rho_p, const Real &chi, + const Real &a, const ParArray1D dsize, + ParArray2D klf, ParArray1D mass_grid, + ParArray3D coag3d, ParArray3D cpod_notzero, + ParArray3D cpod_short) { + // Initialization Part I + const int ikdelta = coag2drv::kdelta; + const int icoef_fett = coag2drv::coef_fett; + parthenon::par_for( + parthenon::loop_pattern_flatrange_tag, "initializeCoag1", parthenon::DevExecSpace(), + 0, nm - 1, KOKKOS_LAMBDA(const int i) { + for (int j = 0; j < nm; j++) { + coag3d(ikdelta, i, j) = 0.0; + } + coag3d(ikdelta, i, i) = 1.0; + mass_grid(i) = 4.0 * M_PI / 3.0 * rho_p * dsize(i) * dsize(i) * dsize(i); + for (int j = 0; j < nm; j++) { + Real tmp1 = (1.0 - 0.5 * coag3d(ikdelta, i, j)); + coag3d(icoef_fett, i, j) = M_PI * SQR(dsize(i) + dsize(j)) * tmp1; + } + }); + + // Set fragmentation variables + const Real ten_a = std::pow(10.0, a); + const Real ten_ma = 1.0 / ten_a; + const int ce = int(-1.0 / a * std::log10(1.0 - ten_ma)) + 1; + + // Used in integration + pgrid = floor(1.0 / a); + + // Initialization Part II + const int iphifrag = coag2drv::phifrag; + const int iepsfrag = coag2drv::epsfrag; + const int iafrag = coag2drv::afrag; + const Real frag_slope = 2.0 - 11.0 / 6.0; + parthenon::par_for( + parthenon::loop_pattern_flatrange_tag, "initializeCoag2", parthenon::DevExecSpace(), + 0, nm - 1, KOKKOS_LAMBDA(const int i) { + Real sum_pF = 0.0; + for (int j = 0; j <= i; j++) { + coag3d(iphifrag, j, i) = std::pow(mass_grid(j), frag_slope); + sum_pF += coag3d(iphifrag, j, i); + } + // normalization + for (int j = 0; j <= i; j++) { + coag3d(iphifrag, j, i) /= sum_pF; // switch (i,j) from fortran + } + + // Cratering + for (int j = 0; j <= i - pgrid - 1; j++) { + // FRAGMENT DISTRIBUTION + // The largest fragment has the mass of the smaller collision partner + + // Mass bin of largest fragment + klf(i, j) = j; + + coag3d(iafrag, i, j) = (1.0 + chi) * mass_grid(j); + // |_______| + // | + // Mass of fragments + coag3d(iepsfrag, i, j) = chi * mass_grid(j) / (mass_grid(i) * (1.0 - ten_ma)); + } + + int i1 = std::max(0, i - pgrid); + for (int j = i1; j <= i; j++) { + // The largest fragment has the mass of the larger collison partner + klf(i, j) = i; + coag3d(iafrag, i, j) = (mass_grid(i) + mass_grid(j)); + } + }); + + // Initialization Part III + // --> dalp array + // --> D matrix + // --> E matrix + ParArray2D e("epod", nm, nm); + int idalp = coag2drv::dalp, idpod = coag2drv::dpod; + parthenon::par_for( + parthenon::loop_pattern_flatrange_tag, "initializeCoag4", parthenon::DevExecSpace(), + 0, nm - 1, KOKKOS_LAMBDA(const int k) { + for (int j = 0; j < nm; j++) { + if (j <= k + 1 - ce) { + coag3d(idalp, k, j) = 1.0; + coag3d(idpod, k, j) = -mass_grid(j) / (mass_grid(k) * (ten_a - 1.0)); + } else { + coag3d(idpod, k, j) = -1.0; + coag3d(idalp, k, j) = 0.0; + } + } + // for E matrix------------- + const Real mkkme = mass_grid(k) * (1.0 - ten_ma); + const Real mkpek = mass_grid(k) * (ten_a - 1.0); + const Real mkpeme = mass_grid(k) * (ten_a - ten_ma); + for (int j = 0; j < nm; ++j) { + if (j <= k - ce) { + e(k, j) = mass_grid(j) / mkkme; + } else { + Real theta1 = (mkpeme - mass_grid(j) < 0.0) ? 0.0 : 1.0; + e(k, j) = (1.0 - (mass_grid(j) - mkkme) / mkpek) * theta1; + } + } + }); + + // Initialization Part IV + // -->cpod array; + ParArray3D cpod("cpod", nm, nm, nm); + parthenon::par_for( + parthenon::loop_pattern_mdrange_tag, "initializeCoag6", parthenon::DevExecSpace(), + 0, nm - 1, 0, nm - 1, KOKKOS_LAMBDA(const int i, const int j) { + // initialize to zero first + for (int k = 0; k < nm; k++) { + cpod(i, j, k) = 0.0; + } + Real mloc = mass_grid(i) + mass_grid(j); + if (mloc < mass_grid(nm - 1)) { + int gg = 0; + for (int k = std::max(i, j); k < nm - 1; k++) { + if (mloc >= mass_grid(k) && mloc < mass_grid(k + 1)) { + gg = k; + break; + } + } + + cpod(i, j, gg) = + (mass_grid(gg + 1) - mloc) / (mass_grid(gg + 1) - mass_grid(gg)); + cpod(i, j, gg + 1) = 1.0 - cpod(i, j, gg); + + // modified cpod(*) array------------------------- + Real dtheta_ji = (j - i - 0.5 < 0.0) ? 0.0 : 1.0; // theta(j - i - 0.5); + for (int k = 0; k < nm; k++) { + Real theta_kj = (k - j - 1.5 < 0.0) ? 0.0 : 1.0; // theta(k - j - 1.5) + cpod(i, j, k) = (0.5 * coag3d(ikdelta, i, j) * cpod(i, j, k) + + cpod(i, j, k) * theta_kj * dtheta_ji); + } + cpod(i, j, j) += coag3d(idpod, j, i); + cpod(i, j, j + 1) += e(j + 1, i) * dtheta_ji; + + } // end if + }); + + // Initialization Part V + // -->cpod_nonzero and cpod_short array + parthenon::par_for( + parthenon::loop_pattern_mdrange_tag, "initializeCoag7", parthenon::DevExecSpace(), + 0, nm - 1, 0, nm - 1, KOKKOS_LAMBDA(const int i, const int j) { + if (j <= i) { + // initialize cpod_notzero(i, j, 4) and cpod_short(i, j, 4) + for (int k = 0; k < 4; k++) { + cpod_notzero(i, j, k) = 0; + cpod_short(i, j, k) = 0.0; + } + int inc = 0; + for (int k = 0; k < nm; ++k) { + Real dum = cpod(i, j, k) + cpod(j, i, k); + if (dum != 0.0) { + cpod_notzero(i, j, inc) = k; + cpod_short(i, j, inc) = dum; + inc++; + } + } + } + }); +} -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn Real Dust::Coagulation::v_rel_ormel +// \brief +KOKKOS_FORCEINLINE_FUNCTION Real v_rel_ormel(Real tau_1, Real tau_2, Real t0, Real v0, Real ts, Real vs, Real reynolds) { - Real st1, st2, tau_mx, tau_mn, vg2; - Real c0, c1, c2, c3, y_star, ya, eps; - Real hulp1, hulp2; - - // sort tau's 1--> correspond to the max. now + // Initialize variables to Null + Real st1 = Null(), st2 = Null(); + Real tau_mx = Null(), tau_mn = Null(); + Real vg2 = Null(); + Real c0 = Null(), c1 = Null(), c2 = Null(), c3 = Null(); + Real y_star = Null(), ya = Null(); + Real eps = Null(); + Real hulp1 = Null(), hulp2 = Null(); + + // Sort tau's 1--> correspond to the max. now if (tau_1 >= tau_2) { tau_mx = tau_1; tau_mn = tau_2; @@ -95,15 +419,16 @@ Real v_rel_ormel(Real tau_1, Real tau_2, Real t0, Real v0, Real ts, Real vs, vg2 = 1.5 * SQR(v0); // note the square ya = 1.6; // approximate solution for st*=y*st1; valid for st1 << 1. + // Return appropriate v_rel_ormel for regime Real sqRe = 1.0 / sqrt(reynolds); if (tau_mx < 0.2 * ts) { - // very small regime + // Very small regime return 1.5 * SQR((vs / ts * (tau_mx - tau_mn))); } else if (tau_mx < ts / ya) { return vg2 * (st1 - st2) / (st1 + st2) * (SQR(st1) / (st1 + sqRe) - SQR(st2) / (st2 + sqRe)); } else if (tau_mx < 5.0 * ts) { - // eq. 17 of oc07. the second term with st_i**2.0 is negligible (assuming re>>1) + // Eq. 17 of oc07. the second term with st_i**2.0 is negligible (assuming re>>1) // hulp1 = eq. 17; hulp2 = eq. 18 hulp1 = ((st1 - st2) / (st1 + st2) * @@ -113,7 +438,7 @@ Real v_rel_ormel(Real tau_1, Real tau_2, Real t0, Real v0, Real ts, Real vs, SQR(st2) / (st2 + sqRe); return vg2 * (hulp1 + hulp2); } else if (tau_mx < t0 / 5.0) { - // full intermediate regime + // Full intermediate regime eps = st2 / st1; // stopping time ratio return vg2 * (st1 * (2.0 * ya - (1.0 + eps) + 2.0 / (1.0 + eps) * @@ -138,26 +463,31 @@ Real v_rel_ormel(Real tau_1, Real tau_2, Real t0, Real v0, Real ts, Real vs, } } -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn Real Dust::Coagulation::theta +// \brief +KOKKOS_FORCEINLINE_FUNCTION Real theta(Real x) { return (x < 0 ? 0.0 : 1.0); } -// Function calculates the new Q value of a particle resulting of a -// collision of particles with masses m1, m2 and Q values Q1, Q2 -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn Real Dust::Coagulation::Qplus +// \brief Function calculates the new Q value of a particle resulting of a collision of +// particles with masses m1, m2 and Q values Q1, Q2 +KOKKOS_FORCEINLINE_FUNCTION Real Qplus(Real m1, Real Q1, Real m2, Real Q2) { return (m1 * Q1 + m2 * Q2) / (m1 + m2); } -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn Real Dust::Coagulation::CoagulationRate +// \brief +KOKKOS_FORCEINLINE_FUNCTION Real CoagulationRate(const int i, const int j, const Real kernel4[], const ScratchPad1D &vel, const ScratchPad1D &stoppingTime, const CoagParams &coag, const int itype) { - const Real &mass_gridi = coag.mass_grid(i); const Real &mass_gridj = coag.mass_grid(j); const Real &mass_gride = coag.mass_grid(coag.nm - 1); - if (mass_gridi + mass_gridj >= mass_gride) { - return 0.0; - } + if (mass_gridi + mass_gridj >= mass_gride) return 0.0; const Real &gasdens = kernel4[0]; const Real &alpha = kernel4[1]; @@ -172,25 +502,24 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], const Real mu = 2.3; //! mean molecular mass in proton masses const Real m_p = 1.6726231e-24; //! proton mass in g - // calculate some basic properties + // Calculate some basic properties const Real hg = cs / omega; Real re = alpha * sig_h2 * gasdens / (2.0 * mu * m_p); - if (coag.coord == 0) { - re *= std::sqrt(2.0 * M_PI) * hg; - } + if (!(coag.coord)) re *= std::sqrt(2.0 * M_PI) * hg; const Real tn = 1.0 / omega; const Real ts = tn / sqrt(re); const Real vn = std::sqrt(alpha) * cs; const Real vs = vn * std::pow(re, -0.25); - // calculate the relative velocities + // Calculate the relative velocities const Real c1 = 8.0 / M_PI * cs * cs * mu * m_p; + // Calculate Stokes number const Real stokes_i = tau_i * omega; const Real stokes_j = tau_j * omega; - // turbulent relative velocity + // Calculate turbulent relative velocity Real dv0 = v_rel_ormel(tau_i, tau_j, tn, vn, ts, vs, re); // Brownian motion relative velocities @@ -199,7 +528,7 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], Real dv2_ij; Real hij = 1.0; - if (coag.coord == 1) { // surface density + if (coag.coord) { // surface density const Real hi = std::min(std::sqrt(alpha / (std::min(0.5, stokes_i) * (SQR(stokes_i) + 1.0))), 1.0) * @@ -214,22 +543,22 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], dv2_ij = SQR(vs_i - vs_j); dv2_ij += (SQR(vel_i[0] - vel_j[0]) + SQR(vel_i[1] - vel_j[1])); hij = std::sqrt(2.0 * M_PI * (SQR(hi) + SQR(hj))); - } else { + } else { // 3D dv2_ij = (SQR(vel_i[0] - vel_j[0]) + SQR(vel_i[1] - vel_j[1]) + SQR(vel_i[2] - vel_j[2])); } - // after adding up all v_rel**2 take the square root + // After adding up all v_rel**2 take the square root const Real dv = std::sqrt(dv0 + dv2_ij); - // new pf calculation: for fragmenation + // New pf calculation: for fragmenation Real pf = 0.0; if (dv > 0.0) { const Real tmp = 1.5 * SQR(coag.vfrag / dv); pf = (tmp + 1.0) * std::exp(-tmp); } - int icoef_fett = coag2DRv::coef_fett; + const int icoef_fett = coag2drv::coef_fett; const Real &coef_fettij = coag.coagR3D(icoef_fett, i, j); if (itype == 0) { // coagulation if (coag.ibounce && dv > 0.0) { // including bouncing effect @@ -248,26 +577,23 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], } } -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::CoagulationSource +// \brief +KOKKOS_FORCEINLINE_FUNCTION void CoagulationSource(parthenon::team_mbr_t const &mbr, ScratchPad1D &source, const ScratchPad1D &distri, const int mimax, const Real kernel4[], const ScratchPad1D &vel, const ScratchPad1D &stoppingTime, const CoagParams &coag) { - - const int nm = coag.nm; - - // initialize source(*) - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int k) { - // for (int k = 0; k < nm; k++) { - source(k) = 0.0; - }); + // Initialize source(*) + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, + [&](const int k) { source(k) = 0.0; }); mbr.team_barrier(); // Adding coagulation source terms parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int i) { - // for (int i = 0; i <= mimax; i++) { for (int j = 0; j <= i; j++) { - // calculate the rate + // Calculate the Rate const Real fett_t = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 0); const Real Rc1 = distri(i) * distri(j) * fett_t; for (int nz = 0; nz < 4; nz++) { @@ -280,36 +606,34 @@ void CoagulationSource(parthenon::team_mbr_t const &mbr, ScratchPad1D &sou }); mbr.team_barrier(); - // FRAGMENTATION------------------------------------------------------ + // FRAGMENTATION------------------------------------------------------------------------ // Adding fragment distribution - const int pGrid = coag.pGrid; - int iaFrag = coag2DRv::aFrag; - int iphiFrag = coag2DRv::phiFrag, iepsFrag = coag2DRv::epsFrag; - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int k) { - // for (int k = 0; k < nm; k++) { - for (int j = k; j <= mimax; j++) { - // calculate As(j) on fly - Real As_j = 0.0; - for (int i2 = 0; i2 <= mimax; i2++) { - for (int j2 = 0; j2 <= i2; j2++) { - // int klf = (j2 <= i2 - pGrid - 1) ? j2 : i2; - // if (klf == j) { - if (coag.klf(i2, j2) == j) { - const Real fett_l = - CoagulationRate(i2, j2, kernel4, vel, stoppingTime, coag, 1); - As_j += coag.coagR3D(iaFrag, i2, j2) * distri(i2) * distri(j2) * fett_l; + const int pgrid = coag.pgrid; + int iafrag = coag2drv::afrag; + int iphifrag = coag2drv::phifrag, iepsfrag = coag2drv::epsfrag; + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, [&](const int k) { + for (int j = k; j <= mimax; j++) { + // Calculate As(j) on fly + Real As_j = 0.0; + for (int i2 = 0; i2 <= mimax; i2++) { + for (int j2 = 0; j2 <= i2; j2++) { + if (coag.klf(i2, j2) == j) { + const Real fett_l = + CoagulationRate(i2, j2, kernel4, vel, stoppingTime, coag, 1); + As_j += coag.coagR3D(iafrag, i2, j2) * distri(i2) * distri(j2) * fett_l; + } + } } + source(k) += coag.coagR3D(iphifrag, k, j) / coag.mass_grid(k) * As_j; } - } - source(k) += coag.coagR3D(iphiFrag, k, j) / coag.mass_grid(k) * As_j; - } - }); + }); mbr.team_barrier(); // Negative terms and cratering remnants parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int j) { - Real sum0(0.0); + Real sum0 = 0.0; for (int i = j; i <= mimax; i++) { const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); const Real Rf1 = distri(i) * distri(j) * fett_l; @@ -319,24 +643,23 @@ void CoagulationSource(parthenon::team_mbr_t const &mbr, ScratchPad1D &sou }); mbr.team_barrier(); - // for (int i = 0; i <= mimax; i++) { // Cratering parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int i) { - Real sum0(0.0); - for (int j = 0; j <= i - pGrid - 1; j++) { + Real sum0 = 0.0; + for (int j = 0; j <= i - pgrid - 1; j++) { const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); const Real Rf1 = distri(i) * distri(j) * fett_l; - const Real dummy = coag.coagR3D(iepsFrag, i, j) * Rf1; + const Real dummy = coag.coagR3D(iepsfrag, i, j) * Rf1; sum0 += dummy; } - if (i - pGrid - 1 >= 0) { + if (i - pgrid - 1 >= 0) { Kokkos::atomic_add(&source(i - 1), sum0); } Real sum1 = -sum0; // Full fragmentation (only negative terms) - int i1 = std::max(0, i - pGrid); + int i1 = std::max(0, i - pgrid); for (int j = i1; j <= i; j++) { const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); const Real Rf1 = distri(i) * distri(j) * fett_l; @@ -345,23 +668,23 @@ void CoagulationSource(parthenon::team_mbr_t const &mbr, ScratchPad1D &sou Kokkos::atomic_add(&source(i), sum1); }); mbr.team_barrier(); -} // end of subroutine source +} -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::Coagulation_nQ +// \brief +KOKKOS_FORCEINLINE_FUNCTION void Coagulation_nQ(parthenon::team_mbr_t const &mbr, ScratchPad1D &nQs, const ScratchPad1D &Q, const ScratchPad1D &distri, const int mimax, const Real kernel4[], const ScratchPad1D &vel, const ScratchPad1D &stoppingTime, const CoagParams &coag) { - - const int nm = coag.nm; - - int iaFrag = coag2DRv::aFrag; - int iphiFrag = coag2DRv::phiFrag, iepsFrag = coag2DRv::epsFrag; - int idalp = coag2DRv::dalp, idpod = coag2DRv::dpod; - // int ikdelta = coag2DRv::kdelta; // Adding coagulation source terms + const int iafrag = coag2drv::afrag; + const int iphifrag = coag2drv::phifrag; + const int iepsfrag = coag2drv::epsfrag; + const int idalp = coag2drv::dalp; + const int idpod = coag2drv::dpod; parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int i) { - // for (int i = 0; i <= mimax; i++) { for (int j = 0; j <= i; j++) { // calculate the rate const Real fett_t = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 0); @@ -392,45 +715,44 @@ void Coagulation_nQ(parthenon::team_mbr_t const &mbr, ScratchPad1D &nQs, }); mbr.team_barrier(); - // FRAGMENTATION------------------------------------------------------ + // FRAGMENTATION------------------------------------------------------------------------ - const int pGrid = coag.pGrid; // Adding fragment distribution - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int k) { - // for (int k = 0; k < nm; k++) { - for (int j = k; j <= mimax; j++) { - // calculate As(j) on fly - Real As_j = 0.0; - for (int i2 = 0; i2 <= mimax; i2++) { - for (int j2 = 0; j2 <= i2; j2++) { - int klf = (j2 <= i2 - pGrid - 1) ? j2 : i2; - // if (coag.klf(i2, j2) == j) { - if (klf == j) { - const Real fett_l = - CoagulationRate(i2, j2, kernel4, vel, stoppingTime, coag, 1); - Real Qf1; - const Real &mass_gridi2 = coag.mass_grid(i2); - const Real &mass_gridj2 = coag.mass_grid(j2); - const Real &aFragi2j2 = coag.coagR3D(iaFrag, i2, j2); - if (j2 <= i2 - pGrid - 1) { - Qf1 = Qplus(coag.chi * mass_gridj2, Q(i2), mass_gridj2, Q(j2)); - } else { - Qf1 = Qplus(mass_gridi2, Q(i2), mass_gridj2, Q(j2)); + const int pgrid = coag.pgrid; + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, [&](const int k) { + for (int j = k; j <= mimax; j++) { + // calculate As(j) on fly + Real As_j = 0.0; + for (int i2 = 0; i2 <= mimax; i2++) { + for (int j2 = 0; j2 <= i2; j2++) { + int klf = (j2 <= i2 - pgrid - 1) ? j2 : i2; + if (klf == j) { + const Real fett_l = + CoagulationRate(i2, j2, kernel4, vel, stoppingTime, coag, 1); + Real Qf1; + const Real &mass_gridi2 = coag.mass_grid(i2); + const Real &mass_gridj2 = coag.mass_grid(j2); + const Real &afragi2j2 = coag.coagR3D(iafrag, i2, j2); + if (j2 <= i2 - pgrid - 1) { + Qf1 = Qplus(coag.chi * mass_gridj2, Q(i2), mass_gridj2, Q(j2)); + } else { + Qf1 = Qplus(mass_gridi2, Q(i2), mass_gridj2, Q(j2)); + } + As_j += afragi2j2 * distri(i2) * distri(j2) * fett_l * Qf1; + } } - As_j += aFragi2j2 * distri(i2) * distri(j2) * fett_l * Qf1; } + const Real &mass_gridk = coag.mass_grid(k); + nQs(k) += coag.coagR3D(iphifrag, k, j) / mass_gridk * As_j; } - } - const Real &mass_gridk = coag.mass_grid(k); - nQs(k) += coag.coagR3D(iphiFrag, k, j) / mass_gridk * As_j; - } - }); + }); mbr.team_barrier(); // Negative terms and cratering remnants parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int j) { // Cratering - Real sum0(0.0); + Real sum0 = 0.0; for (int i = j; i <= mimax; i++) { const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); const Real Rf1 = distri(i) * distri(j) * fett_l; @@ -441,21 +763,21 @@ void Coagulation_nQ(parthenon::team_mbr_t const &mbr, ScratchPad1D &nQs, mbr.team_barrier(); parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, mimax, [&](const int i) { - Real sum0(0.0); - for (int j = 0; j <= i - pGrid - 1; j++) { + Real sum0 = 0.0; + for (int j = 0; j <= i - pgrid - 1; j++) { const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); const Real Rf1 = distri(i) * distri(j) * fett_l; - const Real dummy = coag.coagR3D(iepsFrag, i, j) * Rf1 * Q(i); + const Real dummy = coag.coagR3D(iepsfrag, i, j) * Rf1 * Q(i); sum0 += dummy; } - if (i - pGrid - 1 >= 0) { + if (i - pgrid - 1 >= 0) { Kokkos::atomic_add(&nQs(i - 1), sum0); } Real sum1 = -sum0; // Full fragmentation (only negative terms) - int i1 = std::max(0, i - pGrid); + int i1 = std::max(0, i - pgrid); for (int j = i1; j <= i; j++) { const Real fett_l = CoagulationRate(i, j, kernel4, vel, stoppingTime, coag, 1); const Real Rf1 = distri(i) * distri(j) * fett_l * Q(i); @@ -466,45 +788,49 @@ void Coagulation_nQ(parthenon::team_mbr_t const &mbr, ScratchPad1D &nQs, mbr.team_barrier(); } // end of subroutine source -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::Coagulation_nQs +// \brief +KOKKOS_FORCEINLINE_FUNCTION void Coagulation_nQs(parthenon::team_mbr_t const &mbr, const Real &dt, ScratchPad1D &Q, ScratchPad1D &nQs, ScratchPad1D &distri, const int mimax, const int nvel, const Real kernel4[], ScratchPad1D &vel, const ScratchPad1D &stoppingTime, const CoagParams &coag, ScratchPad1D &source) { - - const int nm = coag.nm - 1; - const Real mom_scale = 1.0e10; const Real mom_iscale = 1.0e-10; - for (int n = 0; n < nvel; n++) { - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { - Q(k) = vel(n + k * 3) * mom_scale; - nQs(k) = 0.0; // initialize source(*) - }); + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, + [&](const int k) { + Q(k) = vel(n + k * 3) * mom_scale; + nQs(k) = 0.0; // initialize source(*) + }); mbr.team_barrier(); Coagulation_nQ(mbr, nQs, Q, distri, mimax, kernel4, vel, stoppingTime, coag); - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { - const Real distri_k = distri(k) + dt * source(k); - if (distri_k > coag.dfloor / coag.mass_grid(k)) { - const Real nQ1 = distri(k) * Q(k) + dt * nQs(k); - vel(n + k * 3) = nQ1 / distri_k * mom_iscale; - } - }); + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, + [&](const int k) { + const Real distri_k = distri(k) + dt * source(k); + if (distri_k > coag.dfloor / coag.mass_grid(k)) { + const Real nQ1 = distri(k) * Q(k) + dt * nQs(k); + vel(n + k * 3) = nQ1 / distri_k * mom_iscale; + } + }); mbr.team_barrier(); - } // loop of n + } // update the density - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, [&](const int k) { distri(k) += dt * source(k); }); mbr.team_barrier(); } -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::Coagulation_nQs3 +// \brief +KOKKOS_FORCEINLINE_FUNCTION void Coagulation_nQs3(parthenon::team_mbr_t const &mbr, const Real &dt, ScratchPad1D &Q, ScratchPad1D &nQs, ScratchPad1D &distri, const int mimax, const int nvel, @@ -512,55 +838,58 @@ void Coagulation_nQs3(parthenon::team_mbr_t const &mbr, const Real &dt, const ScratchPad1D &stoppingTime, const CoagParams &coag, ScratchPad1D &source, ScratchPad1D &Q2, const int mimax2) { - - const int nm = coag.nm - 1; - const Real mom_scale = 1.0e10; const Real mom_iscale = 1.0e-10; - - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { - Q2(k) = nQs(k); // 2nd stage source - }); + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, + [&](const int k) { + Q2(k) = nQs(k); // 2nd stage source + }); mbr.team_barrier(); for (int n = 0; n < nvel; n++) { - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { - Q(k) = vel(n + k * 3) * mom_scale; - nQs(k) = 0.0; - }); + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, + [&](const int k) { + Q(k) = vel(n + k * 3) * mom_scale; + nQs(k) = 0.0; + }); mbr.team_barrier(); // 1st stage Coagulation_nQ(mbr, nQs, Q, distri, mimax, kernel4, vel, stoppingTime, coag); - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { - const Real distri_k = distri(k) + dt * source(k); - const Real nQ1 = distri(k) * Q(k) + dt * nQs(k); - Q(k) = nQ1 / distri_k; // intermediate Q - }); + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, + [&](const int k) { + const Real distri_k = distri(k) + dt * source(k); + const Real nQ1 = distri(k) * Q(k) + dt * nQs(k); + Q(k) = nQ1 / distri_k; // intermediate Q + }); mbr.team_barrier(); // 2nd stage Coagulation_nQ(mbr, nQs, Q, distri, mimax2, kernel4, vel, stoppingTime, coag); - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { - const Real nQ_o = distri(k) * vel(n + k * 3) * mom_scale; - const Real distri_k = distri(k) + 0.5 * dt * (source(k) + Q2(k)); - if (distri_k > coag.dfloor / coag.mass_grid(k)) { - Real nQ1 = nQ_o + 0.5 * dt * nQs(k); - vel(n + k * 3) = nQ1 / distri_k * mom_iscale; - } - }); + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, [&](const int k) { + const Real nQ_o = distri(k) * vel(n + k * 3) * mom_scale; + const Real distri_k = distri(k) + 0.5 * dt * (source(k) + Q2(k)); + if (distri_k > coag.dfloor / coag.mass_grid(k)) { + Real nQ1 = nQ_o + 0.5 * dt * nQs(k); + vel(n + k * 3) = nQ1 / distri_k * mom_iscale; + } + }); mbr.team_barrier(); } // update the density - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm, [&](const int k) { - distri(k) += 0.5 * dt * (source(k) + Q2(k)); - }); + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, + [&](const int k) { distri(k) += 0.5 * dt * (source(k) + Q2(k)); }); mbr.team_barrier(); } -KOKKOS_INLINE_FUNCTION +//---------------------------------------------------------------------------------------- +//! \fn void Dust::Coagulation::CoagulationOneCell +// \brief +KOKKOS_FORCEINLINE_FUNCTION void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, const Real &time, Real &dt_sync, const Real &gasdens, ScratchPad1D &dustdens, ScratchPad1D &stime, @@ -568,34 +897,23 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, ScratchPad1D &nQs, const Real &alpha, const Real &cs, const Real &omega, const CoagParams &coag, ScratchPad1D &source, int &nCall, ScratchPad1D &Q2) { - - int nm = coag.nm; - - Real dt, time_dummy, time_goal, hnext; - Real dt_sync1 = dt_sync; - - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int i) { - // convert to number density - const Real &mass_gridi = coag.mass_grid(i); - dustdens(i) /= mass_gridi; // number density - // take the floor value - dustdens(i) = std::max(dustdens(i), 0.01 * coag.dfloor / mass_gridi); -#ifdef COAGULATION_DEBUG - if (cell_i == 2 && dustdens[i] > coag.dfloor / mass_gridi) { - std::cout << " oneCellBeg: " << time << " " << i << " " << dustdens[i] << " " - << mass_gridi << " " << stime[i] << std::endl; - } -#endif - }); + parthenon::par_for_inner( + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, [&](const int i) { + // convert to number density + const Real &mass_gridi = coag.mass_grid(i); + dustdens(i) /= mass_gridi; // number density + // take the floor value + dustdens(i) = std::max(dustdens(i), 0.01 * coag.dfloor / mass_gridi); + }); mbr.team_barrier(); - nCall = 0; - // do time steps - time_dummy = time; - time_goal = time_dummy + dt_sync1; - dt = dt_sync1; - hnext = dt; + nCall = 0; + Real time_dummy = time; + Real dt_sync1 = dt_sync; + Real time_goal = time_dummy + dt_sync1; + Real dt = dt_sync1; + Real hnext = dt; dt_sync = 1e-15; // works H5 Real kernel[4]; @@ -603,11 +921,10 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, kernel[1] = alpha; kernel[2] = cs; kernel[3] = omega; - while (std::abs(time_dummy - time_goal) > 1e-6 * dt) { int mimax = 0; Kokkos::parallel_reduce( - Kokkos::TeamThreadRange(mbr, nm), + Kokkos::TeamThreadRange(mbr, coag.nm), [&](const int i, int &lmax) { if (dustdens(i) > coag.dfloor / coag.mass_grid(i)) { lmax = std::max(lmax, i); @@ -621,7 +938,7 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, // time step control dt_sync1 = std::numeric_limits::max(); // start with a large number Kokkos::parallel_reduce( - Kokkos::TeamThreadRange(mbr, nm), + Kokkos::TeamThreadRange(mbr, coag.nm), [&](const int i, Real &lmin) { if (dustdens(i) > coag.dfloor / coag.mass_grid(i) && source(i) < 0.0) { lmin = std::min(lmin, std::abs(dustdens(i) / source(i))); @@ -637,7 +954,7 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, source); } else { // integration: first-order - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, [&](const int i) { dustdens(i) += dt * source(i); }); mbr.team_barrier(); } @@ -653,7 +970,7 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, // Q(*) is temprary variable to store the dust number density mimax2 = 0; Kokkos::parallel_reduce( - Kokkos::TeamThreadRange(mbr, nm), + Kokkos::TeamThreadRange(mbr, coag.nm), [&](const int i, int &lmax) { Q(i) = dustdens(i) + h * source(i); if (Q(i) > coag.dfloor / coag.mass_grid(i)) { @@ -674,17 +991,12 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, lmax = std::max(lmax, std::abs(derr)); }, Kokkos::Max(errmax)); -#ifdef COAGULATION_DEBUG - if (cell_i == 2) - std::cout << nCall << " " << errmax << " " << coag.err_eps << " " << h << " " - << mimax << " " << mimax2 << std::endl; -#endif errmax /= coag.err_eps; if (errmax <= 1.0) break; h = std::max(coag.S * h * std::pow(errmax, coag.pshrink), 0.1 * h); - } // end of while (1) + } if (errmax > coag.errcon) { hnext = coag.S * h * std::pow(errmax, coag.pgrow); @@ -700,28 +1012,25 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, source, Q2, mimax2); } else { parthenon::par_for_inner( - DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, + DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, [&](const int i) { dustdens(i) += 0.5 * dt * (source(i) + nQs(i)); }); mbr.team_barrier(); } + } - } // end of if (coag.use_adaptive == 0) - - // Kokkos::single (Kokkos::PerTeam(mbr), [&]() { time_dummy += dt; nCall++; - //}); mbr.team_barrier(); if (coag.use_adaptive == 1) { dt_sync = std::max(hnext, dt_sync); hnext = std::min(hnext, time_goal - time_dummy); } - if (nCall > coag.nCall_mx) break; + if (nCall > coag.ncall_max) break; } // end of internal timestep // from number density to volume density - parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, + parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, [&](const int i) { dustdens(i) *= coag.mass_grid(i); }); mbr.team_barrier(); @@ -730,4 +1039,4 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, } // namespace Coagulation } // namespace Dust -#endif // DUST_COAGULATION_HPP_ +#endif // DUST_COAGULATION_COAGULATION_HPP_ diff --git a/src/dust/coagulation/params.yaml b/src/dust/coagulation/params.yaml index e93e7e8c..c831bc56 100644 --- a/src/dust/coagulation/params.yaml +++ b/src/dust/coagulation/params.yaml @@ -22,7 +22,7 @@ coagulation: _default: "true" _description: "Turn on momentum-preserving coagulation" - coag_nsteps_mx: + coag_nsteps_max: _type: int _default: 1000 _description: "Maximum number of time-steps per coagulation call" @@ -38,7 +38,7 @@ coagulation: _description: "Turn on the bouncing impact on coagulation" _units: "cm" - nstep1Coag: + nstep_coag: _type: int _default: 50 _description: "Number of hydro steps between two coagulation calls" @@ -58,3 +58,7 @@ coagulation: _default: "false" _description: "Turn on output coagualtion info after each call" + surface_density_flag: + _type: bool + _default: "true" + _description: "Turn on the surface density flag" diff --git a/src/dust/dust.cpp b/src/dust/dust.cpp index c38a298b..8368173a 100644 --- a/src/dust/dust.cpp +++ b/src/dust/dust.cpp @@ -84,18 +84,15 @@ std::shared_ptr Initialize(ParameterInput *pin, for (int n = 0; n < nspecies; ++n) dustids.push_back(n); - bool hst_out_d2g = pin->GetOrAddBoolean("dust", "hst_out_d2g", false); - params.Add("hst_out_d2g", hst_out_d2g); - - // coagulation flag - bool do_coagulation = pin->GetOrAddBoolean("physics", "coagulation", false); - // Dust sizes const auto size_dist = pin->GetOrAddString("dust", "size_input", "direct"); - if (do_coagulation) { - PARTHENON_REQUIRE(size_dist == "logspace", - "dust coagulation requires size_input = logspace!"); - } + + // Check compatibility with coagulation + const bool do_coagulation = pin->GetOrAddBoolean("physics", "coagulation", false); + PARTHENON_REQUIRE(!(do_coagulation) || size_dist == "logspace", + "dust coagulation requires size_input = logspace!"); + + // Units const Real length_conv = units.GetLengthPhysicalToCode(); const Real rho_conv = units.GetMassDensityPhysicalToCode(); @@ -321,361 +318,6 @@ TaskStatus FluxSource(MeshData *md, const Real dt) { return TaskStatus::complete; } -//---------------------------------------------------------------------------------------- -//! \fn TaskStatus Dust::CoagulationOneStep -// \brief Wrapper function for coagulation procedure in one time step -template -TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt) { - - using parthenon::MakePackDescriptor; - auto pm = md->GetParentPointer(); - auto &artemis_pkg = pm->packages.Get("artemis"); - auto &dust_pkg = pm->packages.Get("dust"); - IndexRange ib = md->GetBoundsI(IndexDomain::interior); - IndexRange jb = md->GetBoundsJ(IndexDomain::interior); - IndexRange kb = md->GetBoundsK(IndexDomain::interior); - - auto &gas_pkg = pm->packages.Get("gas"); - auto eos_d = gas_pkg->template Param("eos_d"); - - auto &resolved_pkgs = pm->resolved_packages; - const int nspecies = dust_pkg->template Param("nspecies"); - auto &dust_size = dust_pkg->template Param>("sizes"); - - auto &coag_pkg = pm->packages.Get("coagulation"); - auto &coag = coag_pkg->template Param("coag_pars"); - - static auto desc = - MakePackDescriptor( - resolved_pkgs.get()); - - auto vmesh = desc.GetPack(md); - - const Real alpha = coag_pkg->template Param("coag_alpha"); // 1e-3 - int nvel = 3; - if (coag.coord) nvel = 2; // surface-density - auto &dfloor = dust_pkg->template Param("dfloor"); - - // unit: coagulation using cgs physical unit - auto &units = artemis_pkg->template Param("units"); - const Real time0 = units.GetTimeCodeToPhysical(); - const Real length0 = units.GetLengthCodeToPhysical(); - const Real rho0 = coag.rho0; - const Real vel0 = length0 / time0; - - const int scr_level = coag_pkg->template Param("coag_scr_level"); - auto info_out_flag = coag_pkg->template Param("coag_info_out"); - - size_t isize = (5 + nvel) * nspecies; - if (coag.integrator == 3 && coag.mom_coag) isize += nspecies; - size_t scr_size = ScratchPad1D::shmem_size(isize); - - auto pmb = md->GetBlockData(0)->GetBlockPointer(); - ParArray4D nCalls; - int maxCalls, maxSize, maxSize0; - Real massd0, massd; - if (info_out_flag) { - nCalls = ParArray4D("coag_nCalls", md->NumBlocks(), - pmb->cellbounds.ncellsk(IndexDomain::entire), - pmb->cellbounds.ncellsj(IndexDomain::entire), - pmb->cellbounds.ncellsi(IndexDomain::entire)); - maxCalls = 0; - maxSize = 1; - massd = 0.0; - - maxSize0 = 1; - massd0 = 0.0; - - Kokkos::parallel_reduce( - "coag::maxSize0", - Kokkos::MDRangePolicy>( - {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, - int &lmax) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - for (int n = 0; n < nspecies; ++n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - lsum += dens_d * coords.Volume(); - } - for (int n = nspecies - 1; n >= 0; --n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - if (dens_d > dfloor) { - lmax = std::max(lmax, n); - break; - } - } - }, - massd0, Kokkos::Max(maxSize0)); -#ifdef MPI_PARALLEL - // Sum over all processors - MPI_Reduce(MPI_IN_PLACE, &maxSize0, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); - MPI_Reduce(MPI_IN_PLACE, &massd0, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); -#endif // MPI_PARALLEL - } // end if (info_out_flag) - - ArtemisUtils::par_for_outer( - DEFAULT_OUTER_LOOP_PATTERN, "Dust::Coagulation", parthenon::DevExecSpace(), - scr_size, scr_level, 0, md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(parthenon::team_mbr_t mbr, const int b, const int k, const int j, - const int i) { - // code-to-physical unit - // one-cell coagulation - const int nDust_live = (vmesh.GetUpperBound(b, dust::prim::density()) - - vmesh.GetLowerBound(b, dust::prim::density()) + 1); - - const Real dens_g = vmesh(b, gas::prim::density(0), k, j, i); - Real dt_sync = dt * time0; - - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - const auto &hx = coords.GetScaleFactors(); - const auto &xv = coords.GetCellCenter(); - const auto &xcyl = coords.ConvertToCyl(xv); - - const Real rad = coag.const_omega ? 1.0 : xcyl[0]; // cylindrical - - const Real Omega_k = 1.0 / std::sqrt(rad) / rad; // code-unit - - int nCall1 = 0; - - const Real sie = vmesh(b, gas::prim::sie(0), k, j, i); - const Real bulk = eos_d.BulkModulusFromDensityInternalEnergy(dens_g, sie); - const Real cs1 = std::sqrt(bulk / dens_g) * vel0; - const Real omega1 = Omega_k / time0; - const int nm = nspecies; - const Real time1 = time * time0; - const Real dens_g1 = dens_g * rho0; - - ScratchPad1D rhod(mbr.team_scratch(scr_level), nspecies); - ScratchPad1D stime(mbr.team_scratch(scr_level), nspecies); - ScratchPad1D vel(mbr.team_scratch(scr_level), nvel * nspecies); - ScratchPad1D source(mbr.team_scratch(scr_level), nspecies); - ScratchPad1D Q(mbr.team_scratch(scr_level), nspecies); - ScratchPad1D nQs(mbr.team_scratch(scr_level), nspecies); - [[maybe_unused]] ScratchPad1D Q2; - if (coag.integrator == 3 && coag.mom_coag) { - Q2 = ScratchPad1D(mbr.team_scratch(scr_level), nspecies); - } - - // calculate the stopping time on the fly - Real st0 = 1.0; - if (coag.coord) { // surface density - st0 = 0.5 * M_PI * coag.rho_p / dens_g1 / omega1; - } else { - st0 = std::sqrt(M_PI / 8.0) * coag.rho_p / dens_g1 / cs1; - } - - parthenon::par_for_inner( - DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { - // calculate the stopping time on fly - stime(n) = st0 * dust_size(n) * length0; - if (vmesh(b, dust::prim::density(n), k, j, i) > dfloor) { - rhod(n) = vmesh(b, dust::prim::density(n), k, j, i) * rho0; - for (int d = 0; d < nvel; d++) { - vel(VI(n, d)) = - vmesh(b, dust::prim::velocity(VI(n, d)), k, j, i) * vel0; - } - } else { - rhod(n) = 0.0; - for (int d = 0; d < nvel; d++) { - vel(VI(n, d)) = 0.0; - } - } - }); - - Coagulation::CoagulationOneCell(mbr, i, time1, dt_sync, dens_g1, rhod, stime, vel, - nvel, Q, nQs, alpha, cs1, omega1, coag, source, - nCall1, Q2); - - if (info_out_flag) nCalls(b, k, j, i) = nCall1; - - // update dust density and velocity after coagulation - parthenon::par_for_inner( - DEFAULT_INNER_LOOP_PATTERN, mbr, 0, nm - 1, [&](const int n) { - // for (int n = 0; n < nspecies; ++n) { - if (rhod(n) > 0.0) { - const Real rhod1 = rhod(n); - vmesh(b, dust::cons::density(n), k, j, i) = rhod1 / rho0; - for (int d = 0; d < nvel; d++) { - vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = - rhod1 * vel(VI(n, d)) * hx[d] / vel0; - } - } else { - vmesh(b, dust::cons::density(n), k, j, i) = 0.0; - for (int d = 0; d < nvel; d++) { - vmesh(b, dust::cons::momentum(VI(n, d)), k, j, i) = 0.0; - } - } - }); - }); // end of par_for_outer - - if (info_out_flag) { - Real sumd0 = 0.0; - int maxCalls1 = 1, maxSize1 = 1; - Kokkos::parallel_reduce( - "coag::nCallsMaximum", - Kokkos::MDRangePolicy>( - {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, - int &lmax1, int &lmax2) { - geometry::Coords coords(vmesh.GetCoordinates(b), k, j, i); - const Real vol00 = coords.Volume(); - for (int n = 0; n < nspecies; ++n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - lsum += dens_d * vol00; - } - lmax1 = std::max(lmax1, nCalls(b, k, j, i)); - for (int n = nspecies - 1; n >= 0; --n) { - Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - if (dens_d > dfloor) { - lmax2 = std::max(lmax2, n); - break; - } - } - }, - Kokkos::Sum(sumd0), Kokkos::Max(maxCalls1), - Kokkos::Max(maxSize1)); - massd += sumd0; - maxCalls = std::max(maxCalls, maxCalls1); - maxSize = std::max(maxSize, maxSize1); - -#ifdef MPI_PARALLEL - // over all processors - MPI_Reduce(MPI_IN_PLACE, &maxCalls, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); - MPI_Reduce(MPI_IN_PLACE, &maxSize, 1, MPI_INT, MPI_MAX, 0, MPI_COMM_WORLD); - MPI_Reduce(MPI_IN_PLACE, &massd, 1, MPI_PARTHENON_REAL, MPI_SUM, 0, MPI_COMM_WORLD); -#endif // MPI_PARALLEL - - if (parthenon::Globals::my_rank == 0) { - std::string fname; - fname.assign(artemis_pkg->template Param("job_name")); - fname.append("_info.dat"); - static FILE *pfile = NULL; - - // The file exists -- reopen the file in append mode - if (pfile == NULL) { - if ((pfile = std::fopen(fname.c_str(), "r")) != nullptr) { - if ((pfile = std::freopen(fname.c_str(), "a", pfile)) == nullptr) { - PARTHENON_FAIL("Error output file could not be opened"); - } - // The file does not exist -- open the file in write mode and add headers - } else { - if ((pfile = std::fopen(fname.c_str(), "w")) == nullptr) { - PARTHENON_FAIL("Error output file could not be opened"); - } - std::string label = "# time dt maxCall end_maxSize beg_massSize "; - label.append("end_total_massd beg_total_massd diff_massd \n"); - std::fprintf(pfile, label.c_str()); - } - } - std::fprintf(pfile, " %e ", time); - std::fprintf(pfile, " %e ", dt); - std::fprintf(pfile, " %d %d %d ", maxCalls, maxSize, maxSize0); - std::fprintf(pfile, " %e %e %e", massd, massd0, (massd - massd0) / massd); - std::fprintf(pfile, "\n"); - } - } // end if (info_out_flag) - - return TaskStatus::complete; -} - -//---------------------------------------------------------------------------------------- -//! \fn TaskCollection Dust::OperatorSplitDust -//! \brief dust wrapper function for operatorsplitDust -template -TaskListStatus OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm) { - auto &coag_pkg = pm->packages.Get("coagulation"); - auto *dtCoag = coag_pkg->MutableParam("dtCoag"); - int nstep1Coag = coag_pkg->template Param("nstep1Coag"); - if (tm.ncycle == 0) { - *dtCoag = 0.0; - } - - *dtCoag += tm.dt; - if ((tm.ncycle + 1) % nstep1Coag != 0) { - return TaskListStatus::complete; - } - - const Real time_local = tm.time + tm.dt - (*dtCoag); - const Real dt_local = (*dtCoag); - if (parthenon::Globals::my_rank == 0) { - std::cout << "coagulation at: time,dt,cycle=" << time_local << " " << dt_local << " " - << tm.ncycle << std::endl; - } - - TaskCollection tc; - TaskID none(0); - - // Assemble tasks - auto &coag = coag_pkg->template Param("coag_pars"); - const int nspecies = coag.nm; - std::vector dust_var_names; - for (int n = 0; n < nspecies; n++) { - dust_var_names.push_back(dust::prim::density::name() + '_' + std::to_string(n)); - dust_var_names.push_back(dust::prim::velocity::name() + '_' + std::to_string(n)); - } - auto &dust_subset = - pm->mesh_data.AddShallow("dust_subset", pm->mesh_data.Get(), dust_var_names); - - using namespace ::parthenon::Update; - const int num_partitions = pm->DefaultNumPartitions(); - TaskRegion &tr = tc.AddRegion(num_partitions); - for (int i = 0; i < num_partitions; i++) { - auto &tl = tr[i]; - auto &base = pm->mesh_data.GetOrAdd("base", i); - auto coag_step = - tl.AddTask(none, CoagulationOneStep, base.get(), time_local, dt_local); - - // Set (remaining) fields to be communicated - auto pre_comm = tl.AddTask(coag_step, PreCommFillDerived>, base.get()); - - // Set boundary conditions (both physical and logical) - // auto bcs = parthenon::AddBoundaryExchangeTasks(pre_comm, tl, base, pm->multilevel); - auto &md_coag = pm->mesh_data.GetOrAdd("dust_subset", i); - auto bcs = parthenon::AddBoundaryExchangeTasks(pre_comm, tl, md_coag, pm->multilevel); - - // Sync fields - auto p2c = tl.AddTask(bcs, FillDerived>, base.get()); - } - *dtCoag = 0.0; - - return tc.Execute(); -} - -//---------------------------------------------------------------------------------------- -//! \fn void Dust::ReduceD2gMaximum -// \brief calculate dust-to-gas ratio maximum -std::vector ReduceD2gMaximum(MeshData *md) { - auto pm = md->GetParentPointer(); - auto &resolved_pkgs = pm->resolved_packages; - - const auto ib = md->GetBoundsI(IndexDomain::interior); - const auto jb = md->GetBoundsJ(IndexDomain::interior); - const auto kb = md->GetBoundsK(IndexDomain::interior); - - static auto desc = - MakePackDescriptor(resolved_pkgs.get()); - auto vmesh = desc.GetPack(md); - const int nblocks = md->NumBlocks(); - std::vector max_d2g(1, 0); - parthenon::par_reduce( - parthenon::loop_pattern_mdrange_tag, "ReduceD2gMaximum", parthenon::DevExecSpace(), - 0, md->NumBlocks() - 1, kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lmax) { - const Real &rhog = vmesh(b, gas::prim::density(0), k, j, i); - const int nspecies = (vmesh.GetUpperBound(b, dust::prim::density()) - - vmesh.GetLowerBound(b, dust::prim::density())) + - 1; - Real rhod = 0.0; - for (int n = 0; n < nspecies; ++n) { - rhod += vmesh(b, dust::prim::density(n), k, j, i); - } - lmax = std::max(lmax, rhod / rhog); - }, - Kokkos::Max(max_d2g[0])); - return max_d2g; -} - //---------------------------------------------------------------------------------------- //! \fn void Dust::AddHistoryImpl //! \brief Add history outputs for dust quantities for generic coordinate system @@ -723,42 +365,15 @@ void AddHistory(Coordinates coords, Params ¶ms) { //---------------------------------------------------------------------------------------- //! template instantiations -template Real EstimateTimestepMesh(MeshData *md); -template Real EstimateTimestepMesh(MeshData *md); -template Real EstimateTimestepMesh(MeshData *md); -template Real EstimateTimestepMesh(MeshData *md); -template Real EstimateTimestepMesh(MeshData *md); -template Real EstimateTimestepMesh(MeshData *md); - -template TaskStatus CoagulationOneStep(MeshData *md, - const Real time, - const Real dt); -template TaskStatus CoagulationOneStep(MeshData *md, - const Real time, - const Real dt); -template TaskStatus CoagulationOneStep(MeshData *md, - const Real time, - const Real dt); -template TaskStatus CoagulationOneStep(MeshData *md, - const Real time, - const Real dt); -template TaskStatus CoagulationOneStep(MeshData *md, - const Real time, - const Real dt); -template TaskStatus CoagulationOneStep(MeshData *md, - const Real time, - const Real dt); -template TaskListStatus OperatorSplitDust(Mesh *pm, - parthenon::SimTime &tm); -template TaskListStatus -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); -template TaskListStatus -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); -template TaskListStatus -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); -template TaskListStatus -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); -template TaskListStatus -OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); +typedef Coordinates G; +typedef Mesh M; +typedef MeshData MD; +typedef parthenon::SimTime ST; +template Real EstimateTimestepMesh(MD *md); +template Real EstimateTimestepMesh(MD *md); +template Real EstimateTimestepMesh(MD *md); +template Real EstimateTimestepMesh(MD *md); +template Real EstimateTimestepMesh(MD *md); +template Real EstimateTimestepMesh(MD *md); } // namespace Dust diff --git a/src/dust/dust.hpp b/src/dust/dust.hpp index eec015b3..d9d4ad15 100644 --- a/src/dust/dust.hpp +++ b/src/dust/dust.hpp @@ -32,13 +32,6 @@ TaskStatus FluxSource(MeshData *md, const Real dt); void AddHistory(Coordinates coords, Params ¶ms); -// OperatorSplit tasks -template -TaskListStatus OperatorSplitDust(Mesh *pm, parthenon::SimTime &tm); - -template -TaskStatus CoagulationOneStep(MeshData *md, const Real time, const Real dt); - } // namespace Dust #endif // DUST_DUST_HPP_ diff --git a/src/dust/params.yaml b/src/dust/params.yaml index 509f9291..8c689dde 100644 --- a/src/dust/params.yaml +++ b/src/dust/params.yaml @@ -120,8 +120,4 @@ dust: stokes: _type: opt _description: "Stopping times between the gas and dust fluid are in the Stokes regime" - - surface_density_flag: - _type: bool - _default: "true" - _description: "Turn on the surface density flag" + \ No newline at end of file diff --git a/src/pgen/dust_coagulation.hpp b/src/pgen/coag.hpp similarity index 74% rename from src/pgen/dust_coagulation.hpp rename to src/pgen/coag.hpp index 93f5563a..e485a90d 100644 --- a/src/pgen/dust_coagulation.hpp +++ b/src/pgen/coag.hpp @@ -18,11 +18,11 @@ // NOTE(@pdmullen): The following is taken directly from the open-source // Athena++-dustfluid software, and adapted for Parthenon/Artemis by @Shengtai on 7/30/24 -//! \file dust_coagulation.hpp +//! \file coag.hpp //! \brief dust collision problem generator for 1D problems. -#ifndef PGEN_DUST_COAGULATION_HPP_ -#define PGEN_DUST_COAGULATION_HPP_ +#ifndef PGEN_COAG_HPP_ +#define PGEN_COAG_HPP_ // C/C++ headers #include @@ -46,10 +46,10 @@ namespace { //---------------------------------------------------------------------------------------- //! \struct DustCoagulationVariable -//! \brief container for variables shared with dust_coagulation pgen +//! \brief container for variables shared with coag pgen struct DustCoagulationVariable { - int nDust; - int nInit_dust; + int ndust; + int ninit_dust; Real gamma, gm1; Real h0; Real d2g; @@ -58,60 +58,66 @@ struct DustCoagulationVariable { } // end anonymous namespace -namespace dust_coagulation { +namespace coag { DustCoagulationVariable dcv; //---------------------------------------------------------------------------------------- -//! \fn void ProblemGenerator::DustCollision_() +//! \fn void ProblemGenerator::DustCoagulation_() //! \brief Sets initial conditions for dust coagulation tests template inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { using parthenon::MakePackDescriptor; + // Require Cartesian geometry auto artemis_pkg = pmb->packages.Get("artemis"); const auto geom = artemis_pkg->Param("coords"); PARTHENON_REQUIRE(geom == Coordinates::cartesian, - "dust_coagulation pgen requires Cartesian geometry!"); + "coag pgen requires Cartesian geometry!"); + + // Require dust physics const bool do_dust = artemis_pkg->Param("do_dust"); - PARTHENON_REQUIRE(do_dust, "dust_coagulation pgen requires do_dust=true!"); + PARTHENON_REQUIRE(do_dust, "coag pgen requires do_dust=true!"); + // Require coagulation auto &dust_pkg = pmb->packages.Get("dust"); - const bool do_coagulation = artemis_pkg->Param("do_coagulation"); - PARTHENON_REQUIRE(do_coagulation, - "dust_coagulation pgen requires physics coagulation=true!"); + PARTHENON_REQUIRE(do_coagulation, "coag pgen requires physics coagulation=true!"); - // read global parameters - dcv.nDust = pin->GetOrAddReal("dust", "nspecies", 121); - dcv.nInit_dust = pin->GetOrAddReal("problem", "nInit_dust", 1); + // Read global parameters + dcv.ndust = dust_pkg->Param("nspecies"); + dcv.ninit_dust = pin->GetOrAddReal("problem", "ninit_dust", 1); dcv.d2g = pin->GetOrAddReal("problem", "dust_to_gas", 0.01); dcv.rho0 = pin->GetOrAddReal("problem", "rho0", 1.0); - // using MRN distribution for the initial dust setup - ParArray1D dust_size = dust_pkg->template Param>("sizes"); - auto gas_pkg = pmb->packages.Get("gas"); auto eos_d = gas_pkg->template Param("eos_d"); + // Extract adiabatic index and H0 dcv.gamma = gas_pkg->Param("adiabatic_index"); dcv.gm1 = dcv.gamma - 1.0; dcv.h0 = pin->GetOrAddReal("problem", "h0", 0.05); + // Extract fluid state vector const Real gdens = dcv.rho0; const auto mu = gas_pkg->Param("mu"); - auto &constants = artemis_pkg->Param("constants"); + const auto &constants = artemis_pkg->Param("constants"); const Real kbmu = constants.GetKBCode() / (mu * constants.GetAMUCode()); const Real gtemp = SQR(dcv.h0) / kbmu / dcv.gamma; const Real gsie = eos_d.InternalEnergyFromDensityTemperature(gdens, gtemp); const Real pres = eos_d.PressureFromDensityTemperature(gdens, gtemp); if (pmb->gid == 0) { - std::cout << "gamma,cs,pre=" << dcv.gamma << " " << dcv.h0 << " " - << gsie * dcv.gm1 * gdens << " " << pres << std::endl; + std::cout << "gamma, h0, pres=" << dcv.gamma << " " << dcv.h0 << " " + << dcv.gm1 * gdens * gsie << " " << pres << std::endl; } - const Real vx_g = 0.0; - const Real vx_d = 0.0; + // Using MRN distribution for the initial dust setup + ParArray1D dust_size = dust_pkg->template Param>("sizes"); + Real sum1 = 0.0; + auto &dcoag = dcv; + pmb->par_reduce( + "pgen_partialSum", 0, dcoag.ninit_dust - 1, + KOKKOS_LAMBDA(const int n, Real &lsum) { lsum += std::sqrt(dust_size(n)); }, sum1); // packing and capture variables for kernel auto &md = pmb->meshblock_data.Get(); @@ -126,38 +132,37 @@ inline void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { IndexRange ib = pmb->cellbounds.GetBoundsI(IndexDomain::entire); IndexRange jb = pmb->cellbounds.GetBoundsJ(IndexDomain::entire); IndexRange kb = pmb->cellbounds.GetBoundsK(IndexDomain::entire); - auto &dcoag = dcv; - - Real sum1 = 0.0; - pmb->par_reduce( - "pgen_partialSum", 0, dcoag.nInit_dust - 1, - KOKKOS_LAMBDA(const int n, Real &lsum) { lsum += std::sqrt(dust_size(n)); }, sum1); + // Initialize state vectors + const Real vx_g = 0.0; + const Real vx_d = 0.0; pmb->par_for( "pgen_dustCoagulation", kb.s, kb.e, jb.s, jb.e, ib.s, ib.e, KOKKOS_LAMBDA(const int k, const int j, const int i) { + // Set gas state vector v(0, gas::prim::density(0), k, j, i) = gdens; v(0, gas::prim::velocity(0), k, j, i) = vx_g; v(0, gas::prim::velocity(1), k, j, i) = 0.0; v(0, gas::prim::velocity(2), k, j, i) = 0.0; v(0, gas::prim::sie(0), k, j, i) = gsie; - for (int n = 0; n < dcoag.nInit_dust; ++n) { + // Set dust state vector + for (int n = 0; n < dcoag.ninit_dust; ++n) { const Real sratio = std::sqrt(dust_size(n)) / sum1; v(0, dust::prim::density(n), k, j, i) = dcoag.d2g * gdens * sratio; - v(0, dust::prim::velocity(n * 3 + 0), k, j, i) = vx_d; - v(0, dust::prim::velocity(n * 3 + 1), k, j, i) = 0.0; - v(0, dust::prim::velocity(n * 3 + 2), k, j, i) = 0.0; + v(0, dust::prim::velocity(VI(n, 0)), k, j, i) = vx_d; + v(0, dust::prim::velocity(VI(n, 1)), k, j, i) = 0.0; + v(0, dust::prim::velocity(VI(n, 2)), k, j, i) = 0.0; } - for (int n = dcoag.nInit_dust; n < dcoag.nDust; ++n) { + for (int n = dcoag.ninit_dust; n < dcoag.ndust; ++n) { v(0, dust::prim::density(n), k, j, i) = 0.0; - v(0, dust::prim::velocity(n * 3 + 0), k, j, i) = vx_d; - v(0, dust::prim::velocity(n * 3 + 1), k, j, i) = 0.0; - v(0, dust::prim::velocity(n * 3 + 2), k, j, i) = 0.0; + v(0, dust::prim::velocity(VI(n, 0)), k, j, i) = vx_d; + v(0, dust::prim::velocity(VI(n, 1)), k, j, i) = 0.0; + v(0, dust::prim::velocity(VI(n, 2)), k, j, i) = 0.0; } }); } -} // namespace dust_coagulation +} // namespace coag -#endif // PGEN_DUST_COAGULATION_HPP_ +#endif // PGEN_COAG_HPP_ diff --git a/src/pgen/pgen.hpp b/src/pgen/pgen.hpp index 7260bce3..ab652492 100644 --- a/src/pgen/pgen.hpp +++ b/src/pgen/pgen.hpp @@ -21,10 +21,10 @@ #include "advection.hpp" #include "beam.hpp" #include "blast.hpp" +#include "coag.hpp" #include "conduction.hpp" #include "constant.hpp" #include "disk.hpp" -#include "dust_coagulation.hpp" #include "gaussian_bump.hpp" #include "kh.hpp" #include "linear_wave.hpp" @@ -49,6 +49,8 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { beam::ProblemGenerator(pmb, pin); } else if (name == "blast") { blast::ProblemGenerator(pmb, pin); + } else if (name == "coag") { + coag::ProblemGenerator(pmb, pin); } else if (name == "conduction") { cond::ProblemGenerator(pmb, pin); } else if (name == "constant") { @@ -71,8 +73,6 @@ void ProblemGenerator(MeshBlock *pmb, ParameterInput *pin) { strat::ProblemGenerator(pmb, pin); } else if (name == "thermalization") { thermalization::ProblemGenerator(pmb, pin); - } else if (name == "dust_coagulation") { - dust_coagulation::ProblemGenerator(pmb, pin); } else { PARTHENON_FAIL("Invalid problem name!"); } diff --git a/tst/scripts/coagulation/coag_info_den.dat b/tst/scripts/coagulation/coag_info_den.dat index 9c81f60f..847685ed 100644 --- a/tst/scripts/coagulation/coag_info_den.dat +++ b/tst/scripts/coagulation/coag_info_den.dat @@ -1,168 +1,168 @@ -# time dt maxCall end_maxSize beg_massSize end_total_massd beg_total_massd diff_massd - 0.000000e+00 2.250000e+01 7 20 10 1.256637e-01 1.256637e-01 0.000000e+00 - 2.250000e+01 2.250000e+01 6 24 20 1.256637e-01 1.256637e-01 4.417437e-16 - 4.500000e+01 2.250000e+01 5 27 24 1.256637e-01 1.256637e-01 1.546103e-15 - 6.750000e+01 2.250000e+01 5 29 27 1.256637e-01 1.256637e-01 -1.104359e-15 - 9.000000e+01 2.250000e+01 4 30 29 1.256637e-01 1.256637e-01 1.546103e-15 - 1.125000e+02 2.250000e+01 4 32 30 1.256637e-01 1.256637e-01 -3.754821e-15 - 1.350000e+02 2.250000e+01 4 33 32 1.256637e-01 1.256637e-01 1.766975e-15 - 1.575000e+02 2.250000e+01 3 35 33 1.256637e-01 1.256637e-01 6.626156e-16 - 1.800000e+02 2.250000e+01 3 36 35 1.256637e-01 1.256637e-01 6.626156e-16 - 2.025000e+02 2.250000e+01 3 37 36 1.256637e-01 1.256637e-01 1.104359e-15 - 2.250000e+02 2.250000e+01 3 38 37 1.256637e-01 1.256637e-01 -8.834874e-16 - 2.475000e+02 2.250000e+01 3 39 38 1.256637e-01 1.256637e-01 -2.208719e-16 - 2.700000e+02 2.250000e+01 3 40 39 1.256637e-01 1.256637e-01 -6.626156e-16 - 2.925000e+02 2.250000e+01 3 41 40 1.256637e-01 1.256637e-01 2.208719e-16 - 3.150000e+02 2.250000e+01 3 42 41 1.256637e-01 1.256637e-01 -3.313078e-15 - 3.375000e+02 2.250000e+01 2 43 42 1.256637e-01 1.256637e-01 3.533950e-15 - 3.600000e+02 2.250000e+01 2 44 43 1.256637e-01 1.256637e-01 -4.417437e-16 - 3.825000e+02 2.250000e+01 2 45 44 1.256637e-01 1.256637e-01 3.313078e-15 - 4.050000e+02 2.250000e+01 2 46 45 1.256637e-01 1.256637e-01 -6.626156e-16 - 4.275000e+02 2.250000e+01 2 47 46 1.256637e-01 1.256637e-01 -4.417437e-16 - 4.500000e+02 2.250000e+01 2 48 47 1.256637e-01 1.256637e-01 -2.650462e-15 - 4.725000e+02 2.250000e+01 2 49 48 1.256637e-01 1.256637e-01 2.429590e-15 - 4.950000e+02 2.250000e+01 2 50 49 1.256637e-01 1.256637e-01 -5.080053e-15 - 5.175000e+02 2.250000e+01 2 51 50 1.256637e-01 1.256637e-01 3.092206e-15 - 5.400000e+02 2.250000e+01 2 52 51 1.256637e-01 1.256637e-01 2.871334e-15 - 5.625000e+02 2.250000e+01 2 53 52 1.256637e-01 1.256637e-01 -4.417437e-16 - 5.850000e+02 2.250000e+01 2 53 53 1.256637e-01 1.256637e-01 0.000000e+00 - 6.075000e+02 2.250000e+01 2 54 53 1.256637e-01 1.256637e-01 -2.208719e-15 - 6.300000e+02 2.250000e+01 2 55 54 1.256637e-01 1.256637e-01 3.313078e-15 - 6.525000e+02 2.250000e+01 2 56 55 1.256637e-01 1.256637e-01 -8.834874e-16 - 6.750000e+02 2.250000e+01 2 56 56 1.256637e-01 1.256637e-01 -1.766975e-15 - 6.975000e+02 2.250000e+01 2 57 56 1.256637e-01 1.256637e-01 -3.313078e-15 - 7.200000e+02 2.250000e+01 2 58 57 1.256637e-01 1.256637e-01 5.300924e-15 - 7.425000e+02 2.250000e+01 2 58 58 1.256637e-01 1.256637e-01 -4.417437e-15 - 7.650000e+02 2.250000e+01 2 59 58 1.256637e-01 1.256637e-01 1.325231e-15 - 7.875000e+02 2.250000e+01 2 60 59 1.256637e-01 1.256637e-01 -2.208719e-16 - 8.100000e+02 2.250000e+01 2 60 60 1.256637e-01 1.256637e-01 8.834874e-16 - 8.325000e+02 2.250000e+01 2 61 60 1.256637e-01 1.256637e-01 3.754821e-15 - 8.550000e+02 2.250000e+01 2 62 61 1.256637e-01 1.256637e-01 -2.429590e-15 - 8.775000e+02 2.250000e+01 2 62 62 1.256637e-01 1.256637e-01 -2.208719e-16 - 9.000000e+02 2.250000e+01 2 63 62 1.256637e-01 1.256637e-01 -1.325231e-15 - 9.225000e+02 2.250000e+01 2 63 63 1.256637e-01 1.256637e-01 2.208719e-16 - 9.450000e+02 2.250000e+01 2 64 63 1.256637e-01 1.256637e-01 3.975693e-15 - 9.675000e+02 2.250000e+01 2 64 64 1.256637e-01 1.256637e-01 -4.417437e-16 - 9.900000e+02 2.250000e+01 2 65 64 1.256637e-01 1.256637e-01 -6.405284e-15 - 1.012500e+03 2.250000e+01 2 65 65 1.256637e-01 1.256637e-01 2.429590e-15 - 1.035000e+03 2.250000e+01 2 66 65 1.256637e-01 1.256637e-01 -1.325231e-15 - 1.057500e+03 2.250000e+01 2 66 66 1.256637e-01 1.256637e-01 3.754821e-15 - 1.080000e+03 2.250000e+01 2 67 66 1.256637e-01 1.256637e-01 6.626156e-16 - 1.102500e+03 2.250000e+01 2 67 67 1.256637e-01 1.256637e-01 -2.208719e-16 - 1.125000e+03 2.250000e+01 2 68 67 1.256637e-01 1.256637e-01 -1.546103e-15 - 1.147500e+03 2.250000e+01 2 68 68 1.256637e-01 1.256637e-01 8.834874e-16 - 1.170000e+03 2.250000e+01 2 69 68 1.256637e-01 1.256637e-01 -1.987847e-15 - 1.192500e+03 2.250000e+01 2 69 69 1.256637e-01 1.256637e-01 6.626156e-16 - 1.215000e+03 2.250000e+01 2 70 69 1.256637e-01 1.256637e-01 -1.325231e-15 - 1.237500e+03 2.250000e+01 2 70 70 1.256637e-01 1.256637e-01 1.546103e-15 - 1.260000e+03 2.250000e+01 2 70 70 1.256637e-01 1.256637e-01 5.742668e-15 - 1.282500e+03 2.250000e+01 2 71 70 1.256637e-01 1.256637e-01 -9.276618e-15 - 1.305000e+03 2.250000e+01 2 71 71 1.256637e-01 1.256637e-01 3.313078e-15 - 1.327500e+03 2.250000e+01 2 72 71 1.256637e-01 1.256637e-01 1.546103e-15 - 1.350000e+03 2.250000e+01 2 72 72 1.256637e-01 1.256637e-01 -8.834874e-16 - 1.372500e+03 2.250000e+01 2 72 72 1.256637e-01 1.256637e-01 -8.834874e-16 - 1.395000e+03 2.250000e+01 2 73 72 1.256637e-01 1.256637e-01 1.987847e-15 - 1.417500e+03 2.250000e+01 2 73 73 1.256637e-01 1.256637e-01 -1.546103e-15 - 1.440000e+03 2.250000e+01 2 74 73 1.256637e-01 1.256637e-01 0.000000e+00 - 1.462500e+03 2.250000e+01 2 74 74 1.256637e-01 1.256637e-01 1.104359e-15 - 1.485000e+03 2.250000e+01 2 74 74 1.256637e-01 1.256637e-01 -2.208719e-16 - 1.507500e+03 2.250000e+01 2 75 74 1.256637e-01 1.256637e-01 -4.196565e-15 - 1.530000e+03 2.250000e+01 2 75 75 1.256637e-01 1.256637e-01 -6.626156e-16 - 1.552500e+03 2.250000e+01 2 76 75 1.256637e-01 1.256637e-01 6.184412e-15 - 1.575000e+03 2.250000e+01 2 76 76 1.256637e-01 1.256637e-01 -2.871334e-15 - 1.597500e+03 2.250000e+01 2 76 76 1.256637e-01 1.256637e-01 8.834874e-16 - 1.620000e+03 2.250000e+01 2 77 76 1.256637e-01 1.256637e-01 -2.650462e-15 - 1.642500e+03 2.250000e+01 2 77 77 1.256637e-01 1.256637e-01 2.429590e-15 - 1.665000e+03 2.250000e+01 2 77 77 1.256637e-01 1.256637e-01 5.080053e-15 - 1.687500e+03 2.250000e+01 2 78 77 1.256637e-01 1.256637e-01 -1.987847e-15 - 1.710000e+03 2.250000e+01 2 78 78 1.256637e-01 1.256637e-01 2.208719e-16 - 1.732500e+03 2.250000e+01 2 78 78 1.256637e-01 1.256637e-01 -3.533950e-15 - 1.755000e+03 2.250000e+01 2 79 78 1.256637e-01 1.256637e-01 -1.104359e-15 - 1.777500e+03 2.250000e+01 2 79 79 1.256637e-01 1.256637e-01 6.847027e-15 - 1.800000e+03 2.250000e+01 2 79 79 1.256637e-01 1.256637e-01 -7.067899e-15 - 1.822500e+03 2.250000e+01 2 80 79 1.256637e-01 1.256637e-01 0.000000e+00 - 1.845000e+03 2.250000e+01 2 80 80 1.256637e-01 1.256637e-01 1.766975e-15 - 1.867500e+03 2.250000e+01 2 80 80 1.256637e-01 1.256637e-01 2.429590e-15 - 1.890000e+03 2.250000e+01 2 81 80 1.256637e-01 1.256637e-01 -8.834874e-16 - 1.912500e+03 2.250000e+01 1 81 81 1.256637e-01 1.256637e-01 -2.429590e-15 - 1.935000e+03 2.250000e+01 1 81 81 1.256637e-01 1.256637e-01 3.092206e-15 - 1.957500e+03 2.250000e+01 1 81 81 1.256637e-01 1.256637e-01 1.546103e-15 - 1.980000e+03 2.250000e+01 1 82 81 1.256637e-01 1.256637e-01 2.208719e-16 - 2.002500e+03 2.250000e+01 1 82 82 1.256637e-01 1.256637e-01 -6.626156e-16 - 2.025000e+03 2.250000e+01 1 82 82 1.256637e-01 1.256637e-01 -1.987847e-15 - 2.047500e+03 2.250000e+01 1 82 82 1.256637e-01 1.256637e-01 1.766975e-15 - 2.070000e+03 2.250000e+01 1 83 82 1.256637e-01 1.256637e-01 -8.834874e-16 - 2.092500e+03 2.250000e+01 1 83 83 1.256637e-01 1.256637e-01 1.104359e-15 - 2.115000e+03 2.250000e+01 1 83 83 1.256637e-01 1.256637e-01 6.626156e-16 - 2.137500e+03 2.250000e+01 1 84 83 1.256637e-01 1.256637e-01 -4.417437e-15 - 2.160000e+03 2.250000e+01 1 84 84 1.256637e-01 1.256637e-01 3.313078e-15 - 2.182500e+03 2.250000e+01 1 84 84 1.256637e-01 1.256637e-01 -8.834874e-16 - 2.205000e+03 2.250000e+01 1 84 84 1.256637e-01 1.256637e-01 2.650462e-15 - 2.227500e+03 2.250000e+01 1 85 84 1.256637e-01 1.256637e-01 -1.325231e-15 - 2.250000e+03 2.250000e+01 1 85 85 1.256637e-01 1.256637e-01 -8.834874e-16 - 2.272500e+03 2.250000e+01 1 85 85 1.256637e-01 1.256637e-01 4.638309e-15 - 2.295000e+03 2.250000e+01 1 85 85 1.256637e-01 1.256637e-01 -4.196565e-15 - 2.317500e+03 2.250000e+01 1 86 85 1.256637e-01 1.256637e-01 -5.521796e-15 - 2.340000e+03 2.250000e+01 1 86 86 1.256637e-01 1.256637e-01 4.638309e-15 - 2.362500e+03 2.250000e+01 1 86 86 1.256637e-01 1.256637e-01 -3.533950e-15 - 2.385000e+03 2.250000e+01 1 86 86 1.256637e-01 1.256637e-01 5.080053e-15 - 2.407500e+03 2.250000e+01 1 87 86 1.256637e-01 1.256637e-01 -8.834874e-16 - 2.430000e+03 2.250000e+01 1 87 87 1.256637e-01 1.256637e-01 -3.975693e-15 - 2.452500e+03 2.250000e+01 1 87 87 1.256637e-01 1.256637e-01 4.859181e-15 - 2.475000e+03 2.250000e+01 1 87 87 1.256637e-01 1.256637e-01 -4.196565e-15 - 2.497500e+03 2.250000e+01 1 87 87 1.256637e-01 1.256637e-01 2.208719e-15 - 2.520000e+03 2.250000e+01 1 88 87 1.256637e-01 1.256637e-01 0.000000e+00 - 2.542500e+03 2.250000e+01 1 88 88 1.256637e-01 1.256637e-01 -2.208719e-16 - 2.565000e+03 2.250000e+01 1 88 88 1.256637e-01 1.256637e-01 2.429590e-15 - 2.587500e+03 2.250000e+01 1 88 88 1.256637e-01 1.256637e-01 -3.092206e-15 - 2.610000e+03 2.250000e+01 1 88 88 1.256637e-01 1.256637e-01 -4.417437e-16 - 2.632500e+03 2.250000e+01 1 89 88 1.256637e-01 1.256637e-01 3.092206e-15 - 2.655000e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 0.000000e+00 - 2.677500e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 -1.766975e-15 - 2.700000e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 5.521796e-15 - 2.722500e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 -4.417437e-15 - 2.745000e+03 2.250000e+01 1 89 89 1.256637e-01 1.256637e-01 -3.092206e-15 - 2.767500e+03 2.250000e+01 1 90 89 1.256637e-01 1.256637e-01 -3.313078e-15 - 2.790000e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 7.730515e-15 - 2.812500e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 -3.092206e-15 - 2.835000e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 -5.521796e-15 - 2.857500e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 3.754821e-15 - 2.880000e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 1.987847e-15 - 2.902500e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 -4.417437e-16 - 2.925000e+03 2.250000e+01 1 91 90 1.256637e-01 1.256637e-01 3.754821e-15 - 2.947500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -1.987847e-15 - 2.970000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 4.196565e-15 - 2.992500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -5.742668e-15 - 3.015000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -4.417437e-16 - 3.037500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 1.766975e-15 - 3.060000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -4.417437e-16 - 3.082500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -1.104359e-15 - 3.105000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 2.208719e-15 - 3.127500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 -8.834874e-16 - 3.150000e+03 2.250000e+01 1 92 91 1.256637e-01 1.256637e-01 1.546103e-15 - 3.172500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 -4.859181e-15 - 3.195000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 1.987847e-15 - 3.217500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 0.000000e+00 - 3.240000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 -1.766975e-15 - 3.262500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.417437e-16 - 3.285000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.417437e-16 - 3.307500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.417437e-16 - 3.330000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 -6.626156e-16 - 3.352500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 -3.975693e-15 - 3.375000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.859181e-15 - 3.397500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 3.533950e-15 - 3.420000e+03 2.250000e+01 1 93 92 1.256637e-01 1.256637e-01 -7.288771e-15 - 3.442500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 6.626156e-15 - 3.465000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 0.000000e+00 - 3.487500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -3.533950e-15 - 3.510000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 5.080053e-15 - 3.532500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -4.417437e-15 - 3.555000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 5.300924e-15 - 3.577500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -5.080053e-15 - 3.600000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 1.987847e-15 - 3.622500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 1.104359e-15 - 3.645000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -1.104359e-15 - 3.667500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -1.546103e-15 - 3.690000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 0.000000e+00 - 3.712500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 -1.546103e-15 - 3.735000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 6.626156e-16 +# time dt max_calls max_size1 max_size0 mass_d1 mass_d0 delta + 0.0000000000000000e+00 2.2500000000000000e+01 7 20 10 2.0053037235275938e-05 2.0053037235275924e-05 6.6613381477509392e-16 + 2.2500000000000000e+01 2.2500000000000000e+01 6 24 20 2.0053037235275972e-05 2.0053037235275938e-05 1.6653345369377348e-15 + 4.5000000000000000e+01 2.2500000000000000e+01 5 27 24 2.0053037235275951e-05 2.0053037235275972e-05 -1.1102230246251565e-15 + 6.7500000000000000e+01 2.2500000000000000e+01 5 29 27 2.0053037235275907e-05 2.0053037235275951e-05 -2.2204460492503131e-15 + 9.0000000000000000e+01 2.2500000000000000e+01 4 30 29 2.0053037235275941e-05 2.0053037235275907e-05 1.6653345369377348e-15 + 1.1250000000000000e+02 2.2500000000000000e+01 4 32 30 2.0053037235275924e-05 2.0053037235275941e-05 -8.8817841970012523e-16 + 1.3500000000000000e+02 2.2500000000000000e+01 4 33 32 2.0053037235275948e-05 2.0053037235275924e-05 1.2212453270876722e-15 + 1.5750000000000000e+02 2.2500000000000000e+01 3 35 33 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 + 1.8000000000000000e+02 2.2500000000000000e+01 3 36 35 2.0053037235275948e-05 2.0053037235275941e-05 3.3306690738754696e-16 + 2.0250000000000000e+02 2.2500000000000000e+01 3 37 36 2.0053037235275944e-05 2.0053037235275948e-05 -2.2204460492503131e-16 + 2.2500000000000000e+02 2.2500000000000000e+01 3 38 37 2.0053037235275958e-05 2.0053037235275944e-05 6.6613381477509392e-16 + 2.4750000000000000e+02 2.2500000000000000e+01 3 39 38 2.0053037235275958e-05 2.0053037235275958e-05 0.0000000000000000e+00 + 2.7000000000000000e+02 2.2500000000000000e+01 3 40 39 2.0053037235275924e-05 2.0053037235275958e-05 -1.7763568394002505e-15 + 2.9250000000000000e+02 2.2500000000000000e+01 3 41 40 2.0053037235275883e-05 2.0053037235275924e-05 -1.9984014443252818e-15 + 3.1500000000000000e+02 2.2500000000000000e+01 3 42 41 2.0053037235275907e-05 2.0053037235275883e-05 1.2212453270876722e-15 + 3.3750000000000000e+02 2.2500000000000000e+01 2 43 42 2.0053037235275955e-05 2.0053037235275907e-05 2.3314683517128287e-15 + 3.6000000000000000e+02 2.2500000000000000e+01 2 44 43 2.0053037235275907e-05 2.0053037235275955e-05 -2.4424906541753444e-15 + 3.8250000000000000e+02 2.2500000000000000e+01 2 45 44 2.0053037235275894e-05 2.0053037235275907e-05 -6.6613381477509392e-16 + 4.0500000000000000e+02 2.2500000000000000e+01 2 46 45 2.0053037235275894e-05 2.0053037235275894e-05 0.0000000000000000e+00 + 4.2750000000000000e+02 2.2500000000000000e+01 2 47 46 2.0053037235275944e-05 2.0053037235275894e-05 2.5535129566378600e-15 + 4.5000000000000000e+02 2.2500000000000000e+01 2 48 47 2.0053037235275985e-05 2.0053037235275944e-05 1.9984014443252818e-15 + 4.7250000000000000e+02 2.2500000000000000e+01 2 49 48 2.0053037235275955e-05 2.0053037235275985e-05 -1.5543122344752192e-15 + 4.9500000000000000e+02 2.2500000000000000e+01 2 50 49 2.0053037235275887e-05 2.0053037235275955e-05 -3.3306690738754696e-15 + 5.1750000000000000e+02 2.2500000000000000e+01 2 51 50 2.0053037235275955e-05 2.0053037235275887e-05 3.3306690738754696e-15 + 5.4000000000000000e+02 2.2500000000000000e+01 2 52 51 2.0053037235275968e-05 2.0053037235275955e-05 6.6613381477509392e-16 + 5.6250000000000000e+02 2.2500000000000000e+01 2 53 52 2.0053037235275961e-05 2.0053037235275968e-05 -4.4408920985006262e-16 + 5.8500000000000000e+02 2.2500000000000000e+01 2 53 53 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 + 6.0750000000000000e+02 2.2500000000000000e+01 2 54 53 2.0053037235275928e-05 2.0053037235275961e-05 -1.7763568394002505e-15 + 6.3000000000000000e+02 2.2500000000000000e+01 2 55 54 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 + 6.5250000000000000e+02 2.2500000000000000e+01 2 56 55 2.0053037235275904e-05 2.0053037235275975e-05 -3.5527136788005009e-15 + 6.7500000000000000e+02 2.2500000000000000e+01 2 56 56 2.0053037235275941e-05 2.0053037235275904e-05 1.8873791418627661e-15 + 6.9750000000000000e+02 2.2500000000000000e+01 2 57 56 2.0053037235275934e-05 2.0053037235275941e-05 -4.4408920985006262e-16 + 7.2000000000000000e+02 2.2500000000000000e+01 2 58 57 2.0053037235275890e-05 2.0053037235275934e-05 -2.2204460492503131e-15 + 7.4250000000000000e+02 2.2500000000000000e+01 2 58 58 2.0053037235275961e-05 2.0053037235275890e-05 3.5527136788005009e-15 + 7.6500000000000000e+02 2.2500000000000000e+01 2 59 58 2.0053037235275934e-05 2.0053037235275961e-05 -1.3322676295501878e-15 + 7.8750000000000000e+02 2.2500000000000000e+01 2 60 59 2.0053037235275883e-05 2.0053037235275934e-05 -2.4424906541753444e-15 + 8.1000000000000000e+02 2.2500000000000000e+01 2 60 60 2.0053037235275989e-05 2.0053037235275883e-05 5.2180482157382357e-15 + 8.3250000000000000e+02 2.2500000000000000e+01 2 61 60 2.0053037235275999e-05 2.0053037235275989e-05 5.5511151231257827e-16 + 8.5500000000000000e+02 2.2500000000000000e+01 2 62 61 2.0053037235275965e-05 2.0053037235275999e-05 -1.7763568394002505e-15 + 8.7750000000000000e+02 2.2500000000000000e+01 2 62 62 2.0053037235275955e-05 2.0053037235275965e-05 -4.4408920985006262e-16 + 9.0000000000000000e+02 2.2500000000000000e+01 2 63 62 2.0053037235275904e-05 2.0053037235275955e-05 -2.4424906541753444e-15 + 9.2250000000000000e+02 2.2500000000000000e+01 2 63 63 2.0053037235275955e-05 2.0053037235275904e-05 2.5535129566378600e-15 + 9.4500000000000000e+02 2.2500000000000000e+01 2 64 63 2.0053037235275924e-05 2.0053037235275955e-05 -1.5543122344752192e-15 + 9.6750000000000000e+02 2.2500000000000000e+01 2 64 64 2.0053037235275914e-05 2.0053037235275924e-05 -4.4408920985006262e-16 + 9.9000000000000000e+02 2.2500000000000000e+01 2 65 64 2.0053037235275907e-05 2.0053037235275914e-05 -4.4408920985006262e-16 + 1.0125000000000000e+03 2.2500000000000000e+01 2 65 65 2.0053037235275965e-05 2.0053037235275907e-05 2.8865798640254070e-15 + 1.0350000000000000e+03 2.2500000000000000e+01 2 66 65 2.0053037235275928e-05 2.0053037235275965e-05 -1.7763568394002505e-15 + 1.0575000000000000e+03 2.2500000000000000e+01 2 66 66 2.0053037235275961e-05 2.0053037235275928e-05 1.6653345369377348e-15 + 1.0800000000000000e+03 2.2500000000000000e+01 2 67 66 2.0053037235275975e-05 2.0053037235275961e-05 6.6613381477509392e-16 + 1.1025000000000000e+03 2.2500000000000000e+01 2 67 67 2.0053037235275999e-05 2.0053037235275975e-05 1.2212453270876722e-15 + 1.1250000000000000e+03 2.2500000000000000e+01 2 68 67 2.0053037235275938e-05 2.0053037235275999e-05 -3.1086244689504383e-15 + 1.1475000000000000e+03 2.2500000000000000e+01 2 68 68 2.0053037235275948e-05 2.0053037235275938e-05 5.5511151231257827e-16 + 1.1700000000000000e+03 2.2500000000000000e+01 2 69 68 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 + 1.1925000000000000e+03 2.2500000000000000e+01 2 69 69 2.0053037235275948e-05 2.0053037235275961e-05 -6.6613381477509392e-16 + 1.2150000000000000e+03 2.2500000000000000e+01 2 70 69 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 + 1.2375000000000000e+03 2.2500000000000000e+01 2 70 70 2.0053037235275944e-05 2.0053037235275941e-05 2.2204460492503131e-16 + 1.2600000000000000e+03 2.2500000000000000e+01 2 70 70 2.0053037235275948e-05 2.0053037235275944e-05 2.2204460492503131e-16 + 1.2825000000000000e+03 2.2500000000000000e+01 2 71 70 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 + 1.3050000000000000e+03 2.2500000000000000e+01 2 71 71 2.0053037235276009e-05 2.0053037235275941e-05 3.3306690738754696e-15 + 1.3275000000000000e+03 2.2500000000000000e+01 2 72 71 2.0053037235275877e-05 2.0053037235276009e-05 -6.6613381477509392e-15 + 1.3500000000000000e+03 2.2500000000000000e+01 2 72 72 2.0053037235275978e-05 2.0053037235275877e-05 5.1070259132757201e-15 + 1.3725000000000000e+03 2.2500000000000000e+01 2 72 72 2.0053037235276022e-05 2.0053037235275978e-05 2.2204460492503131e-15 + 1.3950000000000000e+03 2.2500000000000000e+01 2 73 72 2.0053037235276002e-05 2.0053037235276022e-05 -1.1102230246251565e-15 + 1.4175000000000000e+03 2.2500000000000000e+01 2 73 73 2.0053037235275989e-05 2.0053037235276002e-05 -6.6613381477509392e-16 + 1.4400000000000000e+03 2.2500000000000000e+01 2 74 73 2.0053037235275928e-05 2.0053037235275989e-05 -3.1086244689504383e-15 + 1.4625000000000000e+03 2.2500000000000000e+01 2 74 74 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 + 1.4850000000000000e+03 2.2500000000000000e+01 2 74 74 2.0053037235275968e-05 2.0053037235275975e-05 -4.4408920985006262e-16 + 1.5075000000000000e+03 2.2500000000000000e+01 2 75 74 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 + 1.5300000000000000e+03 2.2500000000000000e+01 2 75 75 2.0053037235275944e-05 2.0053037235275944e-05 0.0000000000000000e+00 + 1.5525000000000000e+03 2.2500000000000000e+01 2 76 75 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 + 1.5750000000000000e+03 2.2500000000000000e+01 2 76 76 2.0053037235275944e-05 2.0053037235275921e-05 1.2212453270876722e-15 + 1.5975000000000000e+03 2.2500000000000000e+01 2 76 76 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 + 1.6200000000000000e+03 2.2500000000000000e+01 2 77 76 2.0053037235275924e-05 2.0053037235275921e-05 2.2204460492503131e-16 + 1.6425000000000000e+03 2.2500000000000000e+01 2 77 77 2.0053037235275955e-05 2.0053037235275924e-05 1.5543122344752192e-15 + 1.6650000000000000e+03 2.2500000000000000e+01 2 77 77 2.0053037235275968e-05 2.0053037235275955e-05 6.6613381477509392e-16 + 1.6875000000000000e+03 2.2500000000000000e+01 2 78 77 2.0053037235275978e-05 2.0053037235275968e-05 5.5511151231257827e-16 + 1.7100000000000000e+03 2.2500000000000000e+01 2 78 78 2.0053037235276009e-05 2.0053037235275978e-05 1.5543122344752192e-15 + 1.7325000000000000e+03 2.2500000000000000e+01 2 78 78 2.0053037235275934e-05 2.0053037235276009e-05 -3.7747582837255322e-15 + 1.7550000000000000e+03 2.2500000000000000e+01 2 79 78 2.0053037235275982e-05 2.0053037235275934e-05 2.3314683517128287e-15 + 1.7775000000000000e+03 2.2500000000000000e+01 2 79 79 2.0053037235275965e-05 2.0053037235275982e-05 -8.8817841970012523e-16 + 1.8000000000000000e+03 2.2500000000000000e+01 2 79 79 2.0053037235275958e-05 2.0053037235275965e-05 -4.4408920985006262e-16 + 1.8225000000000000e+03 2.2500000000000000e+01 2 80 79 2.0053037235276009e-05 2.0053037235275958e-05 2.5535129566378600e-15 + 1.8450000000000000e+03 2.2500000000000000e+01 2 80 80 2.0053037235275985e-05 2.0053037235276009e-05 -1.1102230246251565e-15 + 1.8675000000000000e+03 2.2500000000000000e+01 2 80 80 2.0053037235276029e-05 2.0053037235275985e-05 2.2204460492503131e-15 + 1.8900000000000000e+03 2.2500000000000000e+01 2 81 80 2.0053037235275948e-05 2.0053037235276029e-05 -3.9968028886505635e-15 + 1.9125000000000000e+03 2.2500000000000000e+01 1 81 81 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 + 1.9350000000000000e+03 2.2500000000000000e+01 1 81 81 2.0053037235275941e-05 2.0053037235275961e-05 -1.1102230246251565e-15 + 1.9575000000000000e+03 2.2500000000000000e+01 1 81 81 2.0053037235275972e-05 2.0053037235275941e-05 1.5543122344752192e-15 + 1.9800000000000000e+03 2.2500000000000000e+01 1 82 81 2.0053037235276049e-05 2.0053037235275972e-05 3.8857805861880479e-15 + 2.0025000000000000e+03 2.2500000000000000e+01 1 82 82 2.0053037235275955e-05 2.0053037235276049e-05 -4.6629367034256575e-15 + 2.0250000000000000e+03 2.2500000000000000e+01 1 82 82 2.0053037235275941e-05 2.0053037235275955e-05 -6.6613381477509392e-16 + 2.0475000000000000e+03 2.2500000000000000e+01 1 82 82 2.0053037235275924e-05 2.0053037235275941e-05 -8.8817841970012523e-16 + 2.0700000000000000e+03 2.2500000000000000e+01 1 83 82 2.0053037235275944e-05 2.0053037235275924e-05 9.9920072216264089e-16 + 2.0925000000000000e+03 2.2500000000000000e+01 1 83 83 2.0053037235275951e-05 2.0053037235275944e-05 3.3306690738754696e-16 + 2.1150000000000000e+03 2.2500000000000000e+01 1 83 83 2.0053037235275972e-05 2.0053037235275951e-05 9.9920072216264089e-16 + 2.1375000000000000e+03 2.2500000000000000e+01 1 84 83 2.0053037235276002e-05 2.0053037235275972e-05 1.5543122344752192e-15 + 2.1600000000000000e+03 2.2500000000000000e+01 1 84 84 2.0053037235275995e-05 2.0053037235276002e-05 -4.4408920985006262e-16 + 2.1825000000000000e+03 2.2500000000000000e+01 1 84 84 2.0053037235275914e-05 2.0053037235275995e-05 -3.9968028886505635e-15 + 2.2050000000000000e+03 2.2500000000000000e+01 1 84 84 2.0053037235275978e-05 2.0053037235275914e-05 3.2196467714129540e-15 + 2.2275000000000000e+03 2.2500000000000000e+01 1 85 84 2.0053037235275968e-05 2.0053037235275978e-05 -4.4408920985006262e-16 + 2.2500000000000000e+03 2.2500000000000000e+01 1 85 85 2.0053037235275955e-05 2.0053037235275968e-05 -6.6613381477509392e-16 + 2.2725000000000000e+03 2.2500000000000000e+01 1 85 85 2.0053037235275951e-05 2.0053037235275955e-05 -2.2204460492503131e-16 + 2.2950000000000000e+03 2.2500000000000000e+01 1 85 85 2.0053037235275968e-05 2.0053037235275951e-05 8.8817841970012523e-16 + 2.3175000000000000e+03 2.2500000000000000e+01 1 86 85 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 + 2.3400000000000000e+03 2.2500000000000000e+01 1 86 86 2.0053037235275951e-05 2.0053037235275944e-05 3.3306690738754696e-16 + 2.3625000000000000e+03 2.2500000000000000e+01 1 86 86 2.0053037235275958e-05 2.0053037235275951e-05 3.3306690738754696e-16 + 2.3850000000000000e+03 2.2500000000000000e+01 1 86 86 2.0053037235276002e-05 2.0053037235275958e-05 2.2204460492503131e-15 + 2.4075000000000000e+03 2.2500000000000000e+01 1 87 86 2.0053037235275961e-05 2.0053037235276002e-05 -1.9984014443252818e-15 + 2.4300000000000000e+03 2.2500000000000000e+01 1 87 87 2.0053037235276012e-05 2.0053037235275961e-05 2.5535129566378600e-15 + 2.4525000000000000e+03 2.2500000000000000e+01 1 87 87 2.0053037235275978e-05 2.0053037235276012e-05 -1.7763568394002505e-15 + 2.4750000000000000e+03 2.2500000000000000e+01 1 87 87 2.0053037235276012e-05 2.0053037235275978e-05 1.6653345369377348e-15 + 2.4975000000000000e+03 2.2500000000000000e+01 1 87 87 2.0053037235275995e-05 2.0053037235276012e-05 -8.8817841970012523e-16 + 2.5200000000000000e+03 2.2500000000000000e+01 1 88 87 2.0053037235276029e-05 2.0053037235275995e-05 1.6653345369377348e-15 + 2.5425000000000000e+03 2.2500000000000000e+01 1 88 88 2.0053037235275955e-05 2.0053037235276029e-05 -3.7747582837255322e-15 + 2.5650000000000000e+03 2.2500000000000000e+01 1 88 88 2.0053037235275972e-05 2.0053037235275955e-05 8.8817841970012523e-16 + 2.5875000000000000e+03 2.2500000000000000e+01 1 88 88 2.0053037235275961e-05 2.0053037235275972e-05 -4.4408920985006262e-16 + 2.6100000000000000e+03 2.2500000000000000e+01 1 88 88 2.0053037235275944e-05 2.0053037235275961e-05 -8.8817841970012523e-16 + 2.6325000000000000e+03 2.2500000000000000e+01 1 89 88 2.0053037235275941e-05 2.0053037235275944e-05 -2.2204460492503131e-16 + 2.6550000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235276002e-05 2.0053037235275941e-05 2.9976021664879227e-15 + 2.6775000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235275928e-05 2.0053037235276002e-05 -3.7747582837255322e-15 + 2.7000000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235275961e-05 2.0053037235275928e-05 1.6653345369377348e-15 + 2.7225000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235275999e-05 2.0053037235275961e-05 1.8873791418627661e-15 + 2.7450000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235275982e-05 2.0053037235275999e-05 -8.8817841970012523e-16 + 2.7675000000000000e+03 2.2500000000000000e+01 1 90 89 2.0053037235275944e-05 2.0053037235275982e-05 -1.7763568394002505e-15 + 2.7900000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235276002e-05 2.0053037235275944e-05 2.8865798640254070e-15 + 2.8125000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275938e-05 2.0053037235276002e-05 -3.1086244689504383e-15 + 2.8350000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275995e-05 2.0053037235275938e-05 2.8865798640254070e-15 + 2.8575000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275897e-05 2.0053037235275995e-05 -4.8849813083506888e-15 + 2.8800000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275961e-05 2.0053037235275897e-05 3.2196467714129540e-15 + 2.9025000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275900e-05 2.0053037235275961e-05 -3.1086244689504383e-15 + 2.9250000000000000e+03 2.2500000000000000e+01 1 91 90 2.0053037235275934e-05 2.0053037235275900e-05 1.6653345369377348e-15 + 2.9475000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275999e-05 2.0053037235275934e-05 3.2196467714129540e-15 + 2.9700000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275928e-05 2.0053037235275999e-05 -3.5527136788005009e-15 + 2.9925000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 + 3.0150000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235276016e-05 2.0053037235275972e-05 2.2204460492503131e-15 + 3.0375000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235276002e-05 2.0053037235276016e-05 -6.6613381477509392e-16 + 3.0600000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275975e-05 2.0053037235276002e-05 -1.3322676295501878e-15 + 3.0825000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275992e-05 2.0053037235275975e-05 8.8817841970012523e-16 + 3.1050000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275985e-05 2.0053037235275992e-05 -4.4408920985006262e-16 + 3.1275000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235276016e-05 2.0053037235275985e-05 1.5543122344752192e-15 + 3.1500000000000000e+03 2.2500000000000000e+01 1 92 91 2.0053037235276029e-05 2.0053037235276016e-05 6.6613381477509392e-16 + 3.1725000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275968e-05 2.0053037235276029e-05 -3.1086244689504383e-15 + 3.1950000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275955e-05 2.0053037235275968e-05 -6.6613381477509392e-16 + 3.2175000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235276080e-05 2.0053037235275955e-05 6.2172489379008766e-15 + 3.2400000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275999e-05 2.0053037235276080e-05 -3.9968028886505635e-15 + 3.2625000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275938e-05 2.0053037235275999e-05 -3.1086244689504383e-15 + 3.2850000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275975e-05 2.0053037235275938e-05 1.8873791418627661e-15 + 3.3075000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275951e-05 2.0053037235275975e-05 -1.1102230246251565e-15 + 3.3300000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275897e-05 2.0053037235275951e-05 -2.6645352591003757e-15 + 3.3525000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275961e-05 2.0053037235275897e-05 3.2196467714129540e-15 + 3.3750000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 + 3.3975000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275982e-05 2.0053037235275961e-05 9.9920072216264089e-16 + 3.4200000000000000e+03 2.2500000000000000e+01 1 93 92 2.0053037235275992e-05 2.0053037235275982e-05 5.5511151231257827e-16 + 3.4425000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275968e-05 2.0053037235275992e-05 -1.1102230246251565e-15 + 3.4650000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275928e-05 2.0053037235275968e-05 -1.9984014443252818e-15 + 3.4875000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 + 3.5100000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275982e-05 2.0053037235275972e-05 5.5511151231257827e-16 + 3.5325000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275921e-05 2.0053037235275982e-05 -3.1086244689504383e-15 + 3.5550000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275995e-05 2.0053037235275921e-05 3.6637359812630166e-15 + 3.5775000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275972e-05 2.0053037235275995e-05 -1.1102230246251565e-15 + 3.6000000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275941e-05 2.0053037235275972e-05 -1.5543122344752192e-15 + 3.6225000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275934e-05 2.0053037235275941e-05 -4.4408920985006262e-16 + 3.6450000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235276002e-05 2.0053037235275934e-05 3.3306690738754696e-15 + 3.6675000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275958e-05 2.0053037235276002e-05 -2.2204460492503131e-15 + 3.6900000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275921e-05 2.0053037235275958e-05 -1.7763568394002505e-15 + 3.7125000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235276002e-05 2.0053037235275921e-05 4.1078251911130792e-15 + 3.7350000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275941e-05 2.0053037235276002e-05 -3.1086244689504383e-15 diff --git a/tst/scripts/coagulation/coag_info_sden.dat b/tst/scripts/coagulation/coag_info_sden.dat index cfd91bdd..39fb55d3 100644 --- a/tst/scripts/coagulation/coag_info_sden.dat +++ b/tst/scripts/coagulation/coag_info_sden.dat @@ -1,168 +1,168 @@ -# time dt maxCall end_maxSize beg_massSize end_total_massd beg_total_massd diff_massd - 0.000000e+00 2.250000e+01 6 19 10 1.256637e-01 1.256637e-01 1.546103e-15 - 2.250000e+01 2.250000e+01 5 23 19 1.256637e-01 1.256637e-01 8.834874e-16 - 4.500000e+01 2.250000e+01 4 26 23 1.256637e-01 1.256637e-01 -8.834874e-16 - 6.750000e+01 2.250000e+01 4 28 26 1.256637e-01 1.256637e-01 -1.104359e-15 - 9.000000e+01 2.250000e+01 4 29 28 1.256637e-01 1.256637e-01 2.208719e-16 - 1.125000e+02 2.250000e+01 3 31 29 1.256637e-01 1.256637e-01 -8.834874e-16 - 1.350000e+02 2.250000e+01 3 32 31 1.256637e-01 1.256637e-01 3.313078e-15 - 1.575000e+02 2.250000e+01 3 34 32 1.256637e-01 1.256637e-01 -1.766975e-15 - 1.800000e+02 2.250000e+01 3 35 34 1.256637e-01 1.256637e-01 -2.429590e-15 - 2.025000e+02 2.250000e+01 3 36 35 1.256637e-01 1.256637e-01 1.325231e-15 - 2.250000e+02 2.250000e+01 3 37 36 1.256637e-01 1.256637e-01 2.208719e-15 - 2.475000e+02 2.250000e+01 3 38 37 1.256637e-01 1.256637e-01 4.417437e-16 - 2.700000e+02 2.250000e+01 2 39 38 1.256637e-01 1.256637e-01 -1.546103e-15 - 2.925000e+02 2.250000e+01 2 40 39 1.256637e-01 1.256637e-01 8.834874e-16 - 3.150000e+02 2.250000e+01 2 41 40 1.256637e-01 1.256637e-01 -2.429590e-15 - 3.375000e+02 2.250000e+01 2 42 41 1.256637e-01 1.256637e-01 4.417437e-15 - 3.600000e+02 2.250000e+01 2 43 42 1.256637e-01 1.256637e-01 -6.626156e-16 - 3.825000e+02 2.250000e+01 2 44 43 1.256637e-01 1.256637e-01 -2.208719e-15 - 4.050000e+02 2.250000e+01 2 45 44 1.256637e-01 1.256637e-01 1.766975e-15 - 4.275000e+02 2.250000e+01 2 46 45 1.256637e-01 1.256637e-01 -1.766975e-15 - 4.500000e+02 2.250000e+01 2 47 46 1.256637e-01 1.256637e-01 -6.626156e-16 - 4.725000e+02 2.250000e+01 2 48 47 1.256637e-01 1.256637e-01 8.834874e-16 - 4.950000e+02 2.250000e+01 2 49 48 1.256637e-01 1.256637e-01 8.834874e-16 - 5.175000e+02 2.250000e+01 2 50 49 1.256637e-01 1.256637e-01 -8.834874e-16 - 5.400000e+02 2.250000e+01 2 51 50 1.256637e-01 1.256637e-01 -8.834874e-16 - 5.625000e+02 2.250000e+01 2 52 51 1.256637e-01 1.256637e-01 3.975693e-15 - 5.850000e+02 2.250000e+01 2 52 52 1.256637e-01 1.256637e-01 0.000000e+00 - 6.075000e+02 2.250000e+01 2 53 52 1.256637e-01 1.256637e-01 4.417437e-16 - 6.300000e+02 2.250000e+01 2 54 53 1.256637e-01 1.256637e-01 -4.196565e-15 - 6.525000e+02 2.250000e+01 2 55 54 1.256637e-01 1.256637e-01 4.417437e-16 - 6.750000e+02 2.250000e+01 2 56 55 1.256637e-01 1.256637e-01 1.546103e-15 - 6.975000e+02 2.250000e+01 2 56 56 1.256637e-01 1.256637e-01 -3.754821e-15 - 7.200000e+02 2.250000e+01 2 57 56 1.256637e-01 1.256637e-01 5.521796e-15 - 7.425000e+02 2.250000e+01 2 58 57 1.256637e-01 1.256637e-01 -1.546103e-15 - 7.650000e+02 2.250000e+01 2 58 58 1.256637e-01 1.256637e-01 -3.092206e-15 - 7.875000e+02 2.250000e+01 2 59 58 1.256637e-01 1.256637e-01 -6.626156e-16 - 8.100000e+02 2.250000e+01 2 60 59 1.256637e-01 1.256637e-01 1.766975e-15 - 8.325000e+02 2.250000e+01 2 60 60 1.256637e-01 1.256637e-01 2.208719e-15 - 8.550000e+02 2.250000e+01 2 61 60 1.256637e-01 1.256637e-01 -4.417437e-15 - 8.775000e+02 2.250000e+01 2 62 61 1.256637e-01 1.256637e-01 4.638309e-15 - 9.000000e+02 2.250000e+01 2 62 62 1.256637e-01 1.256637e-01 -1.325231e-15 - 9.225000e+02 2.250000e+01 2 63 62 1.256637e-01 1.256637e-01 8.834874e-16 - 9.450000e+02 2.250000e+01 2 63 63 1.256637e-01 1.256637e-01 -2.871334e-15 - 9.675000e+02 2.250000e+01 2 64 63 1.256637e-01 1.256637e-01 6.626156e-16 - 9.900000e+02 2.250000e+01 2 64 64 1.256637e-01 1.256637e-01 4.417437e-16 - 1.012500e+03 2.250000e+01 2 65 64 1.256637e-01 1.256637e-01 -2.208719e-16 - 1.035000e+03 2.250000e+01 2 65 65 1.256637e-01 1.256637e-01 -4.417437e-16 - 1.057500e+03 2.250000e+01 2 66 65 1.256637e-01 1.256637e-01 3.313078e-15 - 1.080000e+03 2.250000e+01 2 66 66 1.256637e-01 1.256637e-01 -2.429590e-15 - 1.102500e+03 2.250000e+01 2 67 66 1.256637e-01 1.256637e-01 2.208719e-15 - 1.125000e+03 2.250000e+01 2 67 67 1.256637e-01 1.256637e-01 -3.975693e-15 - 1.147500e+03 2.250000e+01 2 68 67 1.256637e-01 1.256637e-01 2.208719e-16 - 1.170000e+03 2.250000e+01 2 68 68 1.256637e-01 1.256637e-01 2.650462e-15 - 1.192500e+03 2.250000e+01 2 69 68 1.256637e-01 1.256637e-01 -4.417437e-16 - 1.215000e+03 2.250000e+01 2 69 69 1.256637e-01 1.256637e-01 -2.871334e-15 - 1.237500e+03 2.250000e+01 2 70 69 1.256637e-01 1.256637e-01 2.650462e-15 - 1.260000e+03 2.250000e+01 2 70 70 1.256637e-01 1.256637e-01 -1.546103e-15 - 1.282500e+03 2.250000e+01 2 71 70 1.256637e-01 1.256637e-01 -6.626156e-16 - 1.305000e+03 2.250000e+01 2 71 71 1.256637e-01 1.256637e-01 2.429590e-15 - 1.327500e+03 2.250000e+01 2 72 71 1.256637e-01 1.256637e-01 2.429590e-15 - 1.350000e+03 2.250000e+01 2 72 72 1.256637e-01 1.256637e-01 -5.300924e-15 - 1.372500e+03 2.250000e+01 2 73 72 1.256637e-01 1.256637e-01 6.626156e-16 - 1.395000e+03 2.250000e+01 2 73 73 1.256637e-01 1.256637e-01 1.987847e-15 - 1.417500e+03 2.250000e+01 2 74 73 1.256637e-01 1.256637e-01 -2.429590e-15 - 1.440000e+03 2.250000e+01 2 74 74 1.256637e-01 1.256637e-01 3.754821e-15 - 1.462500e+03 2.250000e+01 2 75 74 1.256637e-01 1.256637e-01 1.987847e-15 - 1.485000e+03 2.250000e+01 2 75 75 1.256637e-01 1.256637e-01 -2.208719e-16 - 1.507500e+03 2.250000e+01 2 76 75 1.256637e-01 1.256637e-01 -6.626156e-15 - 1.530000e+03 2.250000e+01 2 76 76 1.256637e-01 1.256637e-01 3.533950e-15 - 1.552500e+03 2.250000e+01 2 77 76 1.256637e-01 1.256637e-01 2.429590e-15 - 1.575000e+03 2.250000e+01 2 77 77 1.256637e-01 1.256637e-01 2.208719e-16 - 1.597500e+03 2.250000e+01 2 78 77 1.256637e-01 1.256637e-01 -1.987847e-15 - 1.620000e+03 2.250000e+01 2 78 78 1.256637e-01 1.256637e-01 0.000000e+00 - 1.642500e+03 2.250000e+01 2 79 78 1.256637e-01 1.256637e-01 -1.104359e-15 - 1.665000e+03 2.250000e+01 2 80 79 1.256637e-01 1.256637e-01 4.417437e-16 - 1.687500e+03 2.250000e+01 2 80 80 1.256637e-01 1.256637e-01 1.325231e-15 - 1.710000e+03 2.250000e+01 2 81 80 1.256637e-01 1.256637e-01 1.546103e-15 - 1.732500e+03 2.250000e+01 2 82 81 1.256637e-01 1.256637e-01 -2.429590e-15 - 1.755000e+03 2.250000e+01 2 82 82 1.256637e-01 1.256637e-01 2.871334e-15 - 1.777500e+03 2.250000e+01 2 83 82 1.256637e-01 1.256637e-01 -8.834874e-16 - 1.800000e+03 2.250000e+01 2 84 83 1.256637e-01 1.256637e-01 2.208719e-15 - 1.822500e+03 2.250000e+01 2 84 84 1.256637e-01 1.256637e-01 -4.417437e-15 - 1.845000e+03 2.250000e+01 2 85 84 1.256637e-01 1.256637e-01 1.987847e-15 - 1.867500e+03 2.250000e+01 2 86 85 1.256637e-01 1.256637e-01 -2.871334e-15 - 1.890000e+03 2.250000e+01 2 87 86 1.256637e-01 1.256637e-01 0.000000e+00 - 1.912500e+03 2.250000e+01 2 87 87 1.256637e-01 1.256637e-01 2.650462e-15 - 1.935000e+03 2.250000e+01 2 88 87 1.256637e-01 1.256637e-01 3.092206e-15 - 1.957500e+03 2.250000e+01 2 89 88 1.256637e-01 1.256637e-01 -1.546103e-15 - 1.980000e+03 2.250000e+01 2 89 89 1.256637e-01 1.256637e-01 3.798996e-14 - 2.002500e+03 2.250000e+01 2 90 89 1.256637e-01 1.256637e-01 1.201543e-13 - 2.025000e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 3.361670e-13 - 2.047500e+03 2.250000e+01 1 90 90 1.256637e-01 1.256637e-01 7.776898e-13 - 2.070000e+03 2.250000e+01 1 91 90 1.256637e-01 1.256637e-01 1.454220e-12 - 2.092500e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 2.226388e-12 - 2.115000e+03 2.250000e+01 1 91 91 1.256637e-01 1.256637e-01 2.981549e-12 - 2.137500e+03 2.250000e+01 1 92 91 1.256637e-01 1.256637e-01 3.563767e-12 - 2.160000e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 3.906560e-12 - 2.182500e+03 2.250000e+01 1 92 92 1.256637e-01 1.256637e-01 4.043280e-12 - 2.205000e+03 2.250000e+01 1 93 92 1.256637e-01 1.256637e-01 3.997560e-12 - 2.227500e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 3.827488e-12 - 2.250000e+03 2.250000e+01 1 93 93 1.256637e-01 1.256637e-01 3.559129e-12 - 2.272500e+03 2.250000e+01 1 94 93 1.256637e-01 1.256637e-01 3.277959e-12 - 2.295000e+03 2.250000e+01 1 94 94 1.256637e-01 1.256637e-01 2.964321e-12 - 2.317500e+03 2.250000e+01 1 94 94 1.256637e-01 1.256637e-01 2.657530e-12 - 2.340000e+03 2.250000e+01 1 94 94 1.256637e-01 1.256637e-01 2.377906e-12 - 2.362500e+03 2.250000e+01 1 94 94 1.256637e-01 1.256637e-01 2.121695e-12 - 2.385000e+03 2.250000e+01 1 95 94 1.256637e-01 1.256637e-01 1.889780e-12 - 2.407500e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.690332e-12 - 2.430000e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.511205e-12 - 2.452500e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.368743e-12 - 2.475000e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.234011e-12 - 2.497500e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.129980e-12 - 2.520000e+03 2.250000e+01 1 95 95 1.256637e-01 1.256637e-01 1.038539e-12 - 2.542500e+03 2.250000e+01 1 96 95 1.256637e-01 1.256637e-01 9.621178e-13 - 2.565000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 8.967397e-13 - 2.587500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 8.432887e-13 - 2.610000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 8.006605e-13 - 2.632500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 7.673088e-13 - 2.655000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 7.388163e-13 - 2.677500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 7.134161e-13 - 2.700000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.913289e-13 - 2.722500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.796227e-13 - 2.745000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.544433e-13 - 2.767500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.573146e-13 - 2.790000e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.330187e-13 - 2.812500e+03 2.250000e+01 1 96 96 1.256637e-01 1.256637e-01 6.323561e-13 - 2.835000e+03 2.250000e+01 1 97 96 1.256637e-01 1.256637e-01 6.208708e-13 - 2.857500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 6.115942e-13 - 2.880000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 6.065141e-13 - 2.902500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.979001e-13 - 2.925000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.925992e-13 - 2.947500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.806721e-13 - 2.970000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.744877e-13 - 2.992500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.627815e-13 - 3.015000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.588058e-13 - 3.037500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.495292e-13 - 3.060000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.389273e-13 - 3.082500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.345099e-13 - 3.105000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.236872e-13 - 3.127500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.168401e-13 - 3.150000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 5.097722e-13 - 3.172500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.885685e-13 - 3.195000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.974034e-13 - 3.217500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.810589e-13 - 3.240000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.803963e-13 - 3.262500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.682483e-13 - 3.285000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.605178e-13 - 3.307500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.647144e-13 - 3.330000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.439524e-13 - 3.352500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.488116e-13 - 3.375000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.373263e-13 - 3.397500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.368845e-13 - 3.420000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.260618e-13 - 3.442500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.227487e-13 - 3.465000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.223070e-13 - 3.487500e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.174478e-13 - 3.510000e+03 2.250000e+01 1 97 97 1.256637e-01 1.256637e-01 4.097173e-13 - 3.532500e+03 2.250000e+01 1 98 97 1.256637e-01 1.256637e-01 4.064042e-13 - 3.555000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 4.136930e-13 - 3.577500e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.966858e-13 - 3.600000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 4.066251e-13 - 3.622500e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.982320e-13 - 3.645000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.988946e-13 - 3.667500e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.913849e-13 - 3.690000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.865257e-13 - 3.712500e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.885136e-13 - 3.735000e+03 2.250000e+01 1 98 98 1.256637e-01 1.256637e-01 3.860840e-13 +# time dt max_calls max_size1 max_size0 mass_d1 mass_d0 delta + 0.0000000000000000e+00 2.2500000000000000e+01 6 19 10 2.5132741228718358e-06 2.5132741228718329e-06 1.2212453270876722e-15 + 2.2500000000000000e+01 2.2500000000000000e+01 5 23 19 2.5132741228718354e-06 2.5132741228718358e-06 -2.2204460492503131e-16 + 4.5000000000000000e+01 2.2500000000000000e+01 4 26 23 2.5132741228718312e-06 2.5132741228718354e-06 -1.7763568394002505e-15 + 6.7500000000000000e+01 2.2500000000000000e+01 4 28 26 2.5132741228718325e-06 2.5132741228718312e-06 5.5511151231257827e-16 + 9.0000000000000000e+01 2.2500000000000000e+01 4 29 28 2.5132741228718358e-06 2.5132741228718325e-06 1.3322676295501878e-15 + 1.1250000000000000e+02 2.2500000000000000e+01 3 31 29 2.5132741228718342e-06 2.5132741228718358e-06 -6.6613381477509392e-16 + 1.3500000000000000e+02 2.2500000000000000e+01 3 32 31 2.5132741228718286e-06 2.5132741228718342e-06 -2.2204460492503131e-15 + 1.5750000000000000e+02 2.2500000000000000e+01 3 34 32 2.5132741228718325e-06 2.5132741228718286e-06 1.5543122344752192e-15 + 1.8000000000000000e+02 2.2500000000000000e+01 3 35 34 2.5132741228718333e-06 2.5132741228718325e-06 3.3306690738754696e-16 + 2.0250000000000000e+02 2.2500000000000000e+01 3 36 35 2.5132741228718299e-06 2.5132741228718333e-06 -1.3322676295501878e-15 + 2.2500000000000000e+02 2.2500000000000000e+01 3 37 36 2.5132741228718286e-06 2.5132741228718299e-06 -4.4408920985006262e-16 + 2.4750000000000000e+02 2.2500000000000000e+01 3 38 37 2.5132741228718316e-06 2.5132741228718286e-06 1.2212453270876722e-15 + 2.7000000000000000e+02 2.2500000000000000e+01 2 39 38 2.5132741228718337e-06 2.5132741228718316e-06 8.8817841970012523e-16 + 2.9250000000000000e+02 2.2500000000000000e+01 2 40 39 2.5132741228718299e-06 2.5132741228718337e-06 -1.5543122344752192e-15 + 3.1500000000000000e+02 2.2500000000000000e+01 2 41 40 2.5132741228718392e-06 2.5132741228718299e-06 3.6637359812630166e-15 + 3.3750000000000000e+02 2.2500000000000000e+01 2 42 41 2.5132741228718384e-06 2.5132741228718392e-06 -4.4408920985006262e-16 + 3.6000000000000000e+02 2.2500000000000000e+01 2 43 42 2.5132741228718414e-06 2.5132741228718384e-06 1.2212453270876722e-15 + 3.8250000000000000e+02 2.2500000000000000e+01 2 44 43 2.5132741228718358e-06 2.5132741228718414e-06 -2.2204460492503131e-15 + 4.0500000000000000e+02 2.2500000000000000e+01 2 45 44 2.5132741228718333e-06 2.5132741228718358e-06 -1.1102230246251565e-15 + 4.2750000000000000e+02 2.2500000000000000e+01 2 46 45 2.5132741228718363e-06 2.5132741228718333e-06 1.2212453270876722e-15 + 4.5000000000000000e+02 2.2500000000000000e+01 2 47 46 2.5132741228718392e-06 2.5132741228718363e-06 1.2212453270876722e-15 + 4.7250000000000000e+02 2.2500000000000000e+01 2 48 47 2.5132741228718342e-06 2.5132741228718392e-06 -1.9984014443252818e-15 + 4.9500000000000000e+02 2.2500000000000000e+01 2 49 48 2.5132741228718401e-06 2.5132741228718342e-06 2.3314683517128287e-15 + 5.1750000000000000e+02 2.2500000000000000e+01 2 50 49 2.5132741228718346e-06 2.5132741228718401e-06 -2.2204460492503131e-15 + 5.4000000000000000e+02 2.2500000000000000e+01 2 51 50 2.5132741228718384e-06 2.5132741228718346e-06 1.5543122344752192e-15 + 5.6250000000000000e+02 2.2500000000000000e+01 2 52 51 2.5132741228718346e-06 2.5132741228718384e-06 -1.5543122344752192e-15 + 5.8500000000000000e+02 2.2500000000000000e+01 2 52 52 2.5132741228718358e-06 2.5132741228718346e-06 5.5511151231257827e-16 + 6.0750000000000000e+02 2.2500000000000000e+01 2 53 52 2.5132741228718384e-06 2.5132741228718358e-06 9.9920072216264089e-16 + 6.3000000000000000e+02 2.2500000000000000e+01 2 54 53 2.5132741228718414e-06 2.5132741228718384e-06 1.2212453270876722e-15 + 6.5250000000000000e+02 2.2500000000000000e+01 2 55 54 2.5132741228718388e-06 2.5132741228718414e-06 -1.1102230246251565e-15 + 6.7500000000000000e+02 2.2500000000000000e+01 2 55 55 2.5132741228718367e-06 2.5132741228718388e-06 -8.8817841970012523e-16 + 6.9750000000000000e+02 2.2500000000000000e+01 2 56 55 2.5132741228718405e-06 2.5132741228718367e-06 1.5543122344752192e-15 + 7.2000000000000000e+02 2.2500000000000000e+01 2 57 56 2.5132741228718375e-06 2.5132741228718405e-06 -1.1102230246251565e-15 + 7.4250000000000000e+02 2.2500000000000000e+01 2 58 57 2.5132741228718363e-06 2.5132741228718375e-06 -4.4408920985006262e-16 + 7.6500000000000000e+02 2.2500000000000000e+01 2 58 58 2.5132741228718380e-06 2.5132741228718363e-06 6.6613381477509392e-16 + 7.8750000000000000e+02 2.2500000000000000e+01 2 59 58 2.5132741228718401e-06 2.5132741228718380e-06 8.8817841970012523e-16 + 8.1000000000000000e+02 2.2500000000000000e+01 2 60 59 2.5132741228718354e-06 2.5132741228718401e-06 -1.7763568394002505e-15 + 8.3250000000000000e+02 2.2500000000000000e+01 2 60 60 2.5132741228718384e-06 2.5132741228718354e-06 1.2212453270876722e-15 + 8.5500000000000000e+02 2.2500000000000000e+01 2 61 60 2.5132741228718388e-06 2.5132741228718384e-06 2.2204460492503131e-16 + 8.7750000000000000e+02 2.2500000000000000e+01 2 61 61 2.5132741228718405e-06 2.5132741228718388e-06 6.6613381477509392e-16 + 9.0000000000000000e+02 2.2500000000000000e+01 2 62 61 2.5132741228718367e-06 2.5132741228718405e-06 -1.5543122344752192e-15 + 9.2250000000000000e+02 2.2500000000000000e+01 2 63 62 2.5132741228718346e-06 2.5132741228718367e-06 -8.8817841970012523e-16 + 9.4500000000000000e+02 2.2500000000000000e+01 2 63 63 2.5132741228718367e-06 2.5132741228718346e-06 8.8817841970012523e-16 + 9.6750000000000000e+02 2.2500000000000000e+01 2 64 63 2.5132741228718333e-06 2.5132741228718367e-06 -1.3322676295501878e-15 + 9.9000000000000000e+02 2.2500000000000000e+01 2 64 64 2.5132741228718375e-06 2.5132741228718333e-06 1.6653345369377348e-15 + 1.0125000000000000e+03 2.2500000000000000e+01 2 65 64 2.5132741228718388e-06 2.5132741228718375e-06 5.5511151231257827e-16 + 1.0350000000000000e+03 2.2500000000000000e+01 2 65 65 2.5132741228718401e-06 2.5132741228718388e-06 5.5511151231257827e-16 + 1.0575000000000000e+03 2.2500000000000000e+01 2 66 65 2.5132741228718329e-06 2.5132741228718401e-06 -2.8865798640254070e-15 + 1.0800000000000000e+03 2.2500000000000000e+01 2 66 66 2.5132741228718439e-06 2.5132741228718329e-06 4.3298697960381105e-15 + 1.1025000000000000e+03 2.2500000000000000e+01 2 67 66 2.5132741228718426e-06 2.5132741228718439e-06 -4.4408920985006262e-16 + 1.1250000000000000e+03 2.2500000000000000e+01 2 67 67 2.5132741228718384e-06 2.5132741228718426e-06 -1.7763568394002505e-15 + 1.1475000000000000e+03 2.2500000000000000e+01 2 68 67 2.5132741228718303e-06 2.5132741228718384e-06 -3.1086244689504383e-15 + 1.1700000000000000e+03 2.2500000000000000e+01 2 68 68 2.5132741228718337e-06 2.5132741228718303e-06 1.3322676295501878e-15 + 1.1925000000000000e+03 2.2500000000000000e+01 2 69 68 2.5132741228718430e-06 2.5132741228718337e-06 3.6637359812630166e-15 + 1.2150000000000000e+03 2.2500000000000000e+01 2 69 69 2.5132741228718405e-06 2.5132741228718430e-06 -1.1102230246251565e-15 + 1.2375000000000000e+03 2.2500000000000000e+01 2 70 69 2.5132741228718367e-06 2.5132741228718405e-06 -1.5543122344752192e-15 + 1.2600000000000000e+03 2.2500000000000000e+01 2 70 70 2.5132741228718358e-06 2.5132741228718367e-06 -4.4408920985006262e-16 + 1.2825000000000000e+03 2.2500000000000000e+01 2 71 70 2.5132741228718418e-06 2.5132741228718358e-06 2.3314683517128287e-15 + 1.3050000000000000e+03 2.2500000000000000e+01 2 71 71 2.5132741228718477e-06 2.5132741228718418e-06 2.3314683517128287e-15 + 1.3275000000000000e+03 2.2500000000000000e+01 2 72 71 2.5132741228718350e-06 2.5132741228718477e-06 -5.1070259132757201e-15 + 1.3500000000000000e+03 2.2500000000000000e+01 2 72 72 2.5132741228718316e-06 2.5132741228718350e-06 -1.3322676295501878e-15 + 1.3725000000000000e+03 2.2500000000000000e+01 2 73 72 2.5132741228718409e-06 2.5132741228718316e-06 3.6637359812630166e-15 + 1.3950000000000000e+03 2.2500000000000000e+01 2 73 73 2.5132741228718358e-06 2.5132741228718409e-06 -1.9984014443252818e-15 + 1.4175000000000000e+03 2.2500000000000000e+01 2 74 73 2.5132741228718350e-06 2.5132741228718358e-06 -4.4408920985006262e-16 + 1.4400000000000000e+03 2.2500000000000000e+01 2 74 74 2.5132741228718401e-06 2.5132741228718350e-06 1.9984014443252818e-15 + 1.4625000000000000e+03 2.2500000000000000e+01 2 75 74 2.5132741228718316e-06 2.5132741228718401e-06 -3.3306690738754696e-15 + 1.4850000000000000e+03 2.2500000000000000e+01 2 75 75 2.5132741228718456e-06 2.5132741228718316e-06 5.5511151231257827e-15 + 1.5075000000000000e+03 2.2500000000000000e+01 2 76 75 2.5132741228718354e-06 2.5132741228718456e-06 -3.9968028886505635e-15 + 1.5300000000000000e+03 2.2500000000000000e+01 2 76 76 2.5132741228718405e-06 2.5132741228718354e-06 1.9984014443252818e-15 + 1.5525000000000000e+03 2.2500000000000000e+01 2 77 76 2.5132741228718397e-06 2.5132741228718405e-06 -4.4408920985006262e-16 + 1.5750000000000000e+03 2.2500000000000000e+01 2 77 77 2.5132741228718414e-06 2.5132741228718397e-06 6.6613381477509392e-16 + 1.5975000000000000e+03 2.2500000000000000e+01 2 78 77 2.5132741228718392e-06 2.5132741228718414e-06 -8.8817841970012523e-16 + 1.6200000000000000e+03 2.2500000000000000e+01 2 78 78 2.5132741228718439e-06 2.5132741228718392e-06 1.8873791418627661e-15 + 1.6425000000000000e+03 2.2500000000000000e+01 2 79 78 2.5132741228718418e-06 2.5132741228718439e-06 -8.8817841970012523e-16 + 1.6650000000000000e+03 2.2500000000000000e+01 2 80 79 2.5132741228718384e-06 2.5132741228718418e-06 -1.3322676295501878e-15 + 1.6875000000000000e+03 2.2500000000000000e+01 2 80 80 2.5132741228718371e-06 2.5132741228718384e-06 -4.4408920985006262e-16 + 1.7100000000000000e+03 2.2500000000000000e+01 2 81 80 2.5132741228718375e-06 2.5132741228718371e-06 2.2204460492503131e-16 + 1.7325000000000000e+03 2.2500000000000000e+01 2 82 81 2.5132741228718342e-06 2.5132741228718375e-06 -1.3322676295501878e-15 + 1.7550000000000000e+03 2.2500000000000000e+01 2 82 82 2.5132741228718358e-06 2.5132741228718342e-06 6.6613381477509392e-16 + 1.7775000000000000e+03 2.2500000000000000e+01 2 83 82 2.5132741228718354e-06 2.5132741228718358e-06 -2.2204460492503131e-16 + 1.8000000000000000e+03 2.2500000000000000e+01 2 84 83 2.5132741228718384e-06 2.5132741228718354e-06 1.2212453270876722e-15 + 1.8225000000000000e+03 2.2500000000000000e+01 2 84 84 2.5132741228718435e-06 2.5132741228718384e-06 1.9984014443252818e-15 + 1.8450000000000000e+03 2.2500000000000000e+01 2 85 84 2.5132741228718486e-06 2.5132741228718435e-06 1.9984014443252818e-15 + 1.8675000000000000e+03 2.2500000000000000e+01 2 86 85 2.5132741228718430e-06 2.5132741228718486e-06 -2.2204460492503131e-15 + 1.8900000000000000e+03 2.2500000000000000e+01 2 86 86 2.5132741228718426e-06 2.5132741228718430e-06 -2.2204460492503131e-16 + 1.9125000000000000e+03 2.2500000000000000e+01 2 87 86 2.5132741228718430e-06 2.5132741228718426e-06 2.2204460492503131e-16 + 1.9350000000000000e+03 2.2500000000000000e+01 2 88 87 2.5132741228718405e-06 2.5132741228718430e-06 -1.1102230246251565e-15 + 1.9575000000000000e+03 2.2500000000000000e+01 2 89 88 2.5132741228718574e-06 2.5132741228718405e-06 6.7723604502134549e-15 + 1.9800000000000000e+03 2.2500000000000000e+01 2 89 89 2.5132741228719405e-06 2.5132741228718574e-06 3.2973623831367149e-14 + 2.0025000000000000e+03 2.2500000000000000e+01 2 90 89 2.5132741228722437e-06 2.5132741228719405e-06 1.2068124277675452e-13 + 2.0250000000000000e+03 2.2500000000000000e+01 1 90 90 2.5132741228730831e-06 2.5132741228722437e-06 3.3395508580724709e-13 + 2.0475000000000000e+03 2.2500000000000000e+01 1 90 90 2.5132741228750389e-06 2.5132741228730831e-06 7.7815531795977222e-13 + 2.0700000000000000e+03 2.2500000000000000e+01 1 91 90 2.5132741228786938e-06 2.5132741228750389e-06 1.4542811399564926e-12 + 2.0925000000000000e+03 2.2500000000000000e+01 1 91 91 2.5132741228842970e-06 2.5132741228786938e-06 2.2294388557497768e-12 + 2.1150000000000000e+03 2.2500000000000000e+01 1 91 91 2.5132741228917958e-06 2.5132741228842970e-06 2.9837243786801082e-12 + 2.1375000000000000e+03 2.2500000000000000e+01 1 92 91 2.5132741229007311e-06 2.5132741228917958e-06 3.5552671917571388e-12 + 2.1600000000000000e+03 2.2500000000000000e+01 1 92 92 2.5132741229105588e-06 2.5132741229007311e-06 3.9103165150322639e-12 + 2.1825000000000000e+03 2.2500000000000000e+01 1 92 92 2.5132741229207257e-06 2.5132741229105588e-06 4.0453196348266829e-12 + 2.2050000000000000e+03 2.2500000000000000e+01 1 93 92 2.5132741229307720e-06 2.5132741229207257e-06 3.9972469778604136e-12 + 2.2275000000000000e+03 2.2500000000000000e+01 1 93 93 2.5132741229403773e-06 2.5132741229307720e-06 3.8218317399696389e-12 + 2.2500000000000000e+03 2.2500000000000000e+01 1 93 93 2.5132741229493406e-06 2.5132741229403773e-06 3.5663694220033904e-12 + 2.2725000000000000e+03 2.2500000000000000e+01 1 94 93 2.5132741229575742e-06 2.5132741229493406e-06 3.2760461010639119e-12 + 2.2950000000000000e+03 2.2500000000000000e+01 1 94 94 2.5132741229650175e-06 2.5132741229575742e-06 2.9616309404900676e-12 + 2.3175000000000000e+03 2.2500000000000000e+01 1 94 94 2.5132741229717112e-06 2.5132741229650175e-06 2.6633140137732880e-12 + 2.3400000000000000e+03 2.2500000000000000e+01 1 94 94 2.5132741229776857e-06 2.5132741229717112e-06 2.3772095403273852e-12 + 2.3625000000000000e+03 2.2500000000000000e+01 1 94 94 2.5132741229830068e-06 2.5132741229776857e-06 2.1171953079601735e-12 + 2.3850000000000000e+03 2.2500000000000000e+01 1 95 94 2.5132741229877540e-06 2.5132741229830068e-06 1.8888224317947788e-12 + 2.4075000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741229920044e-06 2.5132741229877540e-06 1.6912027334115010e-12 + 2.4300000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741229958173e-06 2.5132741229920044e-06 1.5171197631502764e-12 + 2.4525000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741229992487e-06 2.5132741229958173e-06 1.3652412533815550e-12 + 2.4750000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741230023522e-06 2.5132741229992487e-06 1.2349010702905616e-12 + 2.4975000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741230051855e-06 2.5132741230023522e-06 1.1273204592043840e-12 + 2.5200000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741230077969e-06 2.5132741230051855e-06 1.0390577287466840e-12 + 2.5425000000000000e+03 2.2500000000000000e+01 1 96 95 2.5132741230102114e-06 2.5132741230077969e-06 9.6067598320814795e-13 + 2.5650000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230124598e-06 2.5132741230102114e-06 8.9461771324295114e-13 + 2.5875000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230145901e-06 2.5132741230124598e-06 8.4765527930130702e-13 + 2.6100000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230166061e-06 2.5132741230145901e-06 8.0213613529167560e-13 + 2.6325000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230185301e-06 2.5132741230166061e-06 7.6549877547904543e-13 + 2.6550000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230203881e-06 2.5132741230185301e-06 7.3929751209789174e-13 + 2.6775000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230221808e-06 2.5132741230203881e-06 7.1331829332166308e-13 + 2.7000000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230239219e-06 2.5132741230221808e-06 6.9277916736609768e-13 + 2.7225000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230256176e-06 2.5132741230239219e-06 6.7468253206470763e-13 + 2.7450000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230272791e-06 2.5132741230256176e-06 6.6102678886181820e-13 + 2.7675000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230289215e-06 2.5132741230272791e-06 6.5347727229436714e-13 + 2.7900000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230305279e-06 2.5132741230289215e-06 6.3915539527670262e-13 + 2.8125000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230321013e-06 2.5132741230305279e-06 6.2605476358612577e-13 + 2.8350000000000000e+03 2.2500000000000000e+01 1 97 96 2.5132741230336687e-06 2.5132741230321013e-06 6.2361227293195043e-13 + 2.8575000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230352116e-06 2.5132741230336687e-06 6.1384231031524905e-13 + 2.8800000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230367248e-06 2.5132741230352116e-06 6.0207394625422239e-13 + 2.9025000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230382274e-06 2.5132741230367248e-06 5.9785509876064680e-13 + 2.9250000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230397068e-06 2.5132741230382274e-06 5.8864024765625800e-13 + 2.9475000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230411713e-06 2.5132741230397068e-06 5.8275606562574467e-13 + 2.9700000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230426193e-06 2.5132741230411713e-06 5.7609472747799373e-13 + 2.9925000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230440393e-06 2.5132741230426193e-06 5.6499249723174216e-13 + 3.0150000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230454361e-06 2.5132741230440393e-06 5.5577764612735336e-13 + 3.0375000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230468155e-06 2.5132741230454361e-06 5.4889426337467739e-13 + 3.0600000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230481707e-06 2.5132741230468155e-06 5.3923532306043853e-13 + 3.0825000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230495213e-06 2.5132741230481707e-06 5.3734794391857577e-13 + 3.1050000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230508266e-06 2.5132741230495213e-06 5.1936233091964823e-13 + 3.1275000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230521357e-06 2.5132741230508266e-06 5.2091664315412345e-13 + 3.1500000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230534092e-06 2.5132741230521357e-06 5.0670578843892145e-13 + 3.1725000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230546561e-06 2.5132741230534092e-06 4.9604764740251994e-13 + 3.1950000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230558936e-06 2.5132741230546561e-06 4.9238391142125693e-13 + 3.2175000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230571023e-06 2.5132741230558936e-06 4.8094861426761781e-13 + 3.2400000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230583046e-06 2.5132741230571023e-06 4.7839510131097995e-13 + 3.2625000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230594854e-06 2.5132741230583046e-06 4.6984638402136625e-13 + 3.2850000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230606552e-06 2.5132741230594854e-06 4.6540549192286562e-13 + 3.3075000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230617940e-06 2.5132741230606552e-06 4.5308201634952638e-13 + 3.3300000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230629269e-06 2.5132741230617940e-06 4.5075054799781356e-13 + 3.3525000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230640424e-06 2.5132741230629269e-06 4.4386716524513758e-13 + 3.3750000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230651491e-06 2.5132741230640424e-06 4.4031445156633708e-13 + 3.3975000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230662375e-06 2.5132741230651491e-06 4.3309800190627357e-13 + 3.4200000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230673239e-06 2.5132741230662375e-06 4.3220982348657344e-13 + 3.4425000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230683860e-06 2.5132741230673239e-06 4.2266190547479709e-13 + 3.4650000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230694452e-06 2.5132741230683860e-06 4.2144066014770942e-13 + 3.4875000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230704871e-06 2.5132741230694452e-06 4.1455727739503345e-13 + 3.5100000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230715404e-06 2.5132741230704871e-06 4.1910919179599659e-13 + 3.5325000000000000e+03 2.2500000000000000e+01 1 98 97 2.5132741230725543e-06 2.5132741230715404e-06 4.0345504714878189e-13 + 3.5550000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230735775e-06 2.5132741230725543e-06 4.0711878313004490e-13 + 3.5775000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230745910e-06 2.5132741230735775e-06 4.0323300254385686e-13 + 3.6000000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230756074e-06 2.5132741230745910e-06 4.0445424787094453e-13 + 3.6225000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230765976e-06 2.5132741230756074e-06 3.9401815143946806e-13 + 3.6450000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230776030e-06 2.5132741230765976e-06 4.0001335577244390e-13 + 3.6675000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230785830e-06 2.5132741230776030e-06 3.8991032624835498e-13 + 3.6900000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230795631e-06 2.5132741230785830e-06 3.8991032624835498e-13 + 3.7125000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230805426e-06 2.5132741230795631e-06 3.8979930394589246e-13 + 3.7350000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230815070e-06 2.5132741230805426e-06 3.8369307731045410e-13 diff --git a/tst/scripts/coagulation/coagulation.py b/tst/scripts/coagulation/coagulation.py index 1d107967..5c9437c5 100644 --- a/tst/scripts/coagulation/coagulation.py +++ b/tst/scripts/coagulation/coagulation.py @@ -38,7 +38,7 @@ def run(**kwargs): arguments = [ "parthenon/job/problem_id=" + _file_id, "parthenon/time/tlim={:.8f}".format(_tlim), - "dust/surface_density_flag=" + _surfden[ii], + "dust/coagulation/surface_density_flag=" + _surfden[ii], "dust/dfloor=" + _dfloor[ii], "problem/rho0=" + im, ] From 7be00a2a50ddd5c16893c66ab6a7f54552995fa2 Mon Sep 17 00:00:00 2001 From: Patrick Mullen Date: Thu, 21 Aug 2025 16:08:27 -0400 Subject: [PATCH 32/38] clang-format 18 vs 20 --- src/dust/coagulation/coagulation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index 825dc906..3fc91f76 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -164,8 +164,8 @@ TaskListStatus CoagulationDriver(Mesh *pm, parthenon::SimTime &tm) { const Real ldt = (*dt_coag); *dt_coag = 0.0; if (Globals::my_rank == 0) { - std::cout << "(Coagulation) " << "cycle=" << tm.ncycle << " time=" << ltime - << " dt=" << ldt << std::endl; + std::cout << "(Coagulation) " + << "cycle=" << tm.ncycle << " time=" << ltime << " dt=" << ldt << std::endl; } // Create MeshData register subset for dust From 37a096fe7b127a9d39a54d20866d5a323291404c Mon Sep 17 00:00:00 2001 From: Patrick Mullen Date: Thu, 21 Aug 2025 16:18:23 -0400 Subject: [PATCH 33/38] Remove trailing commas in CMakePresets.json --- CMakePresets.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index ae493a4c..ea5aa5cb 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -33,7 +33,7 @@ "CMAKE_MAKE_PROGRAM": "$env{MAKE_PROGRAM}", "CMAKE_C_COMPILER": "gcc", "CMAKE_CXX_COMPILER": "g++", - "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, { @@ -44,7 +44,7 @@ "Kokkos_ENABLE_DEBUG_BOUNDS_CHECK": "ON", "CMAKE_CXX_COMPILER": "$env{ARTEMIS_HOME}/external/parthenon/external/Kokkos/bin/nvcc_wrapper", "ARTEMIS_ENABLE_CUDA": "ON", - "Kokkos_ARCH_VOLTA70": "ON", + "Kokkos_ARCH_VOLTA70": "ON" } }, { @@ -54,7 +54,7 @@ "CMAKE_BUILD_TYPE": "Release", "CMAKE_CXX_COMPILER": "$env{ARTEMIS_HOME}/external/parthenon/external/Kokkos/bin/nvcc_wrapper", "ARTEMIS_ENABLE_CUDA": "ON", - "Kokkos_ARCH_VOLTA70": "ON", + "Kokkos_ARCH_VOLTA70": "ON" } }, { @@ -64,7 +64,7 @@ "CMAKE_BUILD_TYPE": "Debug", "Kokkos_ENABLE_DEBUG_BOUNDS_CHECK": "ON", "CMAKE_CXX_COMPILER": "CC", - "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include", + "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include" } }, { @@ -73,7 +73,7 @@ "CMAKE_MAKE_PROGRAM": "$env{MAKE_PROGRAM}", "CMAKE_BUILD_TYPE": "RelWithDebInfo", "CMAKE_CXX_COMPILER": "CC", - "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include", + "HDF5_INCLUDE_DIR": "$env{HDF5_ROOT}/include" } }, { From 160197dc69eecac656a1e00fe90e32979320959b Mon Sep 17 00:00:00 2001 From: Patrick Mullen Date: Tue, 9 Sep 2025 13:10:49 -0400 Subject: [PATCH 34/38] Remove coag ncalls and enforce do_gas with coag --- src/artemis.cpp | 6 +- src/artemis.hpp | 3 - src/dust/coagulation/coagulation.cpp | 35 +-- src/dust/coagulation/coagulation.hpp | 104 ++----- tst/scripts/coagulation/coag_info_den.dat | 336 ++++++++++----------- tst/scripts/coagulation/coag_info_sden.dat | 336 ++++++++++----------- tst/scripts/coagulation/coagulation.py | 4 +- 7 files changed, 377 insertions(+), 447 deletions(-) diff --git a/src/artemis.cpp b/src/artemis.cpp index fd93d694..98b922e1 100644 --- a/src/artemis.cpp +++ b/src/artemis.cpp @@ -115,9 +115,9 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { PARTHENON_REQUIRE(!(do_radiation) || (do_radiation && do_gas), "Radiation requires the gas package, but there is not gas!"); PARTHENON_REQUIRE(!(do_imc && do_moment), - "Cannot simultaneously evolve IMC and moments radiation"); - PARTHENON_REQUIRE(!(do_coagulation) || (do_coagulation && do_dust), - "Coagulation requires the dust package, but there is not dust!"); + "Cannot simultaneously evolve IMC and moments radiation!"); + PARTHENON_REQUIRE(!(do_coagulation) || (do_coagulation && (do_gas && do_dust)), + "Coagulation requires gas and dust packages, at least one missing!"); // Store configuration choices in params artemis->AddParam("do_gas", do_gas); diff --git a/src/artemis.hpp b/src/artemis.hpp index 952a34cf..0fd8cf72 100644 --- a/src/artemis.hpp +++ b/src/artemis.hpp @@ -67,9 +67,6 @@ namespace prim { ARTEMIS_VARIABLE(dust.prim, density); ARTEMIS_VARIABLE(dust.prim, velocity); } // namespace prim -namespace coag { -ARTEMIS_VARIABLE(dust.coag, ncalls); -} } // namespace dust namespace rad { diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index c52df6d8..c1b17a37 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -138,10 +138,6 @@ std::shared_ptr Initialize(ParameterInput *pin, Params &dust_pa // Fields for stashing solver diagnostics const bool info_out = pin->GetOrAddBoolean("dust/coagulation", "coag_info_out", false); params.Add("coag_info_out", info_out); - if (info_out) { - Metadata m = Metadata({Metadata::Cell, Metadata::Derived, Metadata::OneCopy}); - coag->AddField(m); - } return coag; } @@ -249,15 +245,15 @@ TaskStatus CoagulationStep(MeshData *md, const Real time, const Real dt) { auto &resolved_pkgs = pm->resolved_packages; static auto desc = MakePackDescriptor(resolved_pkgs.get()); + dust::cons::momentum, dust::prim::density, dust::prim::velocity>( + resolved_pkgs.get()); auto vmesh = desc.GetPack(md); // Global reduction of sizes (max) and dust mass (sum) before coagulation Real mass_d0 = Null(); int max_size0 = Null(); if (info_out_flag) { - PreCoagulationDiagnostics(md, vmesh, cpars, dfloor, mass_d0, max_size0); + CoagulationDiagnostics(md, vmesh, cpars, dfloor, mass_d0, max_size0); } // Coagulation @@ -319,11 +315,12 @@ TaskStatus CoagulationStep(MeshData *md, const Real time, const Real dt) { mbr.team_barrier(); // Coagulation Kernel - int ncall = 0; + // NOTE(@pdmullen): mbr.team_barrier() included at end of CoagulationOneCell + // NOTE(@pdmullen): ncall could be stored or reduced (see 0a5d72b) + int ncall = Null(); Coagulation::CoagulationOneCell(mbr, i, time1, dt_sync, gdens1, rhod, stime, vel, nvel, Q, nQs, alpha, cs1, omega1, coag, source, ncall, Q2); - // NOTE(@pdmullen): mbr.team_barrier() included at end of CoagulationOneCell... // Update dust density and momentum after coagulation parthenon::par_for_inner( @@ -336,24 +333,14 @@ TaskStatus CoagulationStep(MeshData *md, const Real time, const Real dt) { gt0 * rhod(n) * vel(vidx) * hx[d] / (rho0 * vel0); } }); - - // Diagnostics - if (info_out_flag) { - Kokkos::single(Kokkos::PerTeam(mbr), - [&]() { vmesh(b, dust::coag::ncalls(), k, j, i) = ncall; }); - } }); - // Global reduction of sizes (max) and dust mass (sum) before coagulation. Report - // diagnostics to file, including max_ncalls - Real mass_d1 = Null(); - int max_size1 = Null(); - int max_calls = Null(); + // Global reduction of sizes (max) and dust mass (sum) after coagulation if (info_out_flag) { - PostCoagulationDiagnostics(md, vmesh, cpars, dfloor, mass_d1, max_size1, - max_calls); - WriteCoagulationDiagnostics(md, time, dt, max_calls, max_size1, max_size0, mass_d1, - mass_d0); + Real mass_d1 = Null(); + int max_size1 = Null(); + CoagulationDiagnostics(md, vmesh, cpars, dfloor, mass_d1, max_size1); + WriteCoagulationDiagnostics(md, time, dt, max_size1, max_size0, mass_d1, mass_d0); } return TaskStatus::complete; diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index d3887003..eb08da56 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -12,7 +12,7 @@ //======================================================================================== // NOTE(@sli): // The dust coagulation code is modified from public available Dustpy package -// https://github.com/stammler/dustpy +// httgit@github.com:parthenon-hpc-lab/parthenon.gitps://github.com/stammler/dustpy // and from their paper (Stammler and Birnstiel (2022) ApJ 935:35) // "DustPy: A Python Package for Dust Evolution in Protoplanetary Disks" //======================================================================================== @@ -78,19 +78,19 @@ struct CoagParams { //! \fn void Dust::Coagulation::PreCoagulationDiagnostics // \brief Gather pre-coagulation diagnostics template -static void PreCoagulationDiagnostics(MeshData *md, T &vmesh, - const geometry::CoordParams &cpars, - const Real &dfloor, Real &mass_d0, int &max_size0) { +static void CoagulationDiagnostics(MeshData *md, T &vmesh, + const geometry::CoordParams &cpars, const Real &dfloor, + Real &mass_d, int &max_size) { // Indexing IndexRange ib = md->GetBoundsI(IndexDomain::interior); IndexRange jb = md->GetBoundsJ(IndexDomain::interior); IndexRange kb = md->GetBoundsK(IndexDomain::interior); // Reduction - Real lmass_d0 = 0.0; - int lmax_size0 = 1; + Real lmass_d = 0.0; + int lmax_size = 1; Kokkos::parallel_reduce( - "coag::pre-diag", + "coag::diag", Kokkos::MDRangePolicy>( {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, @@ -112,85 +112,26 @@ static void PreCoagulationDiagnostics(MeshData *md, T &vmesh, } } }, - lmass_d0, Kokkos::Max(lmax_size0)); + lmass_d, Kokkos::Max(lmax_size)); Kokkos::fence(); #ifdef MPI_PARALLEL // Sum over all processors - MPI_Allreduce(MPI_IN_PLACE, &lmax_size0, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(MPI_IN_PLACE, &lmass_d0, 1, MPI_PARTHENON_REAL, MPI_SUM, MPI_COMM_WORLD); + MPI_Allreduce(MPI_IN_PLACE, &lmax_size, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); + MPI_Allreduce(MPI_IN_PLACE, &lmass_d, 1, MPI_PARTHENON_REAL, MPI_SUM, MPI_COMM_WORLD); #endif // MPI_PARALLEL - mass_d0 = lmass_d0; - max_size0 = lmax_size0; -} - -//---------------------------------------------------------------------------------------- -//! \fn void Dust::Coagulation::PostCoagulationDiagnostics -// \brief Gather post-coagulation diagnostics -template -static void PostCoagulationDiagnostics(MeshData *md, T &vmesh, - const geometry::CoordParams &cpars, - const Real &dfloor, Real &mass_d1, int &max_size1, - int &max_calls) { - // Indexing - IndexRange ib = md->GetBoundsI(IndexDomain::interior); - IndexRange jb = md->GetBoundsJ(IndexDomain::interior); - IndexRange kb = md->GetBoundsK(IndexDomain::interior); - - // Reduction - Real lmass_d1 = 0.0; - int lmax_size1 = 1; - int lmax_calls = 1; - Kokkos::parallel_reduce( - "coag::post-diag", - Kokkos::MDRangePolicy>( - {0, kb.s, jb.s, ib.s}, {md->NumBlocks(), kb.e + 1, jb.e + 1, ib.e + 1}), - KOKKOS_LAMBDA(const int b, const int k, const int j, const int i, Real &lsum, - int &lmax1, int &lmax2) { - geometry::Coords coords(cpars, vmesh.GetCoordinates(b), k, j, i); - const Real &vol = coords.Volume(); - - // Sum over nspecies - for (int n = 0; n < vmesh.GetSize(b, dust::cons::density()); ++n) { - const Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - lsum += dens_d * vol; - } - - // Maxes - for (int n = vmesh.GetSize(b, dust::cons::density()) - 1; n >= 0; --n) { - const Real &dens_d = vmesh(b, dust::cons::density(n), k, j, i); - if (dens_d > dfloor) { - lmax1 = std::max(lmax1, n); - break; - } - } - lmax2 = - std::max(lmax2, static_cast(vmesh(b, dust::coag::ncalls(), k, j, i))); - }, - Kokkos::Sum(lmass_d1), Kokkos::Max(lmax_size1), - Kokkos::Max(lmax_calls)); - Kokkos::fence(); - -#ifdef MPI_PARALLEL - // over all processors - MPI_Allreduce(MPI_IN_PLACE, &lmass_d1, 1, MPI_PARTHENON_REAL, MPI_SUM, MPI_COMM_WORLD); - MPI_Allreduce(MPI_IN_PLACE, &lmax_size1, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); - MPI_Allreduce(MPI_IN_PLACE, &lmax_calls, 1, MPI_INT, MPI_MAX, MPI_COMM_WORLD); -#endif // MPI_PARALLEL - - mass_d1 = lmass_d1; - max_size1 = lmax_size1; - max_calls = lmax_calls; + mass_d = lmass_d; + max_size = lmax_size; } //---------------------------------------------------------------------------------------- //! \fn void Dust::Coagulation::WriteCoagulationDiagnostics // \brief Write coagulation diagnostics to file static void WriteCoagulationDiagnostics(MeshData *md, const Real time, - const Real dt, const int max_calls, - const int max_size1, const int max_size0, - const Real mass_d1, const Real mass_d0) { + const Real dt, const int max_size1, + const int max_size0, const Real mass_d1, + const Real mass_d0) { if (parthenon::Globals::my_rank == 0) { auto pm = md->GetParentPointer(); auto &artemis_pkg = pm->packages.Get("artemis"); @@ -210,14 +151,13 @@ static void WriteCoagulationDiagnostics(MeshData *md, const Real time, if ((pfile = std::fopen(fname.c_str(), "w")) == nullptr) { PARTHENON_FAIL("Error output file could not be opened"); } - std::string label = "# time dt max_calls max_size1 max_size0 "; - label.append("mass_d1 mass_d0 delta \n"); + std::string label = "# time dt max_size1 max_size0 mass_d1 mass_d0 delta \n"; std::fprintf(pfile, "%s", label.c_str()); } } std::fprintf(pfile, " %24.16e ", time); std::fprintf(pfile, " %24.16e ", dt); - std::fprintf(pfile, " %d %d %d ", max_calls, max_size1, max_size0); + std::fprintf(pfile, " %d %d ", max_size1, max_size0); std::fprintf(pfile, " %24.16e %24.16e %24.16e", mass_d1, mass_d0, 1.0 - mass_d0 / mass_d1); std::fprintf(pfile, "\n"); @@ -1021,15 +961,21 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, } } + // Update time and increment ncall time_dummy += dt; nCall++; - if (coag.use_adaptive == 1) { + // Adaptivity + if (coag.use_adaptive) { dt_sync = std::max(hnext, dt_sync); hnext = std::min(hnext, time_goal - time_dummy); } - if (nCall > coag.ncall_max) break; + // Warn and break upon reaching ncall_max + if (nCall > coag.ncall_max) { + PARTHENON_WARN("(Coagulation): Reach ncall_max in coagulation kernel!"); + break; + } } // end of internal timestep // from number density to volume density diff --git a/tst/scripts/coagulation/coag_info_den.dat b/tst/scripts/coagulation/coag_info_den.dat index 847685ed..df0b824c 100644 --- a/tst/scripts/coagulation/coag_info_den.dat +++ b/tst/scripts/coagulation/coag_info_den.dat @@ -1,168 +1,168 @@ -# time dt max_calls max_size1 max_size0 mass_d1 mass_d0 delta - 0.0000000000000000e+00 2.2500000000000000e+01 7 20 10 2.0053037235275938e-05 2.0053037235275924e-05 6.6613381477509392e-16 - 2.2500000000000000e+01 2.2500000000000000e+01 6 24 20 2.0053037235275972e-05 2.0053037235275938e-05 1.6653345369377348e-15 - 4.5000000000000000e+01 2.2500000000000000e+01 5 27 24 2.0053037235275951e-05 2.0053037235275972e-05 -1.1102230246251565e-15 - 6.7500000000000000e+01 2.2500000000000000e+01 5 29 27 2.0053037235275907e-05 2.0053037235275951e-05 -2.2204460492503131e-15 - 9.0000000000000000e+01 2.2500000000000000e+01 4 30 29 2.0053037235275941e-05 2.0053037235275907e-05 1.6653345369377348e-15 - 1.1250000000000000e+02 2.2500000000000000e+01 4 32 30 2.0053037235275924e-05 2.0053037235275941e-05 -8.8817841970012523e-16 - 1.3500000000000000e+02 2.2500000000000000e+01 4 33 32 2.0053037235275948e-05 2.0053037235275924e-05 1.2212453270876722e-15 - 1.5750000000000000e+02 2.2500000000000000e+01 3 35 33 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 - 1.8000000000000000e+02 2.2500000000000000e+01 3 36 35 2.0053037235275948e-05 2.0053037235275941e-05 3.3306690738754696e-16 - 2.0250000000000000e+02 2.2500000000000000e+01 3 37 36 2.0053037235275944e-05 2.0053037235275948e-05 -2.2204460492503131e-16 - 2.2500000000000000e+02 2.2500000000000000e+01 3 38 37 2.0053037235275958e-05 2.0053037235275944e-05 6.6613381477509392e-16 - 2.4750000000000000e+02 2.2500000000000000e+01 3 39 38 2.0053037235275958e-05 2.0053037235275958e-05 0.0000000000000000e+00 - 2.7000000000000000e+02 2.2500000000000000e+01 3 40 39 2.0053037235275924e-05 2.0053037235275958e-05 -1.7763568394002505e-15 - 2.9250000000000000e+02 2.2500000000000000e+01 3 41 40 2.0053037235275883e-05 2.0053037235275924e-05 -1.9984014443252818e-15 - 3.1500000000000000e+02 2.2500000000000000e+01 3 42 41 2.0053037235275907e-05 2.0053037235275883e-05 1.2212453270876722e-15 - 3.3750000000000000e+02 2.2500000000000000e+01 2 43 42 2.0053037235275955e-05 2.0053037235275907e-05 2.3314683517128287e-15 - 3.6000000000000000e+02 2.2500000000000000e+01 2 44 43 2.0053037235275907e-05 2.0053037235275955e-05 -2.4424906541753444e-15 - 3.8250000000000000e+02 2.2500000000000000e+01 2 45 44 2.0053037235275894e-05 2.0053037235275907e-05 -6.6613381477509392e-16 - 4.0500000000000000e+02 2.2500000000000000e+01 2 46 45 2.0053037235275894e-05 2.0053037235275894e-05 0.0000000000000000e+00 - 4.2750000000000000e+02 2.2500000000000000e+01 2 47 46 2.0053037235275944e-05 2.0053037235275894e-05 2.5535129566378600e-15 - 4.5000000000000000e+02 2.2500000000000000e+01 2 48 47 2.0053037235275985e-05 2.0053037235275944e-05 1.9984014443252818e-15 - 4.7250000000000000e+02 2.2500000000000000e+01 2 49 48 2.0053037235275955e-05 2.0053037235275985e-05 -1.5543122344752192e-15 - 4.9500000000000000e+02 2.2500000000000000e+01 2 50 49 2.0053037235275887e-05 2.0053037235275955e-05 -3.3306690738754696e-15 - 5.1750000000000000e+02 2.2500000000000000e+01 2 51 50 2.0053037235275955e-05 2.0053037235275887e-05 3.3306690738754696e-15 - 5.4000000000000000e+02 2.2500000000000000e+01 2 52 51 2.0053037235275968e-05 2.0053037235275955e-05 6.6613381477509392e-16 - 5.6250000000000000e+02 2.2500000000000000e+01 2 53 52 2.0053037235275961e-05 2.0053037235275968e-05 -4.4408920985006262e-16 - 5.8500000000000000e+02 2.2500000000000000e+01 2 53 53 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 - 6.0750000000000000e+02 2.2500000000000000e+01 2 54 53 2.0053037235275928e-05 2.0053037235275961e-05 -1.7763568394002505e-15 - 6.3000000000000000e+02 2.2500000000000000e+01 2 55 54 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 - 6.5250000000000000e+02 2.2500000000000000e+01 2 56 55 2.0053037235275904e-05 2.0053037235275975e-05 -3.5527136788005009e-15 - 6.7500000000000000e+02 2.2500000000000000e+01 2 56 56 2.0053037235275941e-05 2.0053037235275904e-05 1.8873791418627661e-15 - 6.9750000000000000e+02 2.2500000000000000e+01 2 57 56 2.0053037235275934e-05 2.0053037235275941e-05 -4.4408920985006262e-16 - 7.2000000000000000e+02 2.2500000000000000e+01 2 58 57 2.0053037235275890e-05 2.0053037235275934e-05 -2.2204460492503131e-15 - 7.4250000000000000e+02 2.2500000000000000e+01 2 58 58 2.0053037235275961e-05 2.0053037235275890e-05 3.5527136788005009e-15 - 7.6500000000000000e+02 2.2500000000000000e+01 2 59 58 2.0053037235275934e-05 2.0053037235275961e-05 -1.3322676295501878e-15 - 7.8750000000000000e+02 2.2500000000000000e+01 2 60 59 2.0053037235275883e-05 2.0053037235275934e-05 -2.4424906541753444e-15 - 8.1000000000000000e+02 2.2500000000000000e+01 2 60 60 2.0053037235275989e-05 2.0053037235275883e-05 5.2180482157382357e-15 - 8.3250000000000000e+02 2.2500000000000000e+01 2 61 60 2.0053037235275999e-05 2.0053037235275989e-05 5.5511151231257827e-16 - 8.5500000000000000e+02 2.2500000000000000e+01 2 62 61 2.0053037235275965e-05 2.0053037235275999e-05 -1.7763568394002505e-15 - 8.7750000000000000e+02 2.2500000000000000e+01 2 62 62 2.0053037235275955e-05 2.0053037235275965e-05 -4.4408920985006262e-16 - 9.0000000000000000e+02 2.2500000000000000e+01 2 63 62 2.0053037235275904e-05 2.0053037235275955e-05 -2.4424906541753444e-15 - 9.2250000000000000e+02 2.2500000000000000e+01 2 63 63 2.0053037235275955e-05 2.0053037235275904e-05 2.5535129566378600e-15 - 9.4500000000000000e+02 2.2500000000000000e+01 2 64 63 2.0053037235275924e-05 2.0053037235275955e-05 -1.5543122344752192e-15 - 9.6750000000000000e+02 2.2500000000000000e+01 2 64 64 2.0053037235275914e-05 2.0053037235275924e-05 -4.4408920985006262e-16 - 9.9000000000000000e+02 2.2500000000000000e+01 2 65 64 2.0053037235275907e-05 2.0053037235275914e-05 -4.4408920985006262e-16 - 1.0125000000000000e+03 2.2500000000000000e+01 2 65 65 2.0053037235275965e-05 2.0053037235275907e-05 2.8865798640254070e-15 - 1.0350000000000000e+03 2.2500000000000000e+01 2 66 65 2.0053037235275928e-05 2.0053037235275965e-05 -1.7763568394002505e-15 - 1.0575000000000000e+03 2.2500000000000000e+01 2 66 66 2.0053037235275961e-05 2.0053037235275928e-05 1.6653345369377348e-15 - 1.0800000000000000e+03 2.2500000000000000e+01 2 67 66 2.0053037235275975e-05 2.0053037235275961e-05 6.6613381477509392e-16 - 1.1025000000000000e+03 2.2500000000000000e+01 2 67 67 2.0053037235275999e-05 2.0053037235275975e-05 1.2212453270876722e-15 - 1.1250000000000000e+03 2.2500000000000000e+01 2 68 67 2.0053037235275938e-05 2.0053037235275999e-05 -3.1086244689504383e-15 - 1.1475000000000000e+03 2.2500000000000000e+01 2 68 68 2.0053037235275948e-05 2.0053037235275938e-05 5.5511151231257827e-16 - 1.1700000000000000e+03 2.2500000000000000e+01 2 69 68 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 - 1.1925000000000000e+03 2.2500000000000000e+01 2 69 69 2.0053037235275948e-05 2.0053037235275961e-05 -6.6613381477509392e-16 - 1.2150000000000000e+03 2.2500000000000000e+01 2 70 69 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 - 1.2375000000000000e+03 2.2500000000000000e+01 2 70 70 2.0053037235275944e-05 2.0053037235275941e-05 2.2204460492503131e-16 - 1.2600000000000000e+03 2.2500000000000000e+01 2 70 70 2.0053037235275948e-05 2.0053037235275944e-05 2.2204460492503131e-16 - 1.2825000000000000e+03 2.2500000000000000e+01 2 71 70 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 - 1.3050000000000000e+03 2.2500000000000000e+01 2 71 71 2.0053037235276009e-05 2.0053037235275941e-05 3.3306690738754696e-15 - 1.3275000000000000e+03 2.2500000000000000e+01 2 72 71 2.0053037235275877e-05 2.0053037235276009e-05 -6.6613381477509392e-15 - 1.3500000000000000e+03 2.2500000000000000e+01 2 72 72 2.0053037235275978e-05 2.0053037235275877e-05 5.1070259132757201e-15 - 1.3725000000000000e+03 2.2500000000000000e+01 2 72 72 2.0053037235276022e-05 2.0053037235275978e-05 2.2204460492503131e-15 - 1.3950000000000000e+03 2.2500000000000000e+01 2 73 72 2.0053037235276002e-05 2.0053037235276022e-05 -1.1102230246251565e-15 - 1.4175000000000000e+03 2.2500000000000000e+01 2 73 73 2.0053037235275989e-05 2.0053037235276002e-05 -6.6613381477509392e-16 - 1.4400000000000000e+03 2.2500000000000000e+01 2 74 73 2.0053037235275928e-05 2.0053037235275989e-05 -3.1086244689504383e-15 - 1.4625000000000000e+03 2.2500000000000000e+01 2 74 74 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 - 1.4850000000000000e+03 2.2500000000000000e+01 2 74 74 2.0053037235275968e-05 2.0053037235275975e-05 -4.4408920985006262e-16 - 1.5075000000000000e+03 2.2500000000000000e+01 2 75 74 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 - 1.5300000000000000e+03 2.2500000000000000e+01 2 75 75 2.0053037235275944e-05 2.0053037235275944e-05 0.0000000000000000e+00 - 1.5525000000000000e+03 2.2500000000000000e+01 2 76 75 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 - 1.5750000000000000e+03 2.2500000000000000e+01 2 76 76 2.0053037235275944e-05 2.0053037235275921e-05 1.2212453270876722e-15 - 1.5975000000000000e+03 2.2500000000000000e+01 2 76 76 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 - 1.6200000000000000e+03 2.2500000000000000e+01 2 77 76 2.0053037235275924e-05 2.0053037235275921e-05 2.2204460492503131e-16 - 1.6425000000000000e+03 2.2500000000000000e+01 2 77 77 2.0053037235275955e-05 2.0053037235275924e-05 1.5543122344752192e-15 - 1.6650000000000000e+03 2.2500000000000000e+01 2 77 77 2.0053037235275968e-05 2.0053037235275955e-05 6.6613381477509392e-16 - 1.6875000000000000e+03 2.2500000000000000e+01 2 78 77 2.0053037235275978e-05 2.0053037235275968e-05 5.5511151231257827e-16 - 1.7100000000000000e+03 2.2500000000000000e+01 2 78 78 2.0053037235276009e-05 2.0053037235275978e-05 1.5543122344752192e-15 - 1.7325000000000000e+03 2.2500000000000000e+01 2 78 78 2.0053037235275934e-05 2.0053037235276009e-05 -3.7747582837255322e-15 - 1.7550000000000000e+03 2.2500000000000000e+01 2 79 78 2.0053037235275982e-05 2.0053037235275934e-05 2.3314683517128287e-15 - 1.7775000000000000e+03 2.2500000000000000e+01 2 79 79 2.0053037235275965e-05 2.0053037235275982e-05 -8.8817841970012523e-16 - 1.8000000000000000e+03 2.2500000000000000e+01 2 79 79 2.0053037235275958e-05 2.0053037235275965e-05 -4.4408920985006262e-16 - 1.8225000000000000e+03 2.2500000000000000e+01 2 80 79 2.0053037235276009e-05 2.0053037235275958e-05 2.5535129566378600e-15 - 1.8450000000000000e+03 2.2500000000000000e+01 2 80 80 2.0053037235275985e-05 2.0053037235276009e-05 -1.1102230246251565e-15 - 1.8675000000000000e+03 2.2500000000000000e+01 2 80 80 2.0053037235276029e-05 2.0053037235275985e-05 2.2204460492503131e-15 - 1.8900000000000000e+03 2.2500000000000000e+01 2 81 80 2.0053037235275948e-05 2.0053037235276029e-05 -3.9968028886505635e-15 - 1.9125000000000000e+03 2.2500000000000000e+01 1 81 81 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 - 1.9350000000000000e+03 2.2500000000000000e+01 1 81 81 2.0053037235275941e-05 2.0053037235275961e-05 -1.1102230246251565e-15 - 1.9575000000000000e+03 2.2500000000000000e+01 1 81 81 2.0053037235275972e-05 2.0053037235275941e-05 1.5543122344752192e-15 - 1.9800000000000000e+03 2.2500000000000000e+01 1 82 81 2.0053037235276049e-05 2.0053037235275972e-05 3.8857805861880479e-15 - 2.0025000000000000e+03 2.2500000000000000e+01 1 82 82 2.0053037235275955e-05 2.0053037235276049e-05 -4.6629367034256575e-15 - 2.0250000000000000e+03 2.2500000000000000e+01 1 82 82 2.0053037235275941e-05 2.0053037235275955e-05 -6.6613381477509392e-16 - 2.0475000000000000e+03 2.2500000000000000e+01 1 82 82 2.0053037235275924e-05 2.0053037235275941e-05 -8.8817841970012523e-16 - 2.0700000000000000e+03 2.2500000000000000e+01 1 83 82 2.0053037235275944e-05 2.0053037235275924e-05 9.9920072216264089e-16 - 2.0925000000000000e+03 2.2500000000000000e+01 1 83 83 2.0053037235275951e-05 2.0053037235275944e-05 3.3306690738754696e-16 - 2.1150000000000000e+03 2.2500000000000000e+01 1 83 83 2.0053037235275972e-05 2.0053037235275951e-05 9.9920072216264089e-16 - 2.1375000000000000e+03 2.2500000000000000e+01 1 84 83 2.0053037235276002e-05 2.0053037235275972e-05 1.5543122344752192e-15 - 2.1600000000000000e+03 2.2500000000000000e+01 1 84 84 2.0053037235275995e-05 2.0053037235276002e-05 -4.4408920985006262e-16 - 2.1825000000000000e+03 2.2500000000000000e+01 1 84 84 2.0053037235275914e-05 2.0053037235275995e-05 -3.9968028886505635e-15 - 2.2050000000000000e+03 2.2500000000000000e+01 1 84 84 2.0053037235275978e-05 2.0053037235275914e-05 3.2196467714129540e-15 - 2.2275000000000000e+03 2.2500000000000000e+01 1 85 84 2.0053037235275968e-05 2.0053037235275978e-05 -4.4408920985006262e-16 - 2.2500000000000000e+03 2.2500000000000000e+01 1 85 85 2.0053037235275955e-05 2.0053037235275968e-05 -6.6613381477509392e-16 - 2.2725000000000000e+03 2.2500000000000000e+01 1 85 85 2.0053037235275951e-05 2.0053037235275955e-05 -2.2204460492503131e-16 - 2.2950000000000000e+03 2.2500000000000000e+01 1 85 85 2.0053037235275968e-05 2.0053037235275951e-05 8.8817841970012523e-16 - 2.3175000000000000e+03 2.2500000000000000e+01 1 86 85 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 - 2.3400000000000000e+03 2.2500000000000000e+01 1 86 86 2.0053037235275951e-05 2.0053037235275944e-05 3.3306690738754696e-16 - 2.3625000000000000e+03 2.2500000000000000e+01 1 86 86 2.0053037235275958e-05 2.0053037235275951e-05 3.3306690738754696e-16 - 2.3850000000000000e+03 2.2500000000000000e+01 1 86 86 2.0053037235276002e-05 2.0053037235275958e-05 2.2204460492503131e-15 - 2.4075000000000000e+03 2.2500000000000000e+01 1 87 86 2.0053037235275961e-05 2.0053037235276002e-05 -1.9984014443252818e-15 - 2.4300000000000000e+03 2.2500000000000000e+01 1 87 87 2.0053037235276012e-05 2.0053037235275961e-05 2.5535129566378600e-15 - 2.4525000000000000e+03 2.2500000000000000e+01 1 87 87 2.0053037235275978e-05 2.0053037235276012e-05 -1.7763568394002505e-15 - 2.4750000000000000e+03 2.2500000000000000e+01 1 87 87 2.0053037235276012e-05 2.0053037235275978e-05 1.6653345369377348e-15 - 2.4975000000000000e+03 2.2500000000000000e+01 1 87 87 2.0053037235275995e-05 2.0053037235276012e-05 -8.8817841970012523e-16 - 2.5200000000000000e+03 2.2500000000000000e+01 1 88 87 2.0053037235276029e-05 2.0053037235275995e-05 1.6653345369377348e-15 - 2.5425000000000000e+03 2.2500000000000000e+01 1 88 88 2.0053037235275955e-05 2.0053037235276029e-05 -3.7747582837255322e-15 - 2.5650000000000000e+03 2.2500000000000000e+01 1 88 88 2.0053037235275972e-05 2.0053037235275955e-05 8.8817841970012523e-16 - 2.5875000000000000e+03 2.2500000000000000e+01 1 88 88 2.0053037235275961e-05 2.0053037235275972e-05 -4.4408920985006262e-16 - 2.6100000000000000e+03 2.2500000000000000e+01 1 88 88 2.0053037235275944e-05 2.0053037235275961e-05 -8.8817841970012523e-16 - 2.6325000000000000e+03 2.2500000000000000e+01 1 89 88 2.0053037235275941e-05 2.0053037235275944e-05 -2.2204460492503131e-16 - 2.6550000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235276002e-05 2.0053037235275941e-05 2.9976021664879227e-15 - 2.6775000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235275928e-05 2.0053037235276002e-05 -3.7747582837255322e-15 - 2.7000000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235275961e-05 2.0053037235275928e-05 1.6653345369377348e-15 - 2.7225000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235275999e-05 2.0053037235275961e-05 1.8873791418627661e-15 - 2.7450000000000000e+03 2.2500000000000000e+01 1 89 89 2.0053037235275982e-05 2.0053037235275999e-05 -8.8817841970012523e-16 - 2.7675000000000000e+03 2.2500000000000000e+01 1 90 89 2.0053037235275944e-05 2.0053037235275982e-05 -1.7763568394002505e-15 - 2.7900000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235276002e-05 2.0053037235275944e-05 2.8865798640254070e-15 - 2.8125000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275938e-05 2.0053037235276002e-05 -3.1086244689504383e-15 - 2.8350000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275995e-05 2.0053037235275938e-05 2.8865798640254070e-15 - 2.8575000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275897e-05 2.0053037235275995e-05 -4.8849813083506888e-15 - 2.8800000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275961e-05 2.0053037235275897e-05 3.2196467714129540e-15 - 2.9025000000000000e+03 2.2500000000000000e+01 1 90 90 2.0053037235275900e-05 2.0053037235275961e-05 -3.1086244689504383e-15 - 2.9250000000000000e+03 2.2500000000000000e+01 1 91 90 2.0053037235275934e-05 2.0053037235275900e-05 1.6653345369377348e-15 - 2.9475000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275999e-05 2.0053037235275934e-05 3.2196467714129540e-15 - 2.9700000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275928e-05 2.0053037235275999e-05 -3.5527136788005009e-15 - 2.9925000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 - 3.0150000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235276016e-05 2.0053037235275972e-05 2.2204460492503131e-15 - 3.0375000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235276002e-05 2.0053037235276016e-05 -6.6613381477509392e-16 - 3.0600000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275975e-05 2.0053037235276002e-05 -1.3322676295501878e-15 - 3.0825000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275992e-05 2.0053037235275975e-05 8.8817841970012523e-16 - 3.1050000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235275985e-05 2.0053037235275992e-05 -4.4408920985006262e-16 - 3.1275000000000000e+03 2.2500000000000000e+01 1 91 91 2.0053037235276016e-05 2.0053037235275985e-05 1.5543122344752192e-15 - 3.1500000000000000e+03 2.2500000000000000e+01 1 92 91 2.0053037235276029e-05 2.0053037235276016e-05 6.6613381477509392e-16 - 3.1725000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275968e-05 2.0053037235276029e-05 -3.1086244689504383e-15 - 3.1950000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275955e-05 2.0053037235275968e-05 -6.6613381477509392e-16 - 3.2175000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235276080e-05 2.0053037235275955e-05 6.2172489379008766e-15 - 3.2400000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275999e-05 2.0053037235276080e-05 -3.9968028886505635e-15 - 3.2625000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275938e-05 2.0053037235275999e-05 -3.1086244689504383e-15 - 3.2850000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275975e-05 2.0053037235275938e-05 1.8873791418627661e-15 - 3.3075000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275951e-05 2.0053037235275975e-05 -1.1102230246251565e-15 - 3.3300000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275897e-05 2.0053037235275951e-05 -2.6645352591003757e-15 - 3.3525000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275961e-05 2.0053037235275897e-05 3.2196467714129540e-15 - 3.3750000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 - 3.3975000000000000e+03 2.2500000000000000e+01 1 92 92 2.0053037235275982e-05 2.0053037235275961e-05 9.9920072216264089e-16 - 3.4200000000000000e+03 2.2500000000000000e+01 1 93 92 2.0053037235275992e-05 2.0053037235275982e-05 5.5511151231257827e-16 - 3.4425000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275968e-05 2.0053037235275992e-05 -1.1102230246251565e-15 - 3.4650000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275928e-05 2.0053037235275968e-05 -1.9984014443252818e-15 - 3.4875000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 - 3.5100000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275982e-05 2.0053037235275972e-05 5.5511151231257827e-16 - 3.5325000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275921e-05 2.0053037235275982e-05 -3.1086244689504383e-15 - 3.5550000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275995e-05 2.0053037235275921e-05 3.6637359812630166e-15 - 3.5775000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275972e-05 2.0053037235275995e-05 -1.1102230246251565e-15 - 3.6000000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275941e-05 2.0053037235275972e-05 -1.5543122344752192e-15 - 3.6225000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275934e-05 2.0053037235275941e-05 -4.4408920985006262e-16 - 3.6450000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235276002e-05 2.0053037235275934e-05 3.3306690738754696e-15 - 3.6675000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275958e-05 2.0053037235276002e-05 -2.2204460492503131e-15 - 3.6900000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275921e-05 2.0053037235275958e-05 -1.7763568394002505e-15 - 3.7125000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235276002e-05 2.0053037235275921e-05 4.1078251911130792e-15 - 3.7350000000000000e+03 2.2500000000000000e+01 1 93 93 2.0053037235275941e-05 2.0053037235276002e-05 -3.1086244689504383e-15 +# time dt max_size1 max_size0 mass_d1 mass_d0 delta + 0.0000000000000000e+00 2.2500000000000000e+01 20 10 2.0053037235275938e-05 2.0053037235275924e-05 6.6613381477509392e-16 + 2.2500000000000000e+01 2.2500000000000000e+01 24 20 2.0053037235275972e-05 2.0053037235275938e-05 1.6653345369377348e-15 + 4.5000000000000000e+01 2.2500000000000000e+01 27 24 2.0053037235275951e-05 2.0053037235275972e-05 -1.1102230246251565e-15 + 6.7500000000000000e+01 2.2500000000000000e+01 29 27 2.0053037235275907e-05 2.0053037235275951e-05 -2.2204460492503131e-15 + 9.0000000000000000e+01 2.2500000000000000e+01 30 29 2.0053037235275941e-05 2.0053037235275907e-05 1.6653345369377348e-15 + 1.1250000000000000e+02 2.2500000000000000e+01 32 30 2.0053037235275924e-05 2.0053037235275941e-05 -8.8817841970012523e-16 + 1.3500000000000000e+02 2.2500000000000000e+01 33 32 2.0053037235275948e-05 2.0053037235275924e-05 1.2212453270876722e-15 + 1.5750000000000000e+02 2.2500000000000000e+01 35 33 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 + 1.8000000000000000e+02 2.2500000000000000e+01 36 35 2.0053037235275948e-05 2.0053037235275941e-05 3.3306690738754696e-16 + 2.0250000000000000e+02 2.2500000000000000e+01 37 36 2.0053037235275944e-05 2.0053037235275948e-05 -2.2204460492503131e-16 + 2.2500000000000000e+02 2.2500000000000000e+01 38 37 2.0053037235275958e-05 2.0053037235275944e-05 6.6613381477509392e-16 + 2.4750000000000000e+02 2.2500000000000000e+01 39 38 2.0053037235275958e-05 2.0053037235275958e-05 0.0000000000000000e+00 + 2.7000000000000000e+02 2.2500000000000000e+01 40 39 2.0053037235275924e-05 2.0053037235275958e-05 -1.7763568394002505e-15 + 2.9250000000000000e+02 2.2500000000000000e+01 41 40 2.0053037235275883e-05 2.0053037235275924e-05 -1.9984014443252818e-15 + 3.1500000000000000e+02 2.2500000000000000e+01 42 41 2.0053037235275907e-05 2.0053037235275883e-05 1.2212453270876722e-15 + 3.3750000000000000e+02 2.2500000000000000e+01 43 42 2.0053037235275955e-05 2.0053037235275907e-05 2.3314683517128287e-15 + 3.6000000000000000e+02 2.2500000000000000e+01 44 43 2.0053037235275907e-05 2.0053037235275955e-05 -2.4424906541753444e-15 + 3.8250000000000000e+02 2.2500000000000000e+01 45 44 2.0053037235275894e-05 2.0053037235275907e-05 -6.6613381477509392e-16 + 4.0500000000000000e+02 2.2500000000000000e+01 46 45 2.0053037235275894e-05 2.0053037235275894e-05 0.0000000000000000e+00 + 4.2750000000000000e+02 2.2500000000000000e+01 47 46 2.0053037235275944e-05 2.0053037235275894e-05 2.5535129566378600e-15 + 4.5000000000000000e+02 2.2500000000000000e+01 48 47 2.0053037235275985e-05 2.0053037235275944e-05 1.9984014443252818e-15 + 4.7250000000000000e+02 2.2500000000000000e+01 49 48 2.0053037235275955e-05 2.0053037235275985e-05 -1.5543122344752192e-15 + 4.9500000000000000e+02 2.2500000000000000e+01 50 49 2.0053037235275887e-05 2.0053037235275955e-05 -3.3306690738754696e-15 + 5.1750000000000000e+02 2.2500000000000000e+01 51 50 2.0053037235275955e-05 2.0053037235275887e-05 3.3306690738754696e-15 + 5.4000000000000000e+02 2.2500000000000000e+01 52 51 2.0053037235275968e-05 2.0053037235275955e-05 6.6613381477509392e-16 + 5.6250000000000000e+02 2.2500000000000000e+01 53 52 2.0053037235275961e-05 2.0053037235275968e-05 -4.4408920985006262e-16 + 5.8500000000000000e+02 2.2500000000000000e+01 53 53 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 + 6.0750000000000000e+02 2.2500000000000000e+01 54 53 2.0053037235275928e-05 2.0053037235275961e-05 -1.7763568394002505e-15 + 6.3000000000000000e+02 2.2500000000000000e+01 55 54 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 + 6.5250000000000000e+02 2.2500000000000000e+01 56 55 2.0053037235275904e-05 2.0053037235275975e-05 -3.5527136788005009e-15 + 6.7500000000000000e+02 2.2500000000000000e+01 56 56 2.0053037235275941e-05 2.0053037235275904e-05 1.8873791418627661e-15 + 6.9750000000000000e+02 2.2500000000000000e+01 57 56 2.0053037235275934e-05 2.0053037235275941e-05 -4.4408920985006262e-16 + 7.2000000000000000e+02 2.2500000000000000e+01 58 57 2.0053037235275890e-05 2.0053037235275934e-05 -2.2204460492503131e-15 + 7.4250000000000000e+02 2.2500000000000000e+01 58 58 2.0053037235275961e-05 2.0053037235275890e-05 3.5527136788005009e-15 + 7.6500000000000000e+02 2.2500000000000000e+01 59 58 2.0053037235275934e-05 2.0053037235275961e-05 -1.3322676295501878e-15 + 7.8750000000000000e+02 2.2500000000000000e+01 60 59 2.0053037235275883e-05 2.0053037235275934e-05 -2.4424906541753444e-15 + 8.1000000000000000e+02 2.2500000000000000e+01 60 60 2.0053037235275989e-05 2.0053037235275883e-05 5.2180482157382357e-15 + 8.3250000000000000e+02 2.2500000000000000e+01 61 60 2.0053037235275999e-05 2.0053037235275989e-05 5.5511151231257827e-16 + 8.5500000000000000e+02 2.2500000000000000e+01 62 61 2.0053037235275965e-05 2.0053037235275999e-05 -1.7763568394002505e-15 + 8.7750000000000000e+02 2.2500000000000000e+01 62 62 2.0053037235275955e-05 2.0053037235275965e-05 -4.4408920985006262e-16 + 9.0000000000000000e+02 2.2500000000000000e+01 63 62 2.0053037235275904e-05 2.0053037235275955e-05 -2.4424906541753444e-15 + 9.2250000000000000e+02 2.2500000000000000e+01 63 63 2.0053037235275955e-05 2.0053037235275904e-05 2.5535129566378600e-15 + 9.4500000000000000e+02 2.2500000000000000e+01 64 63 2.0053037235275924e-05 2.0053037235275955e-05 -1.5543122344752192e-15 + 9.6750000000000000e+02 2.2500000000000000e+01 64 64 2.0053037235275914e-05 2.0053037235275924e-05 -4.4408920985006262e-16 + 9.9000000000000000e+02 2.2500000000000000e+01 65 64 2.0053037235275907e-05 2.0053037235275914e-05 -4.4408920985006262e-16 + 1.0125000000000000e+03 2.2500000000000000e+01 65 65 2.0053037235275965e-05 2.0053037235275907e-05 2.8865798640254070e-15 + 1.0350000000000000e+03 2.2500000000000000e+01 66 65 2.0053037235275928e-05 2.0053037235275965e-05 -1.7763568394002505e-15 + 1.0575000000000000e+03 2.2500000000000000e+01 66 66 2.0053037235275961e-05 2.0053037235275928e-05 1.6653345369377348e-15 + 1.0800000000000000e+03 2.2500000000000000e+01 67 66 2.0053037235275975e-05 2.0053037235275961e-05 6.6613381477509392e-16 + 1.1025000000000000e+03 2.2500000000000000e+01 67 67 2.0053037235275999e-05 2.0053037235275975e-05 1.2212453270876722e-15 + 1.1250000000000000e+03 2.2500000000000000e+01 68 67 2.0053037235275938e-05 2.0053037235275999e-05 -3.1086244689504383e-15 + 1.1475000000000000e+03 2.2500000000000000e+01 68 68 2.0053037235275948e-05 2.0053037235275938e-05 5.5511151231257827e-16 + 1.1700000000000000e+03 2.2500000000000000e+01 69 68 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 + 1.1925000000000000e+03 2.2500000000000000e+01 69 69 2.0053037235275948e-05 2.0053037235275961e-05 -6.6613381477509392e-16 + 1.2150000000000000e+03 2.2500000000000000e+01 70 69 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 + 1.2375000000000000e+03 2.2500000000000000e+01 70 70 2.0053037235275944e-05 2.0053037235275941e-05 2.2204460492503131e-16 + 1.2600000000000000e+03 2.2500000000000000e+01 70 70 2.0053037235275948e-05 2.0053037235275944e-05 2.2204460492503131e-16 + 1.2825000000000000e+03 2.2500000000000000e+01 71 70 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 + 1.3050000000000000e+03 2.2500000000000000e+01 71 71 2.0053037235276009e-05 2.0053037235275941e-05 3.3306690738754696e-15 + 1.3275000000000000e+03 2.2500000000000000e+01 72 71 2.0053037235275877e-05 2.0053037235276009e-05 -6.6613381477509392e-15 + 1.3500000000000000e+03 2.2500000000000000e+01 72 72 2.0053037235275978e-05 2.0053037235275877e-05 5.1070259132757201e-15 + 1.3725000000000000e+03 2.2500000000000000e+01 72 72 2.0053037235276022e-05 2.0053037235275978e-05 2.2204460492503131e-15 + 1.3950000000000000e+03 2.2500000000000000e+01 73 72 2.0053037235276002e-05 2.0053037235276022e-05 -1.1102230246251565e-15 + 1.4175000000000000e+03 2.2500000000000000e+01 73 73 2.0053037235275989e-05 2.0053037235276002e-05 -6.6613381477509392e-16 + 1.4400000000000000e+03 2.2500000000000000e+01 74 73 2.0053037235275928e-05 2.0053037235275989e-05 -3.1086244689504383e-15 + 1.4625000000000000e+03 2.2500000000000000e+01 74 74 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 + 1.4850000000000000e+03 2.2500000000000000e+01 74 74 2.0053037235275968e-05 2.0053037235275975e-05 -4.4408920985006262e-16 + 1.5075000000000000e+03 2.2500000000000000e+01 75 74 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 + 1.5300000000000000e+03 2.2500000000000000e+01 75 75 2.0053037235275944e-05 2.0053037235275944e-05 0.0000000000000000e+00 + 1.5525000000000000e+03 2.2500000000000000e+01 76 75 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 + 1.5750000000000000e+03 2.2500000000000000e+01 76 76 2.0053037235275944e-05 2.0053037235275921e-05 1.2212453270876722e-15 + 1.5975000000000000e+03 2.2500000000000000e+01 76 76 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 + 1.6200000000000000e+03 2.2500000000000000e+01 77 76 2.0053037235275924e-05 2.0053037235275921e-05 2.2204460492503131e-16 + 1.6425000000000000e+03 2.2500000000000000e+01 77 77 2.0053037235275955e-05 2.0053037235275924e-05 1.5543122344752192e-15 + 1.6650000000000000e+03 2.2500000000000000e+01 77 77 2.0053037235275968e-05 2.0053037235275955e-05 6.6613381477509392e-16 + 1.6875000000000000e+03 2.2500000000000000e+01 78 77 2.0053037235275978e-05 2.0053037235275968e-05 5.5511151231257827e-16 + 1.7100000000000000e+03 2.2500000000000000e+01 78 78 2.0053037235276009e-05 2.0053037235275978e-05 1.5543122344752192e-15 + 1.7325000000000000e+03 2.2500000000000000e+01 78 78 2.0053037235275934e-05 2.0053037235276009e-05 -3.7747582837255322e-15 + 1.7550000000000000e+03 2.2500000000000000e+01 79 78 2.0053037235275982e-05 2.0053037235275934e-05 2.3314683517128287e-15 + 1.7775000000000000e+03 2.2500000000000000e+01 79 79 2.0053037235275965e-05 2.0053037235275982e-05 -8.8817841970012523e-16 + 1.8000000000000000e+03 2.2500000000000000e+01 79 79 2.0053037235275958e-05 2.0053037235275965e-05 -4.4408920985006262e-16 + 1.8225000000000000e+03 2.2500000000000000e+01 80 79 2.0053037235276009e-05 2.0053037235275958e-05 2.5535129566378600e-15 + 1.8450000000000000e+03 2.2500000000000000e+01 80 80 2.0053037235275985e-05 2.0053037235276009e-05 -1.1102230246251565e-15 + 1.8675000000000000e+03 2.2500000000000000e+01 80 80 2.0053037235276029e-05 2.0053037235275985e-05 2.2204460492503131e-15 + 1.8900000000000000e+03 2.2500000000000000e+01 81 80 2.0053037235275948e-05 2.0053037235276029e-05 -3.9968028886505635e-15 + 1.9125000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 + 1.9350000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275941e-05 2.0053037235275961e-05 -1.1102230246251565e-15 + 1.9575000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275972e-05 2.0053037235275941e-05 1.5543122344752192e-15 + 1.9800000000000000e+03 2.2500000000000000e+01 82 81 2.0053037235276049e-05 2.0053037235275972e-05 3.8857805861880479e-15 + 2.0025000000000000e+03 2.2500000000000000e+01 82 82 2.0053037235275955e-05 2.0053037235276049e-05 -4.6629367034256575e-15 + 2.0250000000000000e+03 2.2500000000000000e+01 82 82 2.0053037235275941e-05 2.0053037235275955e-05 -6.6613381477509392e-16 + 2.0475000000000000e+03 2.2500000000000000e+01 82 82 2.0053037235275924e-05 2.0053037235275941e-05 -8.8817841970012523e-16 + 2.0700000000000000e+03 2.2500000000000000e+01 83 82 2.0053037235275944e-05 2.0053037235275924e-05 9.9920072216264089e-16 + 2.0925000000000000e+03 2.2500000000000000e+01 83 83 2.0053037235275951e-05 2.0053037235275944e-05 3.3306690738754696e-16 + 2.1150000000000000e+03 2.2500000000000000e+01 83 83 2.0053037235275972e-05 2.0053037235275951e-05 9.9920072216264089e-16 + 2.1375000000000000e+03 2.2500000000000000e+01 84 83 2.0053037235276002e-05 2.0053037235275972e-05 1.5543122344752192e-15 + 2.1600000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235275995e-05 2.0053037235276002e-05 -4.4408920985006262e-16 + 2.1825000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235275914e-05 2.0053037235275995e-05 -3.9968028886505635e-15 + 2.2050000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235275978e-05 2.0053037235275914e-05 3.2196467714129540e-15 + 2.2275000000000000e+03 2.2500000000000000e+01 85 84 2.0053037235275968e-05 2.0053037235275978e-05 -4.4408920985006262e-16 + 2.2500000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235275955e-05 2.0053037235275968e-05 -6.6613381477509392e-16 + 2.2725000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235275951e-05 2.0053037235275955e-05 -2.2204460492503131e-16 + 2.2950000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235275968e-05 2.0053037235275951e-05 8.8817841970012523e-16 + 2.3175000000000000e+03 2.2500000000000000e+01 86 85 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 + 2.3400000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235275951e-05 2.0053037235275944e-05 3.3306690738754696e-16 + 2.3625000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235275958e-05 2.0053037235275951e-05 3.3306690738754696e-16 + 2.3850000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235276002e-05 2.0053037235275958e-05 2.2204460492503131e-15 + 2.4075000000000000e+03 2.2500000000000000e+01 87 86 2.0053037235275961e-05 2.0053037235276002e-05 -1.9984014443252818e-15 + 2.4300000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235276012e-05 2.0053037235275961e-05 2.5535129566378600e-15 + 2.4525000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235275978e-05 2.0053037235276012e-05 -1.7763568394002505e-15 + 2.4750000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235276012e-05 2.0053037235275978e-05 1.6653345369377348e-15 + 2.4975000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235275995e-05 2.0053037235276012e-05 -8.8817841970012523e-16 + 2.5200000000000000e+03 2.2500000000000000e+01 88 87 2.0053037235276029e-05 2.0053037235275995e-05 1.6653345369377348e-15 + 2.5425000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275955e-05 2.0053037235276029e-05 -3.7747582837255322e-15 + 2.5650000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275972e-05 2.0053037235275955e-05 8.8817841970012523e-16 + 2.5875000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275961e-05 2.0053037235275972e-05 -4.4408920985006262e-16 + 2.6100000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275944e-05 2.0053037235275961e-05 -8.8817841970012523e-16 + 2.6325000000000000e+03 2.2500000000000000e+01 89 88 2.0053037235275941e-05 2.0053037235275944e-05 -2.2204460492503131e-16 + 2.6550000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235276002e-05 2.0053037235275941e-05 2.9976021664879227e-15 + 2.6775000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275928e-05 2.0053037235276002e-05 -3.7747582837255322e-15 + 2.7000000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275961e-05 2.0053037235275928e-05 1.6653345369377348e-15 + 2.7225000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275999e-05 2.0053037235275961e-05 1.8873791418627661e-15 + 2.7450000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275982e-05 2.0053037235275999e-05 -8.8817841970012523e-16 + 2.7675000000000000e+03 2.2500000000000000e+01 90 89 2.0053037235275944e-05 2.0053037235275982e-05 -1.7763568394002505e-15 + 2.7900000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235276002e-05 2.0053037235275944e-05 2.8865798640254070e-15 + 2.8125000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275938e-05 2.0053037235276002e-05 -3.1086244689504383e-15 + 2.8350000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275995e-05 2.0053037235275938e-05 2.8865798640254070e-15 + 2.8575000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275897e-05 2.0053037235275995e-05 -4.8849813083506888e-15 + 2.8800000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275961e-05 2.0053037235275897e-05 3.2196467714129540e-15 + 2.9025000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275900e-05 2.0053037235275961e-05 -3.1086244689504383e-15 + 2.9250000000000000e+03 2.2500000000000000e+01 91 90 2.0053037235275934e-05 2.0053037235275900e-05 1.6653345369377348e-15 + 2.9475000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275999e-05 2.0053037235275934e-05 3.2196467714129540e-15 + 2.9700000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275928e-05 2.0053037235275999e-05 -3.5527136788005009e-15 + 2.9925000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 + 3.0150000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235276016e-05 2.0053037235275972e-05 2.2204460492503131e-15 + 3.0375000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235276002e-05 2.0053037235276016e-05 -6.6613381477509392e-16 + 3.0600000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275975e-05 2.0053037235276002e-05 -1.3322676295501878e-15 + 3.0825000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275992e-05 2.0053037235275975e-05 8.8817841970012523e-16 + 3.1050000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275985e-05 2.0053037235275992e-05 -4.4408920985006262e-16 + 3.1275000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235276016e-05 2.0053037235275985e-05 1.5543122344752192e-15 + 3.1500000000000000e+03 2.2500000000000000e+01 92 91 2.0053037235276029e-05 2.0053037235276016e-05 6.6613381477509392e-16 + 3.1725000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275968e-05 2.0053037235276029e-05 -3.1086244689504383e-15 + 3.1950000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275955e-05 2.0053037235275968e-05 -6.6613381477509392e-16 + 3.2175000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235276080e-05 2.0053037235275955e-05 6.2172489379008766e-15 + 3.2400000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275999e-05 2.0053037235276080e-05 -3.9968028886505635e-15 + 3.2625000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275938e-05 2.0053037235275999e-05 -3.1086244689504383e-15 + 3.2850000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275975e-05 2.0053037235275938e-05 1.8873791418627661e-15 + 3.3075000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275951e-05 2.0053037235275975e-05 -1.1102230246251565e-15 + 3.3300000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275897e-05 2.0053037235275951e-05 -2.6645352591003757e-15 + 3.3525000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275961e-05 2.0053037235275897e-05 3.2196467714129540e-15 + 3.3750000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 + 3.3975000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275982e-05 2.0053037235275961e-05 9.9920072216264089e-16 + 3.4200000000000000e+03 2.2500000000000000e+01 93 92 2.0053037235275992e-05 2.0053037235275982e-05 5.5511151231257827e-16 + 3.4425000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275968e-05 2.0053037235275992e-05 -1.1102230246251565e-15 + 3.4650000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275928e-05 2.0053037235275968e-05 -1.9984014443252818e-15 + 3.4875000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 + 3.5100000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275982e-05 2.0053037235275972e-05 5.5511151231257827e-16 + 3.5325000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275921e-05 2.0053037235275982e-05 -3.1086244689504383e-15 + 3.5550000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275995e-05 2.0053037235275921e-05 3.6637359812630166e-15 + 3.5775000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275972e-05 2.0053037235275995e-05 -1.1102230246251565e-15 + 3.6000000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275941e-05 2.0053037235275972e-05 -1.5543122344752192e-15 + 3.6225000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275934e-05 2.0053037235275941e-05 -4.4408920985006262e-16 + 3.6450000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235276002e-05 2.0053037235275934e-05 3.3306690738754696e-15 + 3.6675000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275958e-05 2.0053037235276002e-05 -2.2204460492503131e-15 + 3.6900000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275921e-05 2.0053037235275958e-05 -1.7763568394002505e-15 + 3.7125000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235276002e-05 2.0053037235275921e-05 4.1078251911130792e-15 + 3.7350000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275941e-05 2.0053037235276002e-05 -3.1086244689504383e-15 diff --git a/tst/scripts/coagulation/coag_info_sden.dat b/tst/scripts/coagulation/coag_info_sden.dat index 39fb55d3..d160b28f 100644 --- a/tst/scripts/coagulation/coag_info_sden.dat +++ b/tst/scripts/coagulation/coag_info_sden.dat @@ -1,168 +1,168 @@ -# time dt max_calls max_size1 max_size0 mass_d1 mass_d0 delta - 0.0000000000000000e+00 2.2500000000000000e+01 6 19 10 2.5132741228718358e-06 2.5132741228718329e-06 1.2212453270876722e-15 - 2.2500000000000000e+01 2.2500000000000000e+01 5 23 19 2.5132741228718354e-06 2.5132741228718358e-06 -2.2204460492503131e-16 - 4.5000000000000000e+01 2.2500000000000000e+01 4 26 23 2.5132741228718312e-06 2.5132741228718354e-06 -1.7763568394002505e-15 - 6.7500000000000000e+01 2.2500000000000000e+01 4 28 26 2.5132741228718325e-06 2.5132741228718312e-06 5.5511151231257827e-16 - 9.0000000000000000e+01 2.2500000000000000e+01 4 29 28 2.5132741228718358e-06 2.5132741228718325e-06 1.3322676295501878e-15 - 1.1250000000000000e+02 2.2500000000000000e+01 3 31 29 2.5132741228718342e-06 2.5132741228718358e-06 -6.6613381477509392e-16 - 1.3500000000000000e+02 2.2500000000000000e+01 3 32 31 2.5132741228718286e-06 2.5132741228718342e-06 -2.2204460492503131e-15 - 1.5750000000000000e+02 2.2500000000000000e+01 3 34 32 2.5132741228718325e-06 2.5132741228718286e-06 1.5543122344752192e-15 - 1.8000000000000000e+02 2.2500000000000000e+01 3 35 34 2.5132741228718333e-06 2.5132741228718325e-06 3.3306690738754696e-16 - 2.0250000000000000e+02 2.2500000000000000e+01 3 36 35 2.5132741228718299e-06 2.5132741228718333e-06 -1.3322676295501878e-15 - 2.2500000000000000e+02 2.2500000000000000e+01 3 37 36 2.5132741228718286e-06 2.5132741228718299e-06 -4.4408920985006262e-16 - 2.4750000000000000e+02 2.2500000000000000e+01 3 38 37 2.5132741228718316e-06 2.5132741228718286e-06 1.2212453270876722e-15 - 2.7000000000000000e+02 2.2500000000000000e+01 2 39 38 2.5132741228718337e-06 2.5132741228718316e-06 8.8817841970012523e-16 - 2.9250000000000000e+02 2.2500000000000000e+01 2 40 39 2.5132741228718299e-06 2.5132741228718337e-06 -1.5543122344752192e-15 - 3.1500000000000000e+02 2.2500000000000000e+01 2 41 40 2.5132741228718392e-06 2.5132741228718299e-06 3.6637359812630166e-15 - 3.3750000000000000e+02 2.2500000000000000e+01 2 42 41 2.5132741228718384e-06 2.5132741228718392e-06 -4.4408920985006262e-16 - 3.6000000000000000e+02 2.2500000000000000e+01 2 43 42 2.5132741228718414e-06 2.5132741228718384e-06 1.2212453270876722e-15 - 3.8250000000000000e+02 2.2500000000000000e+01 2 44 43 2.5132741228718358e-06 2.5132741228718414e-06 -2.2204460492503131e-15 - 4.0500000000000000e+02 2.2500000000000000e+01 2 45 44 2.5132741228718333e-06 2.5132741228718358e-06 -1.1102230246251565e-15 - 4.2750000000000000e+02 2.2500000000000000e+01 2 46 45 2.5132741228718363e-06 2.5132741228718333e-06 1.2212453270876722e-15 - 4.5000000000000000e+02 2.2500000000000000e+01 2 47 46 2.5132741228718392e-06 2.5132741228718363e-06 1.2212453270876722e-15 - 4.7250000000000000e+02 2.2500000000000000e+01 2 48 47 2.5132741228718342e-06 2.5132741228718392e-06 -1.9984014443252818e-15 - 4.9500000000000000e+02 2.2500000000000000e+01 2 49 48 2.5132741228718401e-06 2.5132741228718342e-06 2.3314683517128287e-15 - 5.1750000000000000e+02 2.2500000000000000e+01 2 50 49 2.5132741228718346e-06 2.5132741228718401e-06 -2.2204460492503131e-15 - 5.4000000000000000e+02 2.2500000000000000e+01 2 51 50 2.5132741228718384e-06 2.5132741228718346e-06 1.5543122344752192e-15 - 5.6250000000000000e+02 2.2500000000000000e+01 2 52 51 2.5132741228718346e-06 2.5132741228718384e-06 -1.5543122344752192e-15 - 5.8500000000000000e+02 2.2500000000000000e+01 2 52 52 2.5132741228718358e-06 2.5132741228718346e-06 5.5511151231257827e-16 - 6.0750000000000000e+02 2.2500000000000000e+01 2 53 52 2.5132741228718384e-06 2.5132741228718358e-06 9.9920072216264089e-16 - 6.3000000000000000e+02 2.2500000000000000e+01 2 54 53 2.5132741228718414e-06 2.5132741228718384e-06 1.2212453270876722e-15 - 6.5250000000000000e+02 2.2500000000000000e+01 2 55 54 2.5132741228718388e-06 2.5132741228718414e-06 -1.1102230246251565e-15 - 6.7500000000000000e+02 2.2500000000000000e+01 2 55 55 2.5132741228718367e-06 2.5132741228718388e-06 -8.8817841970012523e-16 - 6.9750000000000000e+02 2.2500000000000000e+01 2 56 55 2.5132741228718405e-06 2.5132741228718367e-06 1.5543122344752192e-15 - 7.2000000000000000e+02 2.2500000000000000e+01 2 57 56 2.5132741228718375e-06 2.5132741228718405e-06 -1.1102230246251565e-15 - 7.4250000000000000e+02 2.2500000000000000e+01 2 58 57 2.5132741228718363e-06 2.5132741228718375e-06 -4.4408920985006262e-16 - 7.6500000000000000e+02 2.2500000000000000e+01 2 58 58 2.5132741228718380e-06 2.5132741228718363e-06 6.6613381477509392e-16 - 7.8750000000000000e+02 2.2500000000000000e+01 2 59 58 2.5132741228718401e-06 2.5132741228718380e-06 8.8817841970012523e-16 - 8.1000000000000000e+02 2.2500000000000000e+01 2 60 59 2.5132741228718354e-06 2.5132741228718401e-06 -1.7763568394002505e-15 - 8.3250000000000000e+02 2.2500000000000000e+01 2 60 60 2.5132741228718384e-06 2.5132741228718354e-06 1.2212453270876722e-15 - 8.5500000000000000e+02 2.2500000000000000e+01 2 61 60 2.5132741228718388e-06 2.5132741228718384e-06 2.2204460492503131e-16 - 8.7750000000000000e+02 2.2500000000000000e+01 2 61 61 2.5132741228718405e-06 2.5132741228718388e-06 6.6613381477509392e-16 - 9.0000000000000000e+02 2.2500000000000000e+01 2 62 61 2.5132741228718367e-06 2.5132741228718405e-06 -1.5543122344752192e-15 - 9.2250000000000000e+02 2.2500000000000000e+01 2 63 62 2.5132741228718346e-06 2.5132741228718367e-06 -8.8817841970012523e-16 - 9.4500000000000000e+02 2.2500000000000000e+01 2 63 63 2.5132741228718367e-06 2.5132741228718346e-06 8.8817841970012523e-16 - 9.6750000000000000e+02 2.2500000000000000e+01 2 64 63 2.5132741228718333e-06 2.5132741228718367e-06 -1.3322676295501878e-15 - 9.9000000000000000e+02 2.2500000000000000e+01 2 64 64 2.5132741228718375e-06 2.5132741228718333e-06 1.6653345369377348e-15 - 1.0125000000000000e+03 2.2500000000000000e+01 2 65 64 2.5132741228718388e-06 2.5132741228718375e-06 5.5511151231257827e-16 - 1.0350000000000000e+03 2.2500000000000000e+01 2 65 65 2.5132741228718401e-06 2.5132741228718388e-06 5.5511151231257827e-16 - 1.0575000000000000e+03 2.2500000000000000e+01 2 66 65 2.5132741228718329e-06 2.5132741228718401e-06 -2.8865798640254070e-15 - 1.0800000000000000e+03 2.2500000000000000e+01 2 66 66 2.5132741228718439e-06 2.5132741228718329e-06 4.3298697960381105e-15 - 1.1025000000000000e+03 2.2500000000000000e+01 2 67 66 2.5132741228718426e-06 2.5132741228718439e-06 -4.4408920985006262e-16 - 1.1250000000000000e+03 2.2500000000000000e+01 2 67 67 2.5132741228718384e-06 2.5132741228718426e-06 -1.7763568394002505e-15 - 1.1475000000000000e+03 2.2500000000000000e+01 2 68 67 2.5132741228718303e-06 2.5132741228718384e-06 -3.1086244689504383e-15 - 1.1700000000000000e+03 2.2500000000000000e+01 2 68 68 2.5132741228718337e-06 2.5132741228718303e-06 1.3322676295501878e-15 - 1.1925000000000000e+03 2.2500000000000000e+01 2 69 68 2.5132741228718430e-06 2.5132741228718337e-06 3.6637359812630166e-15 - 1.2150000000000000e+03 2.2500000000000000e+01 2 69 69 2.5132741228718405e-06 2.5132741228718430e-06 -1.1102230246251565e-15 - 1.2375000000000000e+03 2.2500000000000000e+01 2 70 69 2.5132741228718367e-06 2.5132741228718405e-06 -1.5543122344752192e-15 - 1.2600000000000000e+03 2.2500000000000000e+01 2 70 70 2.5132741228718358e-06 2.5132741228718367e-06 -4.4408920985006262e-16 - 1.2825000000000000e+03 2.2500000000000000e+01 2 71 70 2.5132741228718418e-06 2.5132741228718358e-06 2.3314683517128287e-15 - 1.3050000000000000e+03 2.2500000000000000e+01 2 71 71 2.5132741228718477e-06 2.5132741228718418e-06 2.3314683517128287e-15 - 1.3275000000000000e+03 2.2500000000000000e+01 2 72 71 2.5132741228718350e-06 2.5132741228718477e-06 -5.1070259132757201e-15 - 1.3500000000000000e+03 2.2500000000000000e+01 2 72 72 2.5132741228718316e-06 2.5132741228718350e-06 -1.3322676295501878e-15 - 1.3725000000000000e+03 2.2500000000000000e+01 2 73 72 2.5132741228718409e-06 2.5132741228718316e-06 3.6637359812630166e-15 - 1.3950000000000000e+03 2.2500000000000000e+01 2 73 73 2.5132741228718358e-06 2.5132741228718409e-06 -1.9984014443252818e-15 - 1.4175000000000000e+03 2.2500000000000000e+01 2 74 73 2.5132741228718350e-06 2.5132741228718358e-06 -4.4408920985006262e-16 - 1.4400000000000000e+03 2.2500000000000000e+01 2 74 74 2.5132741228718401e-06 2.5132741228718350e-06 1.9984014443252818e-15 - 1.4625000000000000e+03 2.2500000000000000e+01 2 75 74 2.5132741228718316e-06 2.5132741228718401e-06 -3.3306690738754696e-15 - 1.4850000000000000e+03 2.2500000000000000e+01 2 75 75 2.5132741228718456e-06 2.5132741228718316e-06 5.5511151231257827e-15 - 1.5075000000000000e+03 2.2500000000000000e+01 2 76 75 2.5132741228718354e-06 2.5132741228718456e-06 -3.9968028886505635e-15 - 1.5300000000000000e+03 2.2500000000000000e+01 2 76 76 2.5132741228718405e-06 2.5132741228718354e-06 1.9984014443252818e-15 - 1.5525000000000000e+03 2.2500000000000000e+01 2 77 76 2.5132741228718397e-06 2.5132741228718405e-06 -4.4408920985006262e-16 - 1.5750000000000000e+03 2.2500000000000000e+01 2 77 77 2.5132741228718414e-06 2.5132741228718397e-06 6.6613381477509392e-16 - 1.5975000000000000e+03 2.2500000000000000e+01 2 78 77 2.5132741228718392e-06 2.5132741228718414e-06 -8.8817841970012523e-16 - 1.6200000000000000e+03 2.2500000000000000e+01 2 78 78 2.5132741228718439e-06 2.5132741228718392e-06 1.8873791418627661e-15 - 1.6425000000000000e+03 2.2500000000000000e+01 2 79 78 2.5132741228718418e-06 2.5132741228718439e-06 -8.8817841970012523e-16 - 1.6650000000000000e+03 2.2500000000000000e+01 2 80 79 2.5132741228718384e-06 2.5132741228718418e-06 -1.3322676295501878e-15 - 1.6875000000000000e+03 2.2500000000000000e+01 2 80 80 2.5132741228718371e-06 2.5132741228718384e-06 -4.4408920985006262e-16 - 1.7100000000000000e+03 2.2500000000000000e+01 2 81 80 2.5132741228718375e-06 2.5132741228718371e-06 2.2204460492503131e-16 - 1.7325000000000000e+03 2.2500000000000000e+01 2 82 81 2.5132741228718342e-06 2.5132741228718375e-06 -1.3322676295501878e-15 - 1.7550000000000000e+03 2.2500000000000000e+01 2 82 82 2.5132741228718358e-06 2.5132741228718342e-06 6.6613381477509392e-16 - 1.7775000000000000e+03 2.2500000000000000e+01 2 83 82 2.5132741228718354e-06 2.5132741228718358e-06 -2.2204460492503131e-16 - 1.8000000000000000e+03 2.2500000000000000e+01 2 84 83 2.5132741228718384e-06 2.5132741228718354e-06 1.2212453270876722e-15 - 1.8225000000000000e+03 2.2500000000000000e+01 2 84 84 2.5132741228718435e-06 2.5132741228718384e-06 1.9984014443252818e-15 - 1.8450000000000000e+03 2.2500000000000000e+01 2 85 84 2.5132741228718486e-06 2.5132741228718435e-06 1.9984014443252818e-15 - 1.8675000000000000e+03 2.2500000000000000e+01 2 86 85 2.5132741228718430e-06 2.5132741228718486e-06 -2.2204460492503131e-15 - 1.8900000000000000e+03 2.2500000000000000e+01 2 86 86 2.5132741228718426e-06 2.5132741228718430e-06 -2.2204460492503131e-16 - 1.9125000000000000e+03 2.2500000000000000e+01 2 87 86 2.5132741228718430e-06 2.5132741228718426e-06 2.2204460492503131e-16 - 1.9350000000000000e+03 2.2500000000000000e+01 2 88 87 2.5132741228718405e-06 2.5132741228718430e-06 -1.1102230246251565e-15 - 1.9575000000000000e+03 2.2500000000000000e+01 2 89 88 2.5132741228718574e-06 2.5132741228718405e-06 6.7723604502134549e-15 - 1.9800000000000000e+03 2.2500000000000000e+01 2 89 89 2.5132741228719405e-06 2.5132741228718574e-06 3.2973623831367149e-14 - 2.0025000000000000e+03 2.2500000000000000e+01 2 90 89 2.5132741228722437e-06 2.5132741228719405e-06 1.2068124277675452e-13 - 2.0250000000000000e+03 2.2500000000000000e+01 1 90 90 2.5132741228730831e-06 2.5132741228722437e-06 3.3395508580724709e-13 - 2.0475000000000000e+03 2.2500000000000000e+01 1 90 90 2.5132741228750389e-06 2.5132741228730831e-06 7.7815531795977222e-13 - 2.0700000000000000e+03 2.2500000000000000e+01 1 91 90 2.5132741228786938e-06 2.5132741228750389e-06 1.4542811399564926e-12 - 2.0925000000000000e+03 2.2500000000000000e+01 1 91 91 2.5132741228842970e-06 2.5132741228786938e-06 2.2294388557497768e-12 - 2.1150000000000000e+03 2.2500000000000000e+01 1 91 91 2.5132741228917958e-06 2.5132741228842970e-06 2.9837243786801082e-12 - 2.1375000000000000e+03 2.2500000000000000e+01 1 92 91 2.5132741229007311e-06 2.5132741228917958e-06 3.5552671917571388e-12 - 2.1600000000000000e+03 2.2500000000000000e+01 1 92 92 2.5132741229105588e-06 2.5132741229007311e-06 3.9103165150322639e-12 - 2.1825000000000000e+03 2.2500000000000000e+01 1 92 92 2.5132741229207257e-06 2.5132741229105588e-06 4.0453196348266829e-12 - 2.2050000000000000e+03 2.2500000000000000e+01 1 93 92 2.5132741229307720e-06 2.5132741229207257e-06 3.9972469778604136e-12 - 2.2275000000000000e+03 2.2500000000000000e+01 1 93 93 2.5132741229403773e-06 2.5132741229307720e-06 3.8218317399696389e-12 - 2.2500000000000000e+03 2.2500000000000000e+01 1 93 93 2.5132741229493406e-06 2.5132741229403773e-06 3.5663694220033904e-12 - 2.2725000000000000e+03 2.2500000000000000e+01 1 94 93 2.5132741229575742e-06 2.5132741229493406e-06 3.2760461010639119e-12 - 2.2950000000000000e+03 2.2500000000000000e+01 1 94 94 2.5132741229650175e-06 2.5132741229575742e-06 2.9616309404900676e-12 - 2.3175000000000000e+03 2.2500000000000000e+01 1 94 94 2.5132741229717112e-06 2.5132741229650175e-06 2.6633140137732880e-12 - 2.3400000000000000e+03 2.2500000000000000e+01 1 94 94 2.5132741229776857e-06 2.5132741229717112e-06 2.3772095403273852e-12 - 2.3625000000000000e+03 2.2500000000000000e+01 1 94 94 2.5132741229830068e-06 2.5132741229776857e-06 2.1171953079601735e-12 - 2.3850000000000000e+03 2.2500000000000000e+01 1 95 94 2.5132741229877540e-06 2.5132741229830068e-06 1.8888224317947788e-12 - 2.4075000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741229920044e-06 2.5132741229877540e-06 1.6912027334115010e-12 - 2.4300000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741229958173e-06 2.5132741229920044e-06 1.5171197631502764e-12 - 2.4525000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741229992487e-06 2.5132741229958173e-06 1.3652412533815550e-12 - 2.4750000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741230023522e-06 2.5132741229992487e-06 1.2349010702905616e-12 - 2.4975000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741230051855e-06 2.5132741230023522e-06 1.1273204592043840e-12 - 2.5200000000000000e+03 2.2500000000000000e+01 1 95 95 2.5132741230077969e-06 2.5132741230051855e-06 1.0390577287466840e-12 - 2.5425000000000000e+03 2.2500000000000000e+01 1 96 95 2.5132741230102114e-06 2.5132741230077969e-06 9.6067598320814795e-13 - 2.5650000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230124598e-06 2.5132741230102114e-06 8.9461771324295114e-13 - 2.5875000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230145901e-06 2.5132741230124598e-06 8.4765527930130702e-13 - 2.6100000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230166061e-06 2.5132741230145901e-06 8.0213613529167560e-13 - 2.6325000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230185301e-06 2.5132741230166061e-06 7.6549877547904543e-13 - 2.6550000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230203881e-06 2.5132741230185301e-06 7.3929751209789174e-13 - 2.6775000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230221808e-06 2.5132741230203881e-06 7.1331829332166308e-13 - 2.7000000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230239219e-06 2.5132741230221808e-06 6.9277916736609768e-13 - 2.7225000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230256176e-06 2.5132741230239219e-06 6.7468253206470763e-13 - 2.7450000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230272791e-06 2.5132741230256176e-06 6.6102678886181820e-13 - 2.7675000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230289215e-06 2.5132741230272791e-06 6.5347727229436714e-13 - 2.7900000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230305279e-06 2.5132741230289215e-06 6.3915539527670262e-13 - 2.8125000000000000e+03 2.2500000000000000e+01 1 96 96 2.5132741230321013e-06 2.5132741230305279e-06 6.2605476358612577e-13 - 2.8350000000000000e+03 2.2500000000000000e+01 1 97 96 2.5132741230336687e-06 2.5132741230321013e-06 6.2361227293195043e-13 - 2.8575000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230352116e-06 2.5132741230336687e-06 6.1384231031524905e-13 - 2.8800000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230367248e-06 2.5132741230352116e-06 6.0207394625422239e-13 - 2.9025000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230382274e-06 2.5132741230367248e-06 5.9785509876064680e-13 - 2.9250000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230397068e-06 2.5132741230382274e-06 5.8864024765625800e-13 - 2.9475000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230411713e-06 2.5132741230397068e-06 5.8275606562574467e-13 - 2.9700000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230426193e-06 2.5132741230411713e-06 5.7609472747799373e-13 - 2.9925000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230440393e-06 2.5132741230426193e-06 5.6499249723174216e-13 - 3.0150000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230454361e-06 2.5132741230440393e-06 5.5577764612735336e-13 - 3.0375000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230468155e-06 2.5132741230454361e-06 5.4889426337467739e-13 - 3.0600000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230481707e-06 2.5132741230468155e-06 5.3923532306043853e-13 - 3.0825000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230495213e-06 2.5132741230481707e-06 5.3734794391857577e-13 - 3.1050000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230508266e-06 2.5132741230495213e-06 5.1936233091964823e-13 - 3.1275000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230521357e-06 2.5132741230508266e-06 5.2091664315412345e-13 - 3.1500000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230534092e-06 2.5132741230521357e-06 5.0670578843892145e-13 - 3.1725000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230546561e-06 2.5132741230534092e-06 4.9604764740251994e-13 - 3.1950000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230558936e-06 2.5132741230546561e-06 4.9238391142125693e-13 - 3.2175000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230571023e-06 2.5132741230558936e-06 4.8094861426761781e-13 - 3.2400000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230583046e-06 2.5132741230571023e-06 4.7839510131097995e-13 - 3.2625000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230594854e-06 2.5132741230583046e-06 4.6984638402136625e-13 - 3.2850000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230606552e-06 2.5132741230594854e-06 4.6540549192286562e-13 - 3.3075000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230617940e-06 2.5132741230606552e-06 4.5308201634952638e-13 - 3.3300000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230629269e-06 2.5132741230617940e-06 4.5075054799781356e-13 - 3.3525000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230640424e-06 2.5132741230629269e-06 4.4386716524513758e-13 - 3.3750000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230651491e-06 2.5132741230640424e-06 4.4031445156633708e-13 - 3.3975000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230662375e-06 2.5132741230651491e-06 4.3309800190627357e-13 - 3.4200000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230673239e-06 2.5132741230662375e-06 4.3220982348657344e-13 - 3.4425000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230683860e-06 2.5132741230673239e-06 4.2266190547479709e-13 - 3.4650000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230694452e-06 2.5132741230683860e-06 4.2144066014770942e-13 - 3.4875000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230704871e-06 2.5132741230694452e-06 4.1455727739503345e-13 - 3.5100000000000000e+03 2.2500000000000000e+01 1 97 97 2.5132741230715404e-06 2.5132741230704871e-06 4.1910919179599659e-13 - 3.5325000000000000e+03 2.2500000000000000e+01 1 98 97 2.5132741230725543e-06 2.5132741230715404e-06 4.0345504714878189e-13 - 3.5550000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230735775e-06 2.5132741230725543e-06 4.0711878313004490e-13 - 3.5775000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230745910e-06 2.5132741230735775e-06 4.0323300254385686e-13 - 3.6000000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230756074e-06 2.5132741230745910e-06 4.0445424787094453e-13 - 3.6225000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230765976e-06 2.5132741230756074e-06 3.9401815143946806e-13 - 3.6450000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230776030e-06 2.5132741230765976e-06 4.0001335577244390e-13 - 3.6675000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230785830e-06 2.5132741230776030e-06 3.8991032624835498e-13 - 3.6900000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230795631e-06 2.5132741230785830e-06 3.8991032624835498e-13 - 3.7125000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230805426e-06 2.5132741230795631e-06 3.8979930394589246e-13 - 3.7350000000000000e+03 2.2500000000000000e+01 1 98 98 2.5132741230815070e-06 2.5132741230805426e-06 3.8369307731045410e-13 +# time dt max_size1 max_size0 mass_d1 mass_d0 delta + 0.0000000000000000e+00 2.2500000000000000e+01 19 10 2.5132741228718358e-06 2.5132741228718329e-06 1.2212453270876722e-15 + 2.2500000000000000e+01 2.2500000000000000e+01 23 19 2.5132741228718354e-06 2.5132741228718358e-06 -2.2204460492503131e-16 + 4.5000000000000000e+01 2.2500000000000000e+01 26 23 2.5132741228718312e-06 2.5132741228718354e-06 -1.7763568394002505e-15 + 6.7500000000000000e+01 2.2500000000000000e+01 28 26 2.5132741228718325e-06 2.5132741228718312e-06 5.5511151231257827e-16 + 9.0000000000000000e+01 2.2500000000000000e+01 29 28 2.5132741228718358e-06 2.5132741228718325e-06 1.3322676295501878e-15 + 1.1250000000000000e+02 2.2500000000000000e+01 31 29 2.5132741228718342e-06 2.5132741228718358e-06 -6.6613381477509392e-16 + 1.3500000000000000e+02 2.2500000000000000e+01 32 31 2.5132741228718286e-06 2.5132741228718342e-06 -2.2204460492503131e-15 + 1.5750000000000000e+02 2.2500000000000000e+01 34 32 2.5132741228718325e-06 2.5132741228718286e-06 1.5543122344752192e-15 + 1.8000000000000000e+02 2.2500000000000000e+01 35 34 2.5132741228718333e-06 2.5132741228718325e-06 3.3306690738754696e-16 + 2.0250000000000000e+02 2.2500000000000000e+01 36 35 2.5132741228718299e-06 2.5132741228718333e-06 -1.3322676295501878e-15 + 2.2500000000000000e+02 2.2500000000000000e+01 37 36 2.5132741228718286e-06 2.5132741228718299e-06 -4.4408920985006262e-16 + 2.4750000000000000e+02 2.2500000000000000e+01 38 37 2.5132741228718316e-06 2.5132741228718286e-06 1.2212453270876722e-15 + 2.7000000000000000e+02 2.2500000000000000e+01 39 38 2.5132741228718337e-06 2.5132741228718316e-06 8.8817841970012523e-16 + 2.9250000000000000e+02 2.2500000000000000e+01 40 39 2.5132741228718299e-06 2.5132741228718337e-06 -1.5543122344752192e-15 + 3.1500000000000000e+02 2.2500000000000000e+01 41 40 2.5132741228718392e-06 2.5132741228718299e-06 3.6637359812630166e-15 + 3.3750000000000000e+02 2.2500000000000000e+01 42 41 2.5132741228718384e-06 2.5132741228718392e-06 -4.4408920985006262e-16 + 3.6000000000000000e+02 2.2500000000000000e+01 43 42 2.5132741228718414e-06 2.5132741228718384e-06 1.2212453270876722e-15 + 3.8250000000000000e+02 2.2500000000000000e+01 44 43 2.5132741228718358e-06 2.5132741228718414e-06 -2.2204460492503131e-15 + 4.0500000000000000e+02 2.2500000000000000e+01 45 44 2.5132741228718333e-06 2.5132741228718358e-06 -1.1102230246251565e-15 + 4.2750000000000000e+02 2.2500000000000000e+01 46 45 2.5132741228718363e-06 2.5132741228718333e-06 1.2212453270876722e-15 + 4.5000000000000000e+02 2.2500000000000000e+01 47 46 2.5132741228718392e-06 2.5132741228718363e-06 1.2212453270876722e-15 + 4.7250000000000000e+02 2.2500000000000000e+01 48 47 2.5132741228718342e-06 2.5132741228718392e-06 -1.9984014443252818e-15 + 4.9500000000000000e+02 2.2500000000000000e+01 49 48 2.5132741228718401e-06 2.5132741228718342e-06 2.3314683517128287e-15 + 5.1750000000000000e+02 2.2500000000000000e+01 50 49 2.5132741228718346e-06 2.5132741228718401e-06 -2.2204460492503131e-15 + 5.4000000000000000e+02 2.2500000000000000e+01 51 50 2.5132741228718384e-06 2.5132741228718346e-06 1.5543122344752192e-15 + 5.6250000000000000e+02 2.2500000000000000e+01 52 51 2.5132741228718346e-06 2.5132741228718384e-06 -1.5543122344752192e-15 + 5.8500000000000000e+02 2.2500000000000000e+01 52 52 2.5132741228718358e-06 2.5132741228718346e-06 5.5511151231257827e-16 + 6.0750000000000000e+02 2.2500000000000000e+01 53 52 2.5132741228718384e-06 2.5132741228718358e-06 9.9920072216264089e-16 + 6.3000000000000000e+02 2.2500000000000000e+01 54 53 2.5132741228718414e-06 2.5132741228718384e-06 1.2212453270876722e-15 + 6.5250000000000000e+02 2.2500000000000000e+01 55 54 2.5132741228718388e-06 2.5132741228718414e-06 -1.1102230246251565e-15 + 6.7500000000000000e+02 2.2500000000000000e+01 55 55 2.5132741228718367e-06 2.5132741228718388e-06 -8.8817841970012523e-16 + 6.9750000000000000e+02 2.2500000000000000e+01 56 55 2.5132741228718405e-06 2.5132741228718367e-06 1.5543122344752192e-15 + 7.2000000000000000e+02 2.2500000000000000e+01 57 56 2.5132741228718375e-06 2.5132741228718405e-06 -1.1102230246251565e-15 + 7.4250000000000000e+02 2.2500000000000000e+01 58 57 2.5132741228718363e-06 2.5132741228718375e-06 -4.4408920985006262e-16 + 7.6500000000000000e+02 2.2500000000000000e+01 58 58 2.5132741228718380e-06 2.5132741228718363e-06 6.6613381477509392e-16 + 7.8750000000000000e+02 2.2500000000000000e+01 59 58 2.5132741228718401e-06 2.5132741228718380e-06 8.8817841970012523e-16 + 8.1000000000000000e+02 2.2500000000000000e+01 60 59 2.5132741228718354e-06 2.5132741228718401e-06 -1.7763568394002505e-15 + 8.3250000000000000e+02 2.2500000000000000e+01 60 60 2.5132741228718384e-06 2.5132741228718354e-06 1.2212453270876722e-15 + 8.5500000000000000e+02 2.2500000000000000e+01 61 60 2.5132741228718388e-06 2.5132741228718384e-06 2.2204460492503131e-16 + 8.7750000000000000e+02 2.2500000000000000e+01 61 61 2.5132741228718405e-06 2.5132741228718388e-06 6.6613381477509392e-16 + 9.0000000000000000e+02 2.2500000000000000e+01 62 61 2.5132741228718367e-06 2.5132741228718405e-06 -1.5543122344752192e-15 + 9.2250000000000000e+02 2.2500000000000000e+01 63 62 2.5132741228718346e-06 2.5132741228718367e-06 -8.8817841970012523e-16 + 9.4500000000000000e+02 2.2500000000000000e+01 63 63 2.5132741228718367e-06 2.5132741228718346e-06 8.8817841970012523e-16 + 9.6750000000000000e+02 2.2500000000000000e+01 64 63 2.5132741228718333e-06 2.5132741228718367e-06 -1.3322676295501878e-15 + 9.9000000000000000e+02 2.2500000000000000e+01 64 64 2.5132741228718375e-06 2.5132741228718333e-06 1.6653345369377348e-15 + 1.0125000000000000e+03 2.2500000000000000e+01 65 64 2.5132741228718388e-06 2.5132741228718375e-06 5.5511151231257827e-16 + 1.0350000000000000e+03 2.2500000000000000e+01 65 65 2.5132741228718401e-06 2.5132741228718388e-06 5.5511151231257827e-16 + 1.0575000000000000e+03 2.2500000000000000e+01 66 65 2.5132741228718329e-06 2.5132741228718401e-06 -2.8865798640254070e-15 + 1.0800000000000000e+03 2.2500000000000000e+01 66 66 2.5132741228718439e-06 2.5132741228718329e-06 4.3298697960381105e-15 + 1.1025000000000000e+03 2.2500000000000000e+01 67 66 2.5132741228718426e-06 2.5132741228718439e-06 -4.4408920985006262e-16 + 1.1250000000000000e+03 2.2500000000000000e+01 67 67 2.5132741228718384e-06 2.5132741228718426e-06 -1.7763568394002505e-15 + 1.1475000000000000e+03 2.2500000000000000e+01 68 67 2.5132741228718303e-06 2.5132741228718384e-06 -3.1086244689504383e-15 + 1.1700000000000000e+03 2.2500000000000000e+01 68 68 2.5132741228718337e-06 2.5132741228718303e-06 1.3322676295501878e-15 + 1.1925000000000000e+03 2.2500000000000000e+01 69 68 2.5132741228718430e-06 2.5132741228718337e-06 3.6637359812630166e-15 + 1.2150000000000000e+03 2.2500000000000000e+01 69 69 2.5132741228718405e-06 2.5132741228718430e-06 -1.1102230246251565e-15 + 1.2375000000000000e+03 2.2500000000000000e+01 70 69 2.5132741228718367e-06 2.5132741228718405e-06 -1.5543122344752192e-15 + 1.2600000000000000e+03 2.2500000000000000e+01 70 70 2.5132741228718358e-06 2.5132741228718367e-06 -4.4408920985006262e-16 + 1.2825000000000000e+03 2.2500000000000000e+01 71 70 2.5132741228718418e-06 2.5132741228718358e-06 2.3314683517128287e-15 + 1.3050000000000000e+03 2.2500000000000000e+01 71 71 2.5132741228718477e-06 2.5132741228718418e-06 2.3314683517128287e-15 + 1.3275000000000000e+03 2.2500000000000000e+01 72 71 2.5132741228718350e-06 2.5132741228718477e-06 -5.1070259132757201e-15 + 1.3500000000000000e+03 2.2500000000000000e+01 72 72 2.5132741228718316e-06 2.5132741228718350e-06 -1.3322676295501878e-15 + 1.3725000000000000e+03 2.2500000000000000e+01 73 72 2.5132741228718409e-06 2.5132741228718316e-06 3.6637359812630166e-15 + 1.3950000000000000e+03 2.2500000000000000e+01 73 73 2.5132741228718358e-06 2.5132741228718409e-06 -1.9984014443252818e-15 + 1.4175000000000000e+03 2.2500000000000000e+01 74 73 2.5132741228718350e-06 2.5132741228718358e-06 -4.4408920985006262e-16 + 1.4400000000000000e+03 2.2500000000000000e+01 74 74 2.5132741228718401e-06 2.5132741228718350e-06 1.9984014443252818e-15 + 1.4625000000000000e+03 2.2500000000000000e+01 75 74 2.5132741228718316e-06 2.5132741228718401e-06 -3.3306690738754696e-15 + 1.4850000000000000e+03 2.2500000000000000e+01 75 75 2.5132741228718456e-06 2.5132741228718316e-06 5.5511151231257827e-15 + 1.5075000000000000e+03 2.2500000000000000e+01 76 75 2.5132741228718354e-06 2.5132741228718456e-06 -3.9968028886505635e-15 + 1.5300000000000000e+03 2.2500000000000000e+01 76 76 2.5132741228718405e-06 2.5132741228718354e-06 1.9984014443252818e-15 + 1.5525000000000000e+03 2.2500000000000000e+01 77 76 2.5132741228718397e-06 2.5132741228718405e-06 -4.4408920985006262e-16 + 1.5750000000000000e+03 2.2500000000000000e+01 77 77 2.5132741228718414e-06 2.5132741228718397e-06 6.6613381477509392e-16 + 1.5975000000000000e+03 2.2500000000000000e+01 78 77 2.5132741228718392e-06 2.5132741228718414e-06 -8.8817841970012523e-16 + 1.6200000000000000e+03 2.2500000000000000e+01 78 78 2.5132741228718439e-06 2.5132741228718392e-06 1.8873791418627661e-15 + 1.6425000000000000e+03 2.2500000000000000e+01 79 78 2.5132741228718418e-06 2.5132741228718439e-06 -8.8817841970012523e-16 + 1.6650000000000000e+03 2.2500000000000000e+01 80 79 2.5132741228718384e-06 2.5132741228718418e-06 -1.3322676295501878e-15 + 1.6875000000000000e+03 2.2500000000000000e+01 80 80 2.5132741228718371e-06 2.5132741228718384e-06 -4.4408920985006262e-16 + 1.7100000000000000e+03 2.2500000000000000e+01 81 80 2.5132741228718375e-06 2.5132741228718371e-06 2.2204460492503131e-16 + 1.7325000000000000e+03 2.2500000000000000e+01 82 81 2.5132741228718342e-06 2.5132741228718375e-06 -1.3322676295501878e-15 + 1.7550000000000000e+03 2.2500000000000000e+01 82 82 2.5132741228718358e-06 2.5132741228718342e-06 6.6613381477509392e-16 + 1.7775000000000000e+03 2.2500000000000000e+01 83 82 2.5132741228718354e-06 2.5132741228718358e-06 -2.2204460492503131e-16 + 1.8000000000000000e+03 2.2500000000000000e+01 84 83 2.5132741228718384e-06 2.5132741228718354e-06 1.2212453270876722e-15 + 1.8225000000000000e+03 2.2500000000000000e+01 84 84 2.5132741228718435e-06 2.5132741228718384e-06 1.9984014443252818e-15 + 1.8450000000000000e+03 2.2500000000000000e+01 85 84 2.5132741228718486e-06 2.5132741228718435e-06 1.9984014443252818e-15 + 1.8675000000000000e+03 2.2500000000000000e+01 86 85 2.5132741228718430e-06 2.5132741228718486e-06 -2.2204460492503131e-15 + 1.8900000000000000e+03 2.2500000000000000e+01 86 86 2.5132741228718426e-06 2.5132741228718430e-06 -2.2204460492503131e-16 + 1.9125000000000000e+03 2.2500000000000000e+01 87 86 2.5132741228718430e-06 2.5132741228718426e-06 2.2204460492503131e-16 + 1.9350000000000000e+03 2.2500000000000000e+01 88 87 2.5132741228718405e-06 2.5132741228718430e-06 -1.1102230246251565e-15 + 1.9575000000000000e+03 2.2500000000000000e+01 89 88 2.5132741228718574e-06 2.5132741228718405e-06 6.7723604502134549e-15 + 1.9800000000000000e+03 2.2500000000000000e+01 89 89 2.5132741228719405e-06 2.5132741228718574e-06 3.2973623831367149e-14 + 2.0025000000000000e+03 2.2500000000000000e+01 90 89 2.5132741228722437e-06 2.5132741228719405e-06 1.2068124277675452e-13 + 2.0250000000000000e+03 2.2500000000000000e+01 90 90 2.5132741228730831e-06 2.5132741228722437e-06 3.3395508580724709e-13 + 2.0475000000000000e+03 2.2500000000000000e+01 90 90 2.5132741228750389e-06 2.5132741228730831e-06 7.7815531795977222e-13 + 2.0700000000000000e+03 2.2500000000000000e+01 91 90 2.5132741228786938e-06 2.5132741228750389e-06 1.4542811399564926e-12 + 2.0925000000000000e+03 2.2500000000000000e+01 91 91 2.5132741228842970e-06 2.5132741228786938e-06 2.2294388557497768e-12 + 2.1150000000000000e+03 2.2500000000000000e+01 91 91 2.5132741228917958e-06 2.5132741228842970e-06 2.9837243786801082e-12 + 2.1375000000000000e+03 2.2500000000000000e+01 92 91 2.5132741229007311e-06 2.5132741228917958e-06 3.5552671917571388e-12 + 2.1600000000000000e+03 2.2500000000000000e+01 92 92 2.5132741229105588e-06 2.5132741229007311e-06 3.9103165150322639e-12 + 2.1825000000000000e+03 2.2500000000000000e+01 92 92 2.5132741229207257e-06 2.5132741229105588e-06 4.0453196348266829e-12 + 2.2050000000000000e+03 2.2500000000000000e+01 93 92 2.5132741229307720e-06 2.5132741229207257e-06 3.9972469778604136e-12 + 2.2275000000000000e+03 2.2500000000000000e+01 93 93 2.5132741229403773e-06 2.5132741229307720e-06 3.8218317399696389e-12 + 2.2500000000000000e+03 2.2500000000000000e+01 93 93 2.5132741229493406e-06 2.5132741229403773e-06 3.5663694220033904e-12 + 2.2725000000000000e+03 2.2500000000000000e+01 94 93 2.5132741229575742e-06 2.5132741229493406e-06 3.2760461010639119e-12 + 2.2950000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229650175e-06 2.5132741229575742e-06 2.9616309404900676e-12 + 2.3175000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229717112e-06 2.5132741229650175e-06 2.6633140137732880e-12 + 2.3400000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229776857e-06 2.5132741229717112e-06 2.3772095403273852e-12 + 2.3625000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229830068e-06 2.5132741229776857e-06 2.1171953079601735e-12 + 2.3850000000000000e+03 2.2500000000000000e+01 95 94 2.5132741229877540e-06 2.5132741229830068e-06 1.8888224317947788e-12 + 2.4075000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229920044e-06 2.5132741229877540e-06 1.6912027334115010e-12 + 2.4300000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229958173e-06 2.5132741229920044e-06 1.5171197631502764e-12 + 2.4525000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229992487e-06 2.5132741229958173e-06 1.3652412533815550e-12 + 2.4750000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230023522e-06 2.5132741229992487e-06 1.2349010702905616e-12 + 2.4975000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230051855e-06 2.5132741230023522e-06 1.1273204592043840e-12 + 2.5200000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230077969e-06 2.5132741230051855e-06 1.0390577287466840e-12 + 2.5425000000000000e+03 2.2500000000000000e+01 96 95 2.5132741230102114e-06 2.5132741230077969e-06 9.6067598320814795e-13 + 2.5650000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230124598e-06 2.5132741230102114e-06 8.9461771324295114e-13 + 2.5875000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230145901e-06 2.5132741230124598e-06 8.4765527930130702e-13 + 2.6100000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230166061e-06 2.5132741230145901e-06 8.0213613529167560e-13 + 2.6325000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230185301e-06 2.5132741230166061e-06 7.6549877547904543e-13 + 2.6550000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230203881e-06 2.5132741230185301e-06 7.3929751209789174e-13 + 2.6775000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230221808e-06 2.5132741230203881e-06 7.1331829332166308e-13 + 2.7000000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230239219e-06 2.5132741230221808e-06 6.9277916736609768e-13 + 2.7225000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230256176e-06 2.5132741230239219e-06 6.7468253206470763e-13 + 2.7450000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230272791e-06 2.5132741230256176e-06 6.6102678886181820e-13 + 2.7675000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230289215e-06 2.5132741230272791e-06 6.5347727229436714e-13 + 2.7900000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230305279e-06 2.5132741230289215e-06 6.3915539527670262e-13 + 2.8125000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230321013e-06 2.5132741230305279e-06 6.2605476358612577e-13 + 2.8350000000000000e+03 2.2500000000000000e+01 97 96 2.5132741230336687e-06 2.5132741230321013e-06 6.2361227293195043e-13 + 2.8575000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230352116e-06 2.5132741230336687e-06 6.1384231031524905e-13 + 2.8800000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230367248e-06 2.5132741230352116e-06 6.0207394625422239e-13 + 2.9025000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230382274e-06 2.5132741230367248e-06 5.9785509876064680e-13 + 2.9250000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230397068e-06 2.5132741230382274e-06 5.8864024765625800e-13 + 2.9475000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230411713e-06 2.5132741230397068e-06 5.8275606562574467e-13 + 2.9700000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230426193e-06 2.5132741230411713e-06 5.7609472747799373e-13 + 2.9925000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230440393e-06 2.5132741230426193e-06 5.6499249723174216e-13 + 3.0150000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230454361e-06 2.5132741230440393e-06 5.5577764612735336e-13 + 3.0375000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230468155e-06 2.5132741230454361e-06 5.4889426337467739e-13 + 3.0600000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230481707e-06 2.5132741230468155e-06 5.3923532306043853e-13 + 3.0825000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230495213e-06 2.5132741230481707e-06 5.3734794391857577e-13 + 3.1050000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230508266e-06 2.5132741230495213e-06 5.1936233091964823e-13 + 3.1275000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230521357e-06 2.5132741230508266e-06 5.2091664315412345e-13 + 3.1500000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230534092e-06 2.5132741230521357e-06 5.0670578843892145e-13 + 3.1725000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230546561e-06 2.5132741230534092e-06 4.9604764740251994e-13 + 3.1950000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230558936e-06 2.5132741230546561e-06 4.9238391142125693e-13 + 3.2175000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230571023e-06 2.5132741230558936e-06 4.8094861426761781e-13 + 3.2400000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230583046e-06 2.5132741230571023e-06 4.7839510131097995e-13 + 3.2625000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230594854e-06 2.5132741230583046e-06 4.6984638402136625e-13 + 3.2850000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230606552e-06 2.5132741230594854e-06 4.6540549192286562e-13 + 3.3075000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230617940e-06 2.5132741230606552e-06 4.5308201634952638e-13 + 3.3300000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230629269e-06 2.5132741230617940e-06 4.5075054799781356e-13 + 3.3525000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230640424e-06 2.5132741230629269e-06 4.4386716524513758e-13 + 3.3750000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230651491e-06 2.5132741230640424e-06 4.4031445156633708e-13 + 3.3975000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230662375e-06 2.5132741230651491e-06 4.3309800190627357e-13 + 3.4200000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230673239e-06 2.5132741230662375e-06 4.3220982348657344e-13 + 3.4425000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230683860e-06 2.5132741230673239e-06 4.2266190547479709e-13 + 3.4650000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230694452e-06 2.5132741230683860e-06 4.2144066014770942e-13 + 3.4875000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230704871e-06 2.5132741230694452e-06 4.1455727739503345e-13 + 3.5100000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230715404e-06 2.5132741230704871e-06 4.1910919179599659e-13 + 3.5325000000000000e+03 2.2500000000000000e+01 98 97 2.5132741230725543e-06 2.5132741230715404e-06 4.0345504714878189e-13 + 3.5550000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230735775e-06 2.5132741230725543e-06 4.0711878313004490e-13 + 3.5775000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230745910e-06 2.5132741230735775e-06 4.0323300254385686e-13 + 3.6000000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230756074e-06 2.5132741230745910e-06 4.0445424787094453e-13 + 3.6225000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230765976e-06 2.5132741230756074e-06 3.9401815143946806e-13 + 3.6450000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230776030e-06 2.5132741230765976e-06 4.0001335577244390e-13 + 3.6675000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230785830e-06 2.5132741230776030e-06 3.8991032624835498e-13 + 3.6900000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230795631e-06 2.5132741230785830e-06 3.8991032624835498e-13 + 3.7125000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230805426e-06 2.5132741230795631e-06 3.8979930394589246e-13 + 3.7350000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230815070e-06 2.5132741230805426e-06 3.8369307731045410e-13 diff --git a/tst/scripts/coagulation/coagulation.py b/tst/scripts/coagulation/coagulation.py index 5c9437c5..feaddcfa 100644 --- a/tst/scripts/coagulation/coagulation.py +++ b/tst/scripts/coagulation/coagulation.py @@ -63,7 +63,7 @@ def analyze(): unpack=True, ) - data_ref = np.hstack([dat_sden[2:5, :], dat_den[2:5, :]]) + data_ref = np.hstack([dat_sden[2:4, :], dat_den[2:4, :]]) fname = os.path.join(artemis.get_data_dir(), _file_id + "_info.dat") data_tst = np.loadtxt( @@ -71,7 +71,7 @@ def analyze(): unpack=True, ) - errs = data_ref - data_tst[2:5, :] + errs = data_ref - data_tst[2:4, :] errors = np.array(errs).ravel() fail = np.any(errors > 0) return not fail From 7775e7a30b79e642c1764dc7e7ae499d5cd9390e Mon Sep 17 00:00:00 2001 From: Patrick Mullen Date: Fri, 12 Sep 2025 12:52:36 -0400 Subject: [PATCH 35/38] Thread gas_params through coagulation --- src/artemis.cpp | 4 +++- src/dust/coagulation/coagulation.cpp | 7 ++++++- src/dust/coagulation/coagulation.hpp | 21 ++++++++++++--------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/artemis.cpp b/src/artemis.cpp index 98b922e1..525f41db 100644 --- a/src/artemis.cpp +++ b/src/artemis.cpp @@ -157,8 +157,10 @@ Packages_t ProcessPackages(std::unique_ptr &pin) { // Operator split dust coagulation if (do_coagulation) { + auto &gas_params = packages.Get("gas")->AllParams(); auto &dust_params = packages.Get("dust")->AllParams(); - packages.Add(Dust::Coagulation::Initialize(pin.get(), dust_params, units, constants)); + packages.Add(Dust::Coagulation::Initialize(pin.get(), gas_params, dust_params, units, + constants)); } // Operator split radiation diff --git a/src/dust/coagulation/coagulation.cpp b/src/dust/coagulation/coagulation.cpp index c1b17a37..f2eff731 100644 --- a/src/dust/coagulation/coagulation.cpp +++ b/src/dust/coagulation/coagulation.cpp @@ -34,7 +34,8 @@ namespace Coagulation { //---------------------------------------------------------------------------------------- //! \fn StateDescriptor Coagulalation::Initialize //! \brief Adds intialization function for coagulation package -std::shared_ptr Initialize(ParameterInput *pin, Params &dust_params, +std::shared_ptr Initialize(ParameterInput *pin, Params &gas_params, + Params &dust_params, ArtemisUtils::Units &units, ArtemisUtils::Constants &constants) { auto coag = std::make_shared("coagulation"); @@ -67,6 +68,10 @@ std::shared_ptr Initialize(ParameterInput *pin, Params &dust_pa dcpars.cfl = pin->GetOrAddReal("dust/coagulation", "cfl_coag", 0.1); dcpars.chi = pin->GetOrAddReal("dust/coagulation", "chi", 1.0); + // Gas properties + dcpars.mmw = gas_params.Get("mu") * constants.GetAMUPhysical(); + dcpars.cross_section = pin->GetOrAddReal("dust/coagulation", "cross_section", 2.0e-15); + // Coordinate type // NOTE(@pdmullen): Following @sli's earlier implementation, rho_p and dfloor use solely // the density unit in construction, not the one weighted by length unit diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index eb08da56..9bf4ffe0 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -25,7 +25,8 @@ namespace Dust { namespace Coagulation { -std::shared_ptr Initialize(ParameterInput *pin, Params &dustPars, +std::shared_ptr Initialize(ParameterInput *pin, Params &gas_params, + Params &dust_params, ArtemisUtils::Units &units, ArtemisUtils::Constants &constants); @@ -63,6 +64,9 @@ struct CoagParams { Real errcon; // Needed for increasing step size bool const_omega; // for shearing-box or testing + Real mmw; // mean molecular weight (mu * amu in CGS) + Real cross_section; // cross section of gas species + Real rho0; // physical-to-code unit conversion density Real length0; // physical-to-code unit conversion length @@ -432,7 +436,7 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], const Real &mass_gride = coag.mass_grid(coag.nm - 1); if (mass_gridi + mass_gridj >= mass_gride) return 0.0; - const Real &gasdens = kernel4[0]; + const Real &gdens = kernel4[0]; const Real &alpha = kernel4[1]; const Real &cs = kernel4[2]; const Real &omega = kernel4[3]; @@ -441,13 +445,12 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], const Real *vel_i = &vel(3 * i); const Real *vel_j = &vel(3 * j); - const Real sig_h2 = 2.0e-15; //! cross section of H2 - const Real mu = 2.3; //! mean molecular mass in proton masses - const Real m_p = 1.6726231e-24; //! proton mass in g + const Real &sig = coag.cross_section; //! cross section of gas species + const Real &mmw = coag.mmw; //! mean molecular weight (mu * mp) // Calculate some basic properties const Real hg = cs / omega; - Real re = alpha * sig_h2 * gasdens / (2.0 * mu * m_p); + Real re = alpha * sig * gdens / (2.0 * mmw); if (!(coag.coord)) re *= std::sqrt(2.0 * M_PI) * hg; const Real tn = 1.0 / omega; @@ -456,7 +459,7 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], const Real vs = vn * std::pow(re, -0.25); // Calculate the relative velocities - const Real c1 = 8.0 / M_PI * cs * cs * mu * m_p; + const Real c1 = 8.0 / M_PI * cs * cs * mmw; // Calculate Stokes number const Real stokes_i = tau_i * omega; @@ -834,7 +837,7 @@ void Coagulation_nQs3(parthenon::team_mbr_t const &mbr, const Real &dt, // \brief KOKKOS_FORCEINLINE_FUNCTION void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, - const Real &time, Real &dt_sync, const Real &gasdens, + const Real &time, Real &dt_sync, const Real &gdens, ScratchPad1D &dustdens, ScratchPad1D &stime, ScratchPad1D &vel, const int nvel, ScratchPad1D &Q, ScratchPad1D &nQs, const Real &alpha, const Real &cs, @@ -860,7 +863,7 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, dt_sync = 1e-15; // works H5 Real kernel[4]; - kernel[0] = gasdens; + kernel[0] = gdens; kernel[1] = alpha; kernel[2] = cs; kernel[3] = omega; From 4ee353a9c2edc40f5d9b194a0bbdc29f650c0d8d Mon Sep 17 00:00:00 2001 From: Patrick Mullen Date: Fri, 12 Sep 2025 14:26:59 -0400 Subject: [PATCH 36/38] Introduce a KernelParams struct for coagulation --- src/dust/coagulation/coagulation.hpp | 38 ++- tst/scripts/coagulation/coag_info_den.dat | 334 ++++++++++----------- tst/scripts/coagulation/coag_info_sden.dat | 334 ++++++++++----------- 3 files changed, 356 insertions(+), 350 deletions(-) diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index 9bf4ffe0..a49547ee 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -12,7 +12,7 @@ //======================================================================================== // NOTE(@sli): // The dust coagulation code is modified from public available Dustpy package -// httgit@github.com:parthenon-hpc-lab/parthenon.gitps://github.com/stammler/dustpy +// https://github.com/stammler/dustpy // and from their paper (Stammler and Birnstiel (2022) ApJ 935:35) // "DustPy: A Python Package for Dust Evolution in Protoplanetary Disks" //======================================================================================== @@ -40,6 +40,15 @@ TaskStatus CoagulationStep(MeshData *md, const Real time, const Real dt); // Constants that enumerate coagulation kernel enum coag2drv { dpod, afrag, phifrag, epsfrag, dalp, kdelta, coef_fett, last2 }; +// Coagulation Kernel Parameters +// NOTE(@pdmullen): Shared between various inline function calls +struct KernelParams { + Real gdens = Null(); + Real alpha = Null(); + Real cs = Null(); + Real omega = Null(); +}; + // Struct that holds coagulation parameters struct CoagParams { bool coord = false; // true--surface density, false: 3D @@ -427,7 +436,7 @@ Real Qplus(Real m1, Real Q1, Real m2, Real Q2) { return (m1 * Q1 + m2 * Q2) / (m //! \fn Real Dust::Coagulation::CoagulationRate // \brief KOKKOS_FORCEINLINE_FUNCTION -Real CoagulationRate(const int i, const int j, const Real kernel4[], +Real CoagulationRate(const int i, const int j, const KernelParams &kernel4, const ScratchPad1D &vel, const ScratchPad1D &stoppingTime, const CoagParams &coag, const int itype) { @@ -436,10 +445,10 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], const Real &mass_gride = coag.mass_grid(coag.nm - 1); if (mass_gridi + mass_gridj >= mass_gride) return 0.0; - const Real &gdens = kernel4[0]; - const Real &alpha = kernel4[1]; - const Real &cs = kernel4[2]; - const Real &omega = kernel4[3]; + const Real &gdens = kernel4.gdens; + const Real &alpha = kernel4.alpha; + const Real &cs = kernel4.cs; + const Real &omega = kernel4.omega; const Real &tau_i = stoppingTime(i); const Real &tau_j = stoppingTime(j); const Real *vel_i = &vel(3 * i); @@ -529,7 +538,7 @@ Real CoagulationRate(const int i, const int j, const Real kernel4[], KOKKOS_FORCEINLINE_FUNCTION void CoagulationSource(parthenon::team_mbr_t const &mbr, ScratchPad1D &source, const ScratchPad1D &distri, const int mimax, - const Real kernel4[], const ScratchPad1D &vel, + const KernelParams &kernel4, const ScratchPad1D &vel, const ScratchPad1D &stoppingTime, const CoagParams &coag) { // Initialize source(*) parthenon::par_for_inner(DEFAULT_INNER_LOOP_PATTERN, mbr, 0, coag.nm - 1, @@ -622,8 +631,9 @@ void CoagulationSource(parthenon::team_mbr_t const &mbr, ScratchPad1D &sou KOKKOS_FORCEINLINE_FUNCTION void Coagulation_nQ(parthenon::team_mbr_t const &mbr, ScratchPad1D &nQs, const ScratchPad1D &Q, const ScratchPad1D &distri, - const int mimax, const Real kernel4[], const ScratchPad1D &vel, - const ScratchPad1D &stoppingTime, const CoagParams &coag) { + const int mimax, const KernelParams &kernel4, + const ScratchPad1D &vel, const ScratchPad1D &stoppingTime, + const CoagParams &coag) { // Adding coagulation source terms const int iafrag = coag2drv::afrag; const int iphifrag = coag2drv::phifrag; @@ -741,7 +751,7 @@ KOKKOS_FORCEINLINE_FUNCTION void Coagulation_nQs(parthenon::team_mbr_t const &mbr, const Real &dt, ScratchPad1D &Q, ScratchPad1D &nQs, ScratchPad1D &distri, const int mimax, const int nvel, - const Real kernel4[], ScratchPad1D &vel, + const KernelParams &kernel4, ScratchPad1D &vel, const ScratchPad1D &stoppingTime, const CoagParams &coag, ScratchPad1D &source) { const Real mom_scale = 1.0e10; @@ -780,7 +790,7 @@ KOKKOS_FORCEINLINE_FUNCTION void Coagulation_nQs3(parthenon::team_mbr_t const &mbr, const Real &dt, ScratchPad1D &Q, ScratchPad1D &nQs, ScratchPad1D &distri, const int mimax, const int nvel, - const Real kernel4[], ScratchPad1D &vel, + const KernelParams &kernel4, ScratchPad1D &vel, const ScratchPad1D &stoppingTime, const CoagParams &coag, ScratchPad1D &source, ScratchPad1D &Q2, const int mimax2) { @@ -862,11 +872,7 @@ void CoagulationOneCell(parthenon::team_mbr_t const &mbr, const int cell_i, Real hnext = dt; dt_sync = 1e-15; // works H5 - Real kernel[4]; - kernel[0] = gdens; - kernel[1] = alpha; - kernel[2] = cs; - kernel[3] = omega; + const KernelParams kernel{gdens, alpha, cs, omega}; while (std::abs(time_dummy - time_goal) > 1e-6 * dt) { int mimax = 0; Kokkos::parallel_reduce( diff --git a/tst/scripts/coagulation/coag_info_den.dat b/tst/scripts/coagulation/coag_info_den.dat index df0b824c..6718fbb6 100644 --- a/tst/scripts/coagulation/coag_info_den.dat +++ b/tst/scripts/coagulation/coag_info_den.dat @@ -1,168 +1,168 @@ # time dt max_size1 max_size0 mass_d1 mass_d0 delta - 0.0000000000000000e+00 2.2500000000000000e+01 20 10 2.0053037235275938e-05 2.0053037235275924e-05 6.6613381477509392e-16 - 2.2500000000000000e+01 2.2500000000000000e+01 24 20 2.0053037235275972e-05 2.0053037235275938e-05 1.6653345369377348e-15 - 4.5000000000000000e+01 2.2500000000000000e+01 27 24 2.0053037235275951e-05 2.0053037235275972e-05 -1.1102230246251565e-15 - 6.7500000000000000e+01 2.2500000000000000e+01 29 27 2.0053037235275907e-05 2.0053037235275951e-05 -2.2204460492503131e-15 - 9.0000000000000000e+01 2.2500000000000000e+01 30 29 2.0053037235275941e-05 2.0053037235275907e-05 1.6653345369377348e-15 - 1.1250000000000000e+02 2.2500000000000000e+01 32 30 2.0053037235275924e-05 2.0053037235275941e-05 -8.8817841970012523e-16 - 1.3500000000000000e+02 2.2500000000000000e+01 33 32 2.0053037235275948e-05 2.0053037235275924e-05 1.2212453270876722e-15 - 1.5750000000000000e+02 2.2500000000000000e+01 35 33 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 - 1.8000000000000000e+02 2.2500000000000000e+01 36 35 2.0053037235275948e-05 2.0053037235275941e-05 3.3306690738754696e-16 - 2.0250000000000000e+02 2.2500000000000000e+01 37 36 2.0053037235275944e-05 2.0053037235275948e-05 -2.2204460492503131e-16 - 2.2500000000000000e+02 2.2500000000000000e+01 38 37 2.0053037235275958e-05 2.0053037235275944e-05 6.6613381477509392e-16 - 2.4750000000000000e+02 2.2500000000000000e+01 39 38 2.0053037235275958e-05 2.0053037235275958e-05 0.0000000000000000e+00 - 2.7000000000000000e+02 2.2500000000000000e+01 40 39 2.0053037235275924e-05 2.0053037235275958e-05 -1.7763568394002505e-15 - 2.9250000000000000e+02 2.2500000000000000e+01 41 40 2.0053037235275883e-05 2.0053037235275924e-05 -1.9984014443252818e-15 - 3.1500000000000000e+02 2.2500000000000000e+01 42 41 2.0053037235275907e-05 2.0053037235275883e-05 1.2212453270876722e-15 - 3.3750000000000000e+02 2.2500000000000000e+01 43 42 2.0053037235275955e-05 2.0053037235275907e-05 2.3314683517128287e-15 - 3.6000000000000000e+02 2.2500000000000000e+01 44 43 2.0053037235275907e-05 2.0053037235275955e-05 -2.4424906541753444e-15 - 3.8250000000000000e+02 2.2500000000000000e+01 45 44 2.0053037235275894e-05 2.0053037235275907e-05 -6.6613381477509392e-16 - 4.0500000000000000e+02 2.2500000000000000e+01 46 45 2.0053037235275894e-05 2.0053037235275894e-05 0.0000000000000000e+00 - 4.2750000000000000e+02 2.2500000000000000e+01 47 46 2.0053037235275944e-05 2.0053037235275894e-05 2.5535129566378600e-15 - 4.5000000000000000e+02 2.2500000000000000e+01 48 47 2.0053037235275985e-05 2.0053037235275944e-05 1.9984014443252818e-15 - 4.7250000000000000e+02 2.2500000000000000e+01 49 48 2.0053037235275955e-05 2.0053037235275985e-05 -1.5543122344752192e-15 - 4.9500000000000000e+02 2.2500000000000000e+01 50 49 2.0053037235275887e-05 2.0053037235275955e-05 -3.3306690738754696e-15 - 5.1750000000000000e+02 2.2500000000000000e+01 51 50 2.0053037235275955e-05 2.0053037235275887e-05 3.3306690738754696e-15 - 5.4000000000000000e+02 2.2500000000000000e+01 52 51 2.0053037235275968e-05 2.0053037235275955e-05 6.6613381477509392e-16 - 5.6250000000000000e+02 2.2500000000000000e+01 53 52 2.0053037235275961e-05 2.0053037235275968e-05 -4.4408920985006262e-16 - 5.8500000000000000e+02 2.2500000000000000e+01 53 53 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 - 6.0750000000000000e+02 2.2500000000000000e+01 54 53 2.0053037235275928e-05 2.0053037235275961e-05 -1.7763568394002505e-15 - 6.3000000000000000e+02 2.2500000000000000e+01 55 54 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 - 6.5250000000000000e+02 2.2500000000000000e+01 56 55 2.0053037235275904e-05 2.0053037235275975e-05 -3.5527136788005009e-15 - 6.7500000000000000e+02 2.2500000000000000e+01 56 56 2.0053037235275941e-05 2.0053037235275904e-05 1.8873791418627661e-15 - 6.9750000000000000e+02 2.2500000000000000e+01 57 56 2.0053037235275934e-05 2.0053037235275941e-05 -4.4408920985006262e-16 - 7.2000000000000000e+02 2.2500000000000000e+01 58 57 2.0053037235275890e-05 2.0053037235275934e-05 -2.2204460492503131e-15 - 7.4250000000000000e+02 2.2500000000000000e+01 58 58 2.0053037235275961e-05 2.0053037235275890e-05 3.5527136788005009e-15 - 7.6500000000000000e+02 2.2500000000000000e+01 59 58 2.0053037235275934e-05 2.0053037235275961e-05 -1.3322676295501878e-15 - 7.8750000000000000e+02 2.2500000000000000e+01 60 59 2.0053037235275883e-05 2.0053037235275934e-05 -2.4424906541753444e-15 - 8.1000000000000000e+02 2.2500000000000000e+01 60 60 2.0053037235275989e-05 2.0053037235275883e-05 5.2180482157382357e-15 - 8.3250000000000000e+02 2.2500000000000000e+01 61 60 2.0053037235275999e-05 2.0053037235275989e-05 5.5511151231257827e-16 - 8.5500000000000000e+02 2.2500000000000000e+01 62 61 2.0053037235275965e-05 2.0053037235275999e-05 -1.7763568394002505e-15 - 8.7750000000000000e+02 2.2500000000000000e+01 62 62 2.0053037235275955e-05 2.0053037235275965e-05 -4.4408920985006262e-16 - 9.0000000000000000e+02 2.2500000000000000e+01 63 62 2.0053037235275904e-05 2.0053037235275955e-05 -2.4424906541753444e-15 - 9.2250000000000000e+02 2.2500000000000000e+01 63 63 2.0053037235275955e-05 2.0053037235275904e-05 2.5535129566378600e-15 - 9.4500000000000000e+02 2.2500000000000000e+01 64 63 2.0053037235275924e-05 2.0053037235275955e-05 -1.5543122344752192e-15 - 9.6750000000000000e+02 2.2500000000000000e+01 64 64 2.0053037235275914e-05 2.0053037235275924e-05 -4.4408920985006262e-16 - 9.9000000000000000e+02 2.2500000000000000e+01 65 64 2.0053037235275907e-05 2.0053037235275914e-05 -4.4408920985006262e-16 - 1.0125000000000000e+03 2.2500000000000000e+01 65 65 2.0053037235275965e-05 2.0053037235275907e-05 2.8865798640254070e-15 - 1.0350000000000000e+03 2.2500000000000000e+01 66 65 2.0053037235275928e-05 2.0053037235275965e-05 -1.7763568394002505e-15 - 1.0575000000000000e+03 2.2500000000000000e+01 66 66 2.0053037235275961e-05 2.0053037235275928e-05 1.6653345369377348e-15 - 1.0800000000000000e+03 2.2500000000000000e+01 67 66 2.0053037235275975e-05 2.0053037235275961e-05 6.6613381477509392e-16 - 1.1025000000000000e+03 2.2500000000000000e+01 67 67 2.0053037235275999e-05 2.0053037235275975e-05 1.2212453270876722e-15 - 1.1250000000000000e+03 2.2500000000000000e+01 68 67 2.0053037235275938e-05 2.0053037235275999e-05 -3.1086244689504383e-15 - 1.1475000000000000e+03 2.2500000000000000e+01 68 68 2.0053037235275948e-05 2.0053037235275938e-05 5.5511151231257827e-16 - 1.1700000000000000e+03 2.2500000000000000e+01 69 68 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 - 1.1925000000000000e+03 2.2500000000000000e+01 69 69 2.0053037235275948e-05 2.0053037235275961e-05 -6.6613381477509392e-16 - 1.2150000000000000e+03 2.2500000000000000e+01 70 69 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 - 1.2375000000000000e+03 2.2500000000000000e+01 70 70 2.0053037235275944e-05 2.0053037235275941e-05 2.2204460492503131e-16 - 1.2600000000000000e+03 2.2500000000000000e+01 70 70 2.0053037235275948e-05 2.0053037235275944e-05 2.2204460492503131e-16 - 1.2825000000000000e+03 2.2500000000000000e+01 71 70 2.0053037235275941e-05 2.0053037235275948e-05 -4.4408920985006262e-16 - 1.3050000000000000e+03 2.2500000000000000e+01 71 71 2.0053037235276009e-05 2.0053037235275941e-05 3.3306690738754696e-15 - 1.3275000000000000e+03 2.2500000000000000e+01 72 71 2.0053037235275877e-05 2.0053037235276009e-05 -6.6613381477509392e-15 - 1.3500000000000000e+03 2.2500000000000000e+01 72 72 2.0053037235275978e-05 2.0053037235275877e-05 5.1070259132757201e-15 - 1.3725000000000000e+03 2.2500000000000000e+01 72 72 2.0053037235276022e-05 2.0053037235275978e-05 2.2204460492503131e-15 - 1.3950000000000000e+03 2.2500000000000000e+01 73 72 2.0053037235276002e-05 2.0053037235276022e-05 -1.1102230246251565e-15 - 1.4175000000000000e+03 2.2500000000000000e+01 73 73 2.0053037235275989e-05 2.0053037235276002e-05 -6.6613381477509392e-16 - 1.4400000000000000e+03 2.2500000000000000e+01 74 73 2.0053037235275928e-05 2.0053037235275989e-05 -3.1086244689504383e-15 - 1.4625000000000000e+03 2.2500000000000000e+01 74 74 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 - 1.4850000000000000e+03 2.2500000000000000e+01 74 74 2.0053037235275968e-05 2.0053037235275975e-05 -4.4408920985006262e-16 - 1.5075000000000000e+03 2.2500000000000000e+01 75 74 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 - 1.5300000000000000e+03 2.2500000000000000e+01 75 75 2.0053037235275944e-05 2.0053037235275944e-05 0.0000000000000000e+00 - 1.5525000000000000e+03 2.2500000000000000e+01 76 75 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 - 1.5750000000000000e+03 2.2500000000000000e+01 76 76 2.0053037235275944e-05 2.0053037235275921e-05 1.2212453270876722e-15 - 1.5975000000000000e+03 2.2500000000000000e+01 76 76 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 - 1.6200000000000000e+03 2.2500000000000000e+01 77 76 2.0053037235275924e-05 2.0053037235275921e-05 2.2204460492503131e-16 - 1.6425000000000000e+03 2.2500000000000000e+01 77 77 2.0053037235275955e-05 2.0053037235275924e-05 1.5543122344752192e-15 - 1.6650000000000000e+03 2.2500000000000000e+01 77 77 2.0053037235275968e-05 2.0053037235275955e-05 6.6613381477509392e-16 - 1.6875000000000000e+03 2.2500000000000000e+01 78 77 2.0053037235275978e-05 2.0053037235275968e-05 5.5511151231257827e-16 - 1.7100000000000000e+03 2.2500000000000000e+01 78 78 2.0053037235276009e-05 2.0053037235275978e-05 1.5543122344752192e-15 - 1.7325000000000000e+03 2.2500000000000000e+01 78 78 2.0053037235275934e-05 2.0053037235276009e-05 -3.7747582837255322e-15 - 1.7550000000000000e+03 2.2500000000000000e+01 79 78 2.0053037235275982e-05 2.0053037235275934e-05 2.3314683517128287e-15 - 1.7775000000000000e+03 2.2500000000000000e+01 79 79 2.0053037235275965e-05 2.0053037235275982e-05 -8.8817841970012523e-16 - 1.8000000000000000e+03 2.2500000000000000e+01 79 79 2.0053037235275958e-05 2.0053037235275965e-05 -4.4408920985006262e-16 - 1.8225000000000000e+03 2.2500000000000000e+01 80 79 2.0053037235276009e-05 2.0053037235275958e-05 2.5535129566378600e-15 - 1.8450000000000000e+03 2.2500000000000000e+01 80 80 2.0053037235275985e-05 2.0053037235276009e-05 -1.1102230246251565e-15 - 1.8675000000000000e+03 2.2500000000000000e+01 80 80 2.0053037235276029e-05 2.0053037235275985e-05 2.2204460492503131e-15 - 1.8900000000000000e+03 2.2500000000000000e+01 81 80 2.0053037235275948e-05 2.0053037235276029e-05 -3.9968028886505635e-15 - 1.9125000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 - 1.9350000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275941e-05 2.0053037235275961e-05 -1.1102230246251565e-15 - 1.9575000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275972e-05 2.0053037235275941e-05 1.5543122344752192e-15 - 1.9800000000000000e+03 2.2500000000000000e+01 82 81 2.0053037235276049e-05 2.0053037235275972e-05 3.8857805861880479e-15 - 2.0025000000000000e+03 2.2500000000000000e+01 82 82 2.0053037235275955e-05 2.0053037235276049e-05 -4.6629367034256575e-15 - 2.0250000000000000e+03 2.2500000000000000e+01 82 82 2.0053037235275941e-05 2.0053037235275955e-05 -6.6613381477509392e-16 - 2.0475000000000000e+03 2.2500000000000000e+01 82 82 2.0053037235275924e-05 2.0053037235275941e-05 -8.8817841970012523e-16 - 2.0700000000000000e+03 2.2500000000000000e+01 83 82 2.0053037235275944e-05 2.0053037235275924e-05 9.9920072216264089e-16 - 2.0925000000000000e+03 2.2500000000000000e+01 83 83 2.0053037235275951e-05 2.0053037235275944e-05 3.3306690738754696e-16 - 2.1150000000000000e+03 2.2500000000000000e+01 83 83 2.0053037235275972e-05 2.0053037235275951e-05 9.9920072216264089e-16 - 2.1375000000000000e+03 2.2500000000000000e+01 84 83 2.0053037235276002e-05 2.0053037235275972e-05 1.5543122344752192e-15 - 2.1600000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235275995e-05 2.0053037235276002e-05 -4.4408920985006262e-16 - 2.1825000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235275914e-05 2.0053037235275995e-05 -3.9968028886505635e-15 - 2.2050000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235275978e-05 2.0053037235275914e-05 3.2196467714129540e-15 - 2.2275000000000000e+03 2.2500000000000000e+01 85 84 2.0053037235275968e-05 2.0053037235275978e-05 -4.4408920985006262e-16 - 2.2500000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235275955e-05 2.0053037235275968e-05 -6.6613381477509392e-16 - 2.2725000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235275951e-05 2.0053037235275955e-05 -2.2204460492503131e-16 - 2.2950000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235275968e-05 2.0053037235275951e-05 8.8817841970012523e-16 - 2.3175000000000000e+03 2.2500000000000000e+01 86 85 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 - 2.3400000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235275951e-05 2.0053037235275944e-05 3.3306690738754696e-16 - 2.3625000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235275958e-05 2.0053037235275951e-05 3.3306690738754696e-16 - 2.3850000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235276002e-05 2.0053037235275958e-05 2.2204460492503131e-15 - 2.4075000000000000e+03 2.2500000000000000e+01 87 86 2.0053037235275961e-05 2.0053037235276002e-05 -1.9984014443252818e-15 - 2.4300000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235276012e-05 2.0053037235275961e-05 2.5535129566378600e-15 - 2.4525000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235275978e-05 2.0053037235276012e-05 -1.7763568394002505e-15 - 2.4750000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235276012e-05 2.0053037235275978e-05 1.6653345369377348e-15 - 2.4975000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235275995e-05 2.0053037235276012e-05 -8.8817841970012523e-16 - 2.5200000000000000e+03 2.2500000000000000e+01 88 87 2.0053037235276029e-05 2.0053037235275995e-05 1.6653345369377348e-15 - 2.5425000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275955e-05 2.0053037235276029e-05 -3.7747582837255322e-15 - 2.5650000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275972e-05 2.0053037235275955e-05 8.8817841970012523e-16 - 2.5875000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275961e-05 2.0053037235275972e-05 -4.4408920985006262e-16 - 2.6100000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275944e-05 2.0053037235275961e-05 -8.8817841970012523e-16 - 2.6325000000000000e+03 2.2500000000000000e+01 89 88 2.0053037235275941e-05 2.0053037235275944e-05 -2.2204460492503131e-16 - 2.6550000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235276002e-05 2.0053037235275941e-05 2.9976021664879227e-15 - 2.6775000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275928e-05 2.0053037235276002e-05 -3.7747582837255322e-15 - 2.7000000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275961e-05 2.0053037235275928e-05 1.6653345369377348e-15 - 2.7225000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275999e-05 2.0053037235275961e-05 1.8873791418627661e-15 - 2.7450000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275982e-05 2.0053037235275999e-05 -8.8817841970012523e-16 - 2.7675000000000000e+03 2.2500000000000000e+01 90 89 2.0053037235275944e-05 2.0053037235275982e-05 -1.7763568394002505e-15 - 2.7900000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235276002e-05 2.0053037235275944e-05 2.8865798640254070e-15 - 2.8125000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275938e-05 2.0053037235276002e-05 -3.1086244689504383e-15 - 2.8350000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275995e-05 2.0053037235275938e-05 2.8865798640254070e-15 - 2.8575000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275897e-05 2.0053037235275995e-05 -4.8849813083506888e-15 - 2.8800000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275961e-05 2.0053037235275897e-05 3.2196467714129540e-15 - 2.9025000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275900e-05 2.0053037235275961e-05 -3.1086244689504383e-15 - 2.9250000000000000e+03 2.2500000000000000e+01 91 90 2.0053037235275934e-05 2.0053037235275900e-05 1.6653345369377348e-15 - 2.9475000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275999e-05 2.0053037235275934e-05 3.2196467714129540e-15 - 2.9700000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275928e-05 2.0053037235275999e-05 -3.5527136788005009e-15 - 2.9925000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 - 3.0150000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235276016e-05 2.0053037235275972e-05 2.2204460492503131e-15 - 3.0375000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235276002e-05 2.0053037235276016e-05 -6.6613381477509392e-16 - 3.0600000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275975e-05 2.0053037235276002e-05 -1.3322676295501878e-15 - 3.0825000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275992e-05 2.0053037235275975e-05 8.8817841970012523e-16 - 3.1050000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275985e-05 2.0053037235275992e-05 -4.4408920985006262e-16 - 3.1275000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235276016e-05 2.0053037235275985e-05 1.5543122344752192e-15 - 3.1500000000000000e+03 2.2500000000000000e+01 92 91 2.0053037235276029e-05 2.0053037235276016e-05 6.6613381477509392e-16 - 3.1725000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275968e-05 2.0053037235276029e-05 -3.1086244689504383e-15 - 3.1950000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275955e-05 2.0053037235275968e-05 -6.6613381477509392e-16 - 3.2175000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235276080e-05 2.0053037235275955e-05 6.2172489379008766e-15 - 3.2400000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275999e-05 2.0053037235276080e-05 -3.9968028886505635e-15 - 3.2625000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275938e-05 2.0053037235275999e-05 -3.1086244689504383e-15 - 3.2850000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275975e-05 2.0053037235275938e-05 1.8873791418627661e-15 - 3.3075000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275951e-05 2.0053037235275975e-05 -1.1102230246251565e-15 - 3.3300000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275897e-05 2.0053037235275951e-05 -2.6645352591003757e-15 - 3.3525000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275961e-05 2.0053037235275897e-05 3.2196467714129540e-15 - 3.3750000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 - 3.3975000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275982e-05 2.0053037235275961e-05 9.9920072216264089e-16 - 3.4200000000000000e+03 2.2500000000000000e+01 93 92 2.0053037235275992e-05 2.0053037235275982e-05 5.5511151231257827e-16 - 3.4425000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275968e-05 2.0053037235275992e-05 -1.1102230246251565e-15 - 3.4650000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275928e-05 2.0053037235275968e-05 -1.9984014443252818e-15 - 3.4875000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 - 3.5100000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275982e-05 2.0053037235275972e-05 5.5511151231257827e-16 - 3.5325000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275921e-05 2.0053037235275982e-05 -3.1086244689504383e-15 - 3.5550000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275995e-05 2.0053037235275921e-05 3.6637359812630166e-15 - 3.5775000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275972e-05 2.0053037235275995e-05 -1.1102230246251565e-15 - 3.6000000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275941e-05 2.0053037235275972e-05 -1.5543122344752192e-15 - 3.6225000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275934e-05 2.0053037235275941e-05 -4.4408920985006262e-16 - 3.6450000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235276002e-05 2.0053037235275934e-05 3.3306690738754696e-15 - 3.6675000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275958e-05 2.0053037235276002e-05 -2.2204460492503131e-15 - 3.6900000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275921e-05 2.0053037235275958e-05 -1.7763568394002505e-15 - 3.7125000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235276002e-05 2.0053037235275921e-05 4.1078251911130792e-15 - 3.7350000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275941e-05 2.0053037235276002e-05 -3.1086244689504383e-15 + 0.0000000000000000e+00 2.2500000000000000e+01 20 10 2.0053037235275928e-05 2.0053037235275924e-05 2.2204460492503131e-16 + 2.2500000000000000e+01 2.2500000000000000e+01 24 20 2.0053037235275975e-05 2.0053037235275928e-05 2.3314683517128287e-15 + 4.5000000000000000e+01 2.2500000000000000e+01 27 24 2.0053037235275965e-05 2.0053037235275975e-05 -4.4408920985006262e-16 + 6.7500000000000000e+01 2.2500000000000000e+01 29 27 2.0053037235275948e-05 2.0053037235275965e-05 -8.8817841970012523e-16 + 9.0000000000000000e+01 2.2500000000000000e+01 30 29 2.0053037235275958e-05 2.0053037235275948e-05 5.5511151231257827e-16 + 1.1250000000000000e+02 2.2500000000000000e+01 32 30 2.0053037235275931e-05 2.0053037235275958e-05 -1.3322676295501878e-15 + 1.3500000000000000e+02 2.2500000000000000e+01 33 32 2.0053037235275944e-05 2.0053037235275931e-05 6.6613381477509392e-16 + 1.5750000000000000e+02 2.2500000000000000e+01 35 33 2.0053037235275958e-05 2.0053037235275944e-05 6.6613381477509392e-16 + 1.8000000000000000e+02 2.2500000000000000e+01 36 35 2.0053037235275968e-05 2.0053037235275958e-05 5.5511151231257827e-16 + 2.0250000000000000e+02 2.2500000000000000e+01 37 36 2.0053037235275938e-05 2.0053037235275968e-05 -1.5543122344752192e-15 + 2.2500000000000000e+02 2.2500000000000000e+01 38 37 2.0053037235275907e-05 2.0053037235275938e-05 -1.5543122344752192e-15 + 2.4750000000000000e+02 2.2500000000000000e+01 39 38 2.0053037235275958e-05 2.0053037235275907e-05 2.5535129566378600e-15 + 2.7000000000000000e+02 2.2500000000000000e+01 40 39 2.0053037235275951e-05 2.0053037235275958e-05 -4.4408920985006262e-16 + 2.9250000000000000e+02 2.2500000000000000e+01 41 40 2.0053037235275955e-05 2.0053037235275951e-05 2.2204460492503131e-16 + 3.1500000000000000e+02 2.2500000000000000e+01 42 41 2.0053037235275924e-05 2.0053037235275955e-05 -1.5543122344752192e-15 + 3.3750000000000000e+02 2.2500000000000000e+01 43 42 2.0053037235275907e-05 2.0053037235275924e-05 -8.8817841970012523e-16 + 3.6000000000000000e+02 2.2500000000000000e+01 44 43 2.0053037235275955e-05 2.0053037235275907e-05 2.3314683517128287e-15 + 3.8250000000000000e+02 2.2500000000000000e+01 45 44 2.0053037235275890e-05 2.0053037235275955e-05 -3.1086244689504383e-15 + 4.0500000000000000e+02 2.2500000000000000e+01 46 45 2.0053037235275968e-05 2.0053037235275890e-05 3.8857805861880479e-15 + 4.2750000000000000e+02 2.2500000000000000e+01 47 46 2.0053037235275928e-05 2.0053037235275968e-05 -1.9984014443252818e-15 + 4.5000000000000000e+02 2.2500000000000000e+01 48 47 2.0053037235275968e-05 2.0053037235275928e-05 1.9984014443252818e-15 + 4.7250000000000000e+02 2.2500000000000000e+01 49 48 2.0053037235275934e-05 2.0053037235275968e-05 -1.7763568394002505e-15 + 4.9500000000000000e+02 2.2500000000000000e+01 50 49 2.0053037235275948e-05 2.0053037235275934e-05 6.6613381477509392e-16 + 5.1750000000000000e+02 2.2500000000000000e+01 51 50 2.0053037235275948e-05 2.0053037235275948e-05 0.0000000000000000e+00 + 5.4000000000000000e+02 2.2500000000000000e+01 52 51 2.0053037235275944e-05 2.0053037235275948e-05 -2.2204460492503131e-16 + 5.6250000000000000e+02 2.2500000000000000e+01 53 52 2.0053037235275921e-05 2.0053037235275944e-05 -1.1102230246251565e-15 + 5.8500000000000000e+02 2.2500000000000000e+01 53 53 2.0053037235275985e-05 2.0053037235275921e-05 3.2196467714129540e-15 + 6.0750000000000000e+02 2.2500000000000000e+01 54 53 2.0053037235275883e-05 2.0053037235275985e-05 -5.1070259132757201e-15 + 6.3000000000000000e+02 2.2500000000000000e+01 55 54 2.0053037235275975e-05 2.0053037235275883e-05 4.5519144009631418e-15 + 6.5250000000000000e+02 2.2500000000000000e+01 56 55 2.0053037235275900e-05 2.0053037235275975e-05 -3.7747582837255322e-15 + 6.7500000000000000e+02 2.2500000000000000e+01 56 56 2.0053037235275955e-05 2.0053037235275900e-05 2.6645352591003757e-15 + 6.9750000000000000e+02 2.2500000000000000e+01 57 56 2.0053037235275975e-05 2.0053037235275955e-05 9.9920072216264089e-16 + 7.2000000000000000e+02 2.2500000000000000e+01 58 57 2.0053037235275941e-05 2.0053037235275975e-05 -1.7763568394002505e-15 + 7.4250000000000000e+02 2.2500000000000000e+01 59 58 2.0053037235275965e-05 2.0053037235275941e-05 1.2212453270876722e-15 + 7.6500000000000000e+02 2.2500000000000000e+01 59 59 2.0053037235275924e-05 2.0053037235275965e-05 -1.9984014443252818e-15 + 7.8750000000000000e+02 2.2500000000000000e+01 60 59 2.0053037235275948e-05 2.0053037235275924e-05 1.2212453270876722e-15 + 8.1000000000000000e+02 2.2500000000000000e+01 60 60 2.0053037235275985e-05 2.0053037235275948e-05 1.8873791418627661e-15 + 8.3250000000000000e+02 2.2500000000000000e+01 61 60 2.0053037235275924e-05 2.0053037235275985e-05 -3.1086244689504383e-15 + 8.5500000000000000e+02 2.2500000000000000e+01 62 61 2.0053037235275982e-05 2.0053037235275924e-05 2.8865798640254070e-15 + 8.7750000000000000e+02 2.2500000000000000e+01 62 62 2.0053037235275972e-05 2.0053037235275982e-05 -4.4408920985006262e-16 + 9.0000000000000000e+02 2.2500000000000000e+01 63 62 2.0053037235275955e-05 2.0053037235275972e-05 -8.8817841970012523e-16 + 9.2250000000000000e+02 2.2500000000000000e+01 63 63 2.0053037235275924e-05 2.0053037235275955e-05 -1.5543122344752192e-15 + 9.4500000000000000e+02 2.2500000000000000e+01 64 63 2.0053037235275941e-05 2.0053037235275924e-05 8.8817841970012523e-16 + 9.6750000000000000e+02 2.2500000000000000e+01 64 64 2.0053037235275961e-05 2.0053037235275941e-05 9.9920072216264089e-16 + 9.9000000000000000e+02 2.2500000000000000e+01 65 64 2.0053037235275961e-05 2.0053037235275961e-05 0.0000000000000000e+00 + 1.0125000000000000e+03 2.2500000000000000e+01 65 65 2.0053037235275992e-05 2.0053037235275961e-05 1.5543122344752192e-15 + 1.0350000000000000e+03 2.2500000000000000e+01 66 65 2.0053037235275989e-05 2.0053037235275992e-05 -2.2204460492503131e-16 + 1.0575000000000000e+03 2.2500000000000000e+01 66 66 2.0053037235275907e-05 2.0053037235275989e-05 -3.9968028886505635e-15 + 1.0800000000000000e+03 2.2500000000000000e+01 67 66 2.0053037235275965e-05 2.0053037235275907e-05 2.8865798640254070e-15 + 1.1025000000000000e+03 2.2500000000000000e+01 67 67 2.0053037235275955e-05 2.0053037235275965e-05 -4.4408920985006262e-16 + 1.1250000000000000e+03 2.2500000000000000e+01 68 67 2.0053037235275948e-05 2.0053037235275955e-05 -4.4408920985006262e-16 + 1.1475000000000000e+03 2.2500000000000000e+01 68 68 2.0053037235275924e-05 2.0053037235275948e-05 -1.1102230246251565e-15 + 1.1700000000000000e+03 2.2500000000000000e+01 69 68 2.0053037235275999e-05 2.0053037235275924e-05 3.6637359812630166e-15 + 1.1925000000000000e+03 2.2500000000000000e+01 69 69 2.0053037235276012e-05 2.0053037235275999e-05 6.6613381477509392e-16 + 1.2150000000000000e+03 2.2500000000000000e+01 70 69 2.0053037235275999e-05 2.0053037235276012e-05 -6.6613381477509392e-16 + 1.2375000000000000e+03 2.2500000000000000e+01 70 70 2.0053037235275951e-05 2.0053037235275999e-05 -2.4424906541753444e-15 + 1.2600000000000000e+03 2.2500000000000000e+01 70 70 2.0053037235276005e-05 2.0053037235275951e-05 2.6645352591003757e-15 + 1.2825000000000000e+03 2.2500000000000000e+01 71 70 2.0053037235275928e-05 2.0053037235276005e-05 -3.9968028886505635e-15 + 1.3050000000000000e+03 2.2500000000000000e+01 71 71 2.0053037235275894e-05 2.0053037235275928e-05 -1.7763568394002505e-15 + 1.3275000000000000e+03 2.2500000000000000e+01 72 71 2.0053037235275978e-05 2.0053037235275894e-05 4.2188474935755949e-15 + 1.3500000000000000e+03 2.2500000000000000e+01 72 72 2.0053037235275917e-05 2.0053037235275978e-05 -3.1086244689504383e-15 + 1.3725000000000000e+03 2.2500000000000000e+01 73 72 2.0053037235275900e-05 2.0053037235275917e-05 -8.8817841970012523e-16 + 1.3950000000000000e+03 2.2500000000000000e+01 73 73 2.0053037235275978e-05 2.0053037235275900e-05 3.8857805861880479e-15 + 1.4175000000000000e+03 2.2500000000000000e+01 73 73 2.0053037235275972e-05 2.0053037235275978e-05 -4.4408920985006262e-16 + 1.4400000000000000e+03 2.2500000000000000e+01 74 73 2.0053037235275961e-05 2.0053037235275972e-05 -4.4408920985006262e-16 + 1.4625000000000000e+03 2.2500000000000000e+01 74 74 2.0053037235275931e-05 2.0053037235275961e-05 -1.5543122344752192e-15 + 1.4850000000000000e+03 2.2500000000000000e+01 74 74 2.0053037235276016e-05 2.0053037235275931e-05 4.2188474935755949e-15 + 1.5075000000000000e+03 2.2500000000000000e+01 75 74 2.0053037235275924e-05 2.0053037235276016e-05 -4.6629367034256575e-15 + 1.5300000000000000e+03 2.2500000000000000e+01 75 75 2.0053037235275958e-05 2.0053037235275924e-05 1.6653345369377348e-15 + 1.5525000000000000e+03 2.2500000000000000e+01 76 75 2.0053037235275955e-05 2.0053037235275958e-05 -2.2204460492503131e-16 + 1.5750000000000000e+03 2.2500000000000000e+01 76 76 2.0053037235275904e-05 2.0053037235275955e-05 -2.4424906541753444e-15 + 1.5975000000000000e+03 2.2500000000000000e+01 76 76 2.0053037235275968e-05 2.0053037235275904e-05 3.2196467714129540e-15 + 1.6200000000000000e+03 2.2500000000000000e+01 77 76 2.0053037235276002e-05 2.0053037235275968e-05 1.6653345369377348e-15 + 1.6425000000000000e+03 2.2500000000000000e+01 77 77 2.0053037235275955e-05 2.0053037235276002e-05 -2.4424906541753444e-15 + 1.6650000000000000e+03 2.2500000000000000e+01 77 77 2.0053037235275938e-05 2.0053037235275955e-05 -8.8817841970012523e-16 + 1.6875000000000000e+03 2.2500000000000000e+01 78 77 2.0053037235275972e-05 2.0053037235275938e-05 1.6653345369377348e-15 + 1.7100000000000000e+03 2.2500000000000000e+01 78 78 2.0053037235276053e-05 2.0053037235275972e-05 4.1078251911130792e-15 + 1.7325000000000000e+03 2.2500000000000000e+01 78 78 2.0053037235276060e-05 2.0053037235276053e-05 3.3306690738754696e-16 + 1.7550000000000000e+03 2.2500000000000000e+01 79 78 2.0053037235275961e-05 2.0053037235276060e-05 -4.8849813083506888e-15 + 1.7775000000000000e+03 2.2500000000000000e+01 79 79 2.0053037235276016e-05 2.0053037235275961e-05 2.6645352591003757e-15 + 1.8000000000000000e+03 2.2500000000000000e+01 79 79 2.0053037235275944e-05 2.0053037235276016e-05 -3.5527136788005009e-15 + 1.8225000000000000e+03 2.2500000000000000e+01 80 79 2.0053037235275975e-05 2.0053037235275944e-05 1.5543122344752192e-15 + 1.8450000000000000e+03 2.2500000000000000e+01 80 80 2.0053037235275944e-05 2.0053037235275975e-05 -1.5543122344752192e-15 + 1.8675000000000000e+03 2.2500000000000000e+01 80 80 2.0053037235276005e-05 2.0053037235275944e-05 2.9976021664879227e-15 + 1.8900000000000000e+03 2.2500000000000000e+01 81 80 2.0053037235276009e-05 2.0053037235276005e-05 2.2204460492503131e-16 + 1.9125000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275972e-05 2.0053037235276009e-05 -1.7763568394002505e-15 + 1.9350000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275941e-05 2.0053037235275972e-05 -1.5543122344752192e-15 + 1.9575000000000000e+03 2.2500000000000000e+01 81 81 2.0053037235275955e-05 2.0053037235275941e-05 6.6613381477509392e-16 + 1.9800000000000000e+03 2.2500000000000000e+01 82 81 2.0053037235276043e-05 2.0053037235275955e-05 4.4408920985006262e-15 + 2.0025000000000000e+03 2.2500000000000000e+01 82 82 2.0053037235275955e-05 2.0053037235276043e-05 -4.4408920985006262e-15 + 2.0250000000000000e+03 2.2500000000000000e+01 82 82 2.0053037235275944e-05 2.0053037235275955e-05 -4.4408920985006262e-16 + 2.0475000000000000e+03 2.2500000000000000e+01 83 82 2.0053037235275958e-05 2.0053037235275944e-05 6.6613381477509392e-16 + 2.0700000000000000e+03 2.2500000000000000e+01 83 83 2.0053037235275978e-05 2.0053037235275958e-05 9.9920072216264089e-16 + 2.0925000000000000e+03 2.2500000000000000e+01 83 83 2.0053037235276002e-05 2.0053037235275978e-05 1.2212453270876722e-15 + 2.1150000000000000e+03 2.2500000000000000e+01 83 83 2.0053037235275965e-05 2.0053037235276002e-05 -1.7763568394002505e-15 + 2.1375000000000000e+03 2.2500000000000000e+01 84 83 2.0053037235275978e-05 2.0053037235275965e-05 6.6613381477509392e-16 + 2.1600000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235276046e-05 2.0053037235275978e-05 3.3306690738754696e-15 + 2.1825000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235275958e-05 2.0053037235276046e-05 -4.4408920985006262e-15 + 2.2050000000000000e+03 2.2500000000000000e+01 84 84 2.0053037235276002e-05 2.0053037235275958e-05 2.2204460492503131e-15 + 2.2275000000000000e+03 2.2500000000000000e+01 85 84 2.0053037235275961e-05 2.0053037235276002e-05 -1.9984014443252818e-15 + 2.2500000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235275972e-05 2.0053037235275961e-05 5.5511151231257827e-16 + 2.2725000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235276002e-05 2.0053037235275972e-05 1.5543122344752192e-15 + 2.2950000000000000e+03 2.2500000000000000e+01 85 85 2.0053037235275975e-05 2.0053037235276002e-05 -1.3322676295501878e-15 + 2.3175000000000000e+03 2.2500000000000000e+01 86 85 2.0053037235275924e-05 2.0053037235275975e-05 -2.4424906541753444e-15 + 2.3400000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235275961e-05 2.0053037235275924e-05 1.8873791418627661e-15 + 2.3625000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235276005e-05 2.0053037235275961e-05 2.2204460492503131e-15 + 2.3850000000000000e+03 2.2500000000000000e+01 86 86 2.0053037235275992e-05 2.0053037235276005e-05 -6.6613381477509392e-16 + 2.4075000000000000e+03 2.2500000000000000e+01 87 86 2.0053037235275972e-05 2.0053037235275992e-05 -1.1102230246251565e-15 + 2.4300000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235275921e-05 2.0053037235275972e-05 -2.4424906541753444e-15 + 2.4525000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235275955e-05 2.0053037235275921e-05 1.6653345369377348e-15 + 2.4750000000000000e+03 2.2500000000000000e+01 87 87 2.0053037235275992e-05 2.0053037235275955e-05 1.8873791418627661e-15 + 2.4975000000000000e+03 2.2500000000000000e+01 88 87 2.0053037235276036e-05 2.0053037235275992e-05 2.2204460492503131e-15 + 2.5200000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275992e-05 2.0053037235276036e-05 -2.2204460492503131e-15 + 2.5425000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275961e-05 2.0053037235275992e-05 -1.5543122344752192e-15 + 2.5650000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275992e-05 2.0053037235275961e-05 1.5543122344752192e-15 + 2.5875000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275968e-05 2.0053037235275992e-05 -1.1102230246251565e-15 + 2.6100000000000000e+03 2.2500000000000000e+01 88 88 2.0053037235275992e-05 2.0053037235275968e-05 1.2212453270876722e-15 + 2.6325000000000000e+03 2.2500000000000000e+01 89 88 2.0053037235275961e-05 2.0053037235275992e-05 -1.5543122344752192e-15 + 2.6550000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275995e-05 2.0053037235275961e-05 1.6653345369377348e-15 + 2.6775000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275961e-05 2.0053037235275995e-05 -1.7763568394002505e-15 + 2.7000000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275982e-05 2.0053037235275961e-05 9.9920072216264089e-16 + 2.7225000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275928e-05 2.0053037235275982e-05 -2.6645352591003757e-15 + 2.7450000000000000e+03 2.2500000000000000e+01 89 89 2.0053037235275972e-05 2.0053037235275928e-05 2.2204460492503131e-15 + 2.7675000000000000e+03 2.2500000000000000e+01 90 89 2.0053037235275968e-05 2.0053037235275972e-05 -2.2204460492503131e-16 + 2.7900000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275931e-05 2.0053037235275968e-05 -1.7763568394002505e-15 + 2.8125000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275968e-05 2.0053037235275931e-05 1.8873791418627661e-15 + 2.8350000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275989e-05 2.0053037235275968e-05 9.9920072216264089e-16 + 2.8575000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275995e-05 2.0053037235275989e-05 3.3306690738754696e-16 + 2.8800000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275975e-05 2.0053037235275995e-05 -1.1102230246251565e-15 + 2.9025000000000000e+03 2.2500000000000000e+01 90 90 2.0053037235275989e-05 2.0053037235275975e-05 6.6613381477509392e-16 + 2.9250000000000000e+03 2.2500000000000000e+01 91 90 2.0053037235275961e-05 2.0053037235275989e-05 -1.3322676295501878e-15 + 2.9475000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275955e-05 2.0053037235275961e-05 -4.4408920985006262e-16 + 2.9700000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275965e-05 2.0053037235275955e-05 5.5511151231257827e-16 + 2.9925000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235276009e-05 2.0053037235275965e-05 2.2204460492503131e-15 + 3.0150000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275948e-05 2.0053037235276009e-05 -3.1086244689504383e-15 + 3.0375000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275961e-05 2.0053037235275948e-05 6.6613381477509392e-16 + 3.0600000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275989e-05 2.0053037235275961e-05 1.3322676295501878e-15 + 3.0825000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235276005e-05 2.0053037235275989e-05 8.8817841970012523e-16 + 3.1050000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275982e-05 2.0053037235276005e-05 -1.1102230246251565e-15 + 3.1275000000000000e+03 2.2500000000000000e+01 91 91 2.0053037235275989e-05 2.0053037235275982e-05 3.3306690738754696e-16 + 3.1500000000000000e+03 2.2500000000000000e+01 92 91 2.0053037235275999e-05 2.0053037235275989e-05 5.5511151231257827e-16 + 3.1725000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275924e-05 2.0053037235275999e-05 -3.7747582837255322e-15 + 3.1950000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275961e-05 2.0053037235275924e-05 1.8873791418627661e-15 + 3.2175000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235276036e-05 2.0053037235275961e-05 3.6637359812630166e-15 + 3.2400000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235276033e-05 2.0053037235276036e-05 -2.2204460492503131e-16 + 3.2625000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275995e-05 2.0053037235276033e-05 -1.7763568394002505e-15 + 3.2850000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235276019e-05 2.0053037235275995e-05 1.2212453270876722e-15 + 3.3075000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275948e-05 2.0053037235276019e-05 -3.5527136788005009e-15 + 3.3300000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235276005e-05 2.0053037235275948e-05 2.8865798640254070e-15 + 3.3525000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275941e-05 2.0053037235276005e-05 -3.1086244689504383e-15 + 3.3750000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275972e-05 2.0053037235275941e-05 1.5543122344752192e-15 + 3.3975000000000000e+03 2.2500000000000000e+01 92 92 2.0053037235275951e-05 2.0053037235275972e-05 -1.1102230246251565e-15 + 3.4200000000000000e+03 2.2500000000000000e+01 93 92 2.0053037235276029e-05 2.0053037235275951e-05 3.8857805861880479e-15 + 3.4425000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275951e-05 2.0053037235276029e-05 -3.9968028886505635e-15 + 3.4650000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275989e-05 2.0053037235275951e-05 1.8873791418627661e-15 + 3.4875000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275995e-05 2.0053037235275989e-05 3.3306690738754696e-16 + 3.5100000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275968e-05 2.0053037235275995e-05 -1.3322676295501878e-15 + 3.5325000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275944e-05 2.0053037235275968e-05 -1.1102230246251565e-15 + 3.5550000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275972e-05 2.0053037235275944e-05 1.3322676295501878e-15 + 3.5775000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275934e-05 2.0053037235275972e-05 -1.7763568394002505e-15 + 3.6000000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235276033e-05 2.0053037235275934e-05 4.8849813083506888e-15 + 3.6225000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275938e-05 2.0053037235276033e-05 -4.6629367034256575e-15 + 3.6450000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275999e-05 2.0053037235275938e-05 2.9976021664879227e-15 + 3.6675000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275978e-05 2.0053037235275999e-05 -1.1102230246251565e-15 + 3.6900000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275941e-05 2.0053037235275978e-05 -1.7763568394002505e-15 + 3.7125000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235276029e-05 2.0053037235275941e-05 4.4408920985006262e-15 + 3.7350000000000000e+03 2.2500000000000000e+01 93 93 2.0053037235275978e-05 2.0053037235276029e-05 -2.4424906541753444e-15 diff --git a/tst/scripts/coagulation/coag_info_sden.dat b/tst/scripts/coagulation/coag_info_sden.dat index d160b28f..8cff9509 100644 --- a/tst/scripts/coagulation/coag_info_sden.dat +++ b/tst/scripts/coagulation/coag_info_sden.dat @@ -1,168 +1,168 @@ # time dt max_size1 max_size0 mass_d1 mass_d0 delta - 0.0000000000000000e+00 2.2500000000000000e+01 19 10 2.5132741228718358e-06 2.5132741228718329e-06 1.2212453270876722e-15 - 2.2500000000000000e+01 2.2500000000000000e+01 23 19 2.5132741228718354e-06 2.5132741228718358e-06 -2.2204460492503131e-16 - 4.5000000000000000e+01 2.2500000000000000e+01 26 23 2.5132741228718312e-06 2.5132741228718354e-06 -1.7763568394002505e-15 - 6.7500000000000000e+01 2.2500000000000000e+01 28 26 2.5132741228718325e-06 2.5132741228718312e-06 5.5511151231257827e-16 - 9.0000000000000000e+01 2.2500000000000000e+01 29 28 2.5132741228718358e-06 2.5132741228718325e-06 1.3322676295501878e-15 - 1.1250000000000000e+02 2.2500000000000000e+01 31 29 2.5132741228718342e-06 2.5132741228718358e-06 -6.6613381477509392e-16 - 1.3500000000000000e+02 2.2500000000000000e+01 32 31 2.5132741228718286e-06 2.5132741228718342e-06 -2.2204460492503131e-15 - 1.5750000000000000e+02 2.2500000000000000e+01 34 32 2.5132741228718325e-06 2.5132741228718286e-06 1.5543122344752192e-15 - 1.8000000000000000e+02 2.2500000000000000e+01 35 34 2.5132741228718333e-06 2.5132741228718325e-06 3.3306690738754696e-16 - 2.0250000000000000e+02 2.2500000000000000e+01 36 35 2.5132741228718299e-06 2.5132741228718333e-06 -1.3322676295501878e-15 - 2.2500000000000000e+02 2.2500000000000000e+01 37 36 2.5132741228718286e-06 2.5132741228718299e-06 -4.4408920985006262e-16 - 2.4750000000000000e+02 2.2500000000000000e+01 38 37 2.5132741228718316e-06 2.5132741228718286e-06 1.2212453270876722e-15 - 2.7000000000000000e+02 2.2500000000000000e+01 39 38 2.5132741228718337e-06 2.5132741228718316e-06 8.8817841970012523e-16 - 2.9250000000000000e+02 2.2500000000000000e+01 40 39 2.5132741228718299e-06 2.5132741228718337e-06 -1.5543122344752192e-15 - 3.1500000000000000e+02 2.2500000000000000e+01 41 40 2.5132741228718392e-06 2.5132741228718299e-06 3.6637359812630166e-15 - 3.3750000000000000e+02 2.2500000000000000e+01 42 41 2.5132741228718384e-06 2.5132741228718392e-06 -4.4408920985006262e-16 - 3.6000000000000000e+02 2.2500000000000000e+01 43 42 2.5132741228718414e-06 2.5132741228718384e-06 1.2212453270876722e-15 - 3.8250000000000000e+02 2.2500000000000000e+01 44 43 2.5132741228718358e-06 2.5132741228718414e-06 -2.2204460492503131e-15 - 4.0500000000000000e+02 2.2500000000000000e+01 45 44 2.5132741228718333e-06 2.5132741228718358e-06 -1.1102230246251565e-15 - 4.2750000000000000e+02 2.2500000000000000e+01 46 45 2.5132741228718363e-06 2.5132741228718333e-06 1.2212453270876722e-15 - 4.5000000000000000e+02 2.2500000000000000e+01 47 46 2.5132741228718392e-06 2.5132741228718363e-06 1.2212453270876722e-15 - 4.7250000000000000e+02 2.2500000000000000e+01 48 47 2.5132741228718342e-06 2.5132741228718392e-06 -1.9984014443252818e-15 - 4.9500000000000000e+02 2.2500000000000000e+01 49 48 2.5132741228718401e-06 2.5132741228718342e-06 2.3314683517128287e-15 - 5.1750000000000000e+02 2.2500000000000000e+01 50 49 2.5132741228718346e-06 2.5132741228718401e-06 -2.2204460492503131e-15 - 5.4000000000000000e+02 2.2500000000000000e+01 51 50 2.5132741228718384e-06 2.5132741228718346e-06 1.5543122344752192e-15 - 5.6250000000000000e+02 2.2500000000000000e+01 52 51 2.5132741228718346e-06 2.5132741228718384e-06 -1.5543122344752192e-15 - 5.8500000000000000e+02 2.2500000000000000e+01 52 52 2.5132741228718358e-06 2.5132741228718346e-06 5.5511151231257827e-16 - 6.0750000000000000e+02 2.2500000000000000e+01 53 52 2.5132741228718384e-06 2.5132741228718358e-06 9.9920072216264089e-16 - 6.3000000000000000e+02 2.2500000000000000e+01 54 53 2.5132741228718414e-06 2.5132741228718384e-06 1.2212453270876722e-15 - 6.5250000000000000e+02 2.2500000000000000e+01 55 54 2.5132741228718388e-06 2.5132741228718414e-06 -1.1102230246251565e-15 - 6.7500000000000000e+02 2.2500000000000000e+01 55 55 2.5132741228718367e-06 2.5132741228718388e-06 -8.8817841970012523e-16 - 6.9750000000000000e+02 2.2500000000000000e+01 56 55 2.5132741228718405e-06 2.5132741228718367e-06 1.5543122344752192e-15 - 7.2000000000000000e+02 2.2500000000000000e+01 57 56 2.5132741228718375e-06 2.5132741228718405e-06 -1.1102230246251565e-15 - 7.4250000000000000e+02 2.2500000000000000e+01 58 57 2.5132741228718363e-06 2.5132741228718375e-06 -4.4408920985006262e-16 - 7.6500000000000000e+02 2.2500000000000000e+01 58 58 2.5132741228718380e-06 2.5132741228718363e-06 6.6613381477509392e-16 - 7.8750000000000000e+02 2.2500000000000000e+01 59 58 2.5132741228718401e-06 2.5132741228718380e-06 8.8817841970012523e-16 - 8.1000000000000000e+02 2.2500000000000000e+01 60 59 2.5132741228718354e-06 2.5132741228718401e-06 -1.7763568394002505e-15 - 8.3250000000000000e+02 2.2500000000000000e+01 60 60 2.5132741228718384e-06 2.5132741228718354e-06 1.2212453270876722e-15 - 8.5500000000000000e+02 2.2500000000000000e+01 61 60 2.5132741228718388e-06 2.5132741228718384e-06 2.2204460492503131e-16 - 8.7750000000000000e+02 2.2500000000000000e+01 61 61 2.5132741228718405e-06 2.5132741228718388e-06 6.6613381477509392e-16 - 9.0000000000000000e+02 2.2500000000000000e+01 62 61 2.5132741228718367e-06 2.5132741228718405e-06 -1.5543122344752192e-15 - 9.2250000000000000e+02 2.2500000000000000e+01 63 62 2.5132741228718346e-06 2.5132741228718367e-06 -8.8817841970012523e-16 - 9.4500000000000000e+02 2.2500000000000000e+01 63 63 2.5132741228718367e-06 2.5132741228718346e-06 8.8817841970012523e-16 - 9.6750000000000000e+02 2.2500000000000000e+01 64 63 2.5132741228718333e-06 2.5132741228718367e-06 -1.3322676295501878e-15 - 9.9000000000000000e+02 2.2500000000000000e+01 64 64 2.5132741228718375e-06 2.5132741228718333e-06 1.6653345369377348e-15 - 1.0125000000000000e+03 2.2500000000000000e+01 65 64 2.5132741228718388e-06 2.5132741228718375e-06 5.5511151231257827e-16 - 1.0350000000000000e+03 2.2500000000000000e+01 65 65 2.5132741228718401e-06 2.5132741228718388e-06 5.5511151231257827e-16 - 1.0575000000000000e+03 2.2500000000000000e+01 66 65 2.5132741228718329e-06 2.5132741228718401e-06 -2.8865798640254070e-15 - 1.0800000000000000e+03 2.2500000000000000e+01 66 66 2.5132741228718439e-06 2.5132741228718329e-06 4.3298697960381105e-15 - 1.1025000000000000e+03 2.2500000000000000e+01 67 66 2.5132741228718426e-06 2.5132741228718439e-06 -4.4408920985006262e-16 - 1.1250000000000000e+03 2.2500000000000000e+01 67 67 2.5132741228718384e-06 2.5132741228718426e-06 -1.7763568394002505e-15 - 1.1475000000000000e+03 2.2500000000000000e+01 68 67 2.5132741228718303e-06 2.5132741228718384e-06 -3.1086244689504383e-15 - 1.1700000000000000e+03 2.2500000000000000e+01 68 68 2.5132741228718337e-06 2.5132741228718303e-06 1.3322676295501878e-15 - 1.1925000000000000e+03 2.2500000000000000e+01 69 68 2.5132741228718430e-06 2.5132741228718337e-06 3.6637359812630166e-15 - 1.2150000000000000e+03 2.2500000000000000e+01 69 69 2.5132741228718405e-06 2.5132741228718430e-06 -1.1102230246251565e-15 - 1.2375000000000000e+03 2.2500000000000000e+01 70 69 2.5132741228718367e-06 2.5132741228718405e-06 -1.5543122344752192e-15 - 1.2600000000000000e+03 2.2500000000000000e+01 70 70 2.5132741228718358e-06 2.5132741228718367e-06 -4.4408920985006262e-16 - 1.2825000000000000e+03 2.2500000000000000e+01 71 70 2.5132741228718418e-06 2.5132741228718358e-06 2.3314683517128287e-15 - 1.3050000000000000e+03 2.2500000000000000e+01 71 71 2.5132741228718477e-06 2.5132741228718418e-06 2.3314683517128287e-15 - 1.3275000000000000e+03 2.2500000000000000e+01 72 71 2.5132741228718350e-06 2.5132741228718477e-06 -5.1070259132757201e-15 - 1.3500000000000000e+03 2.2500000000000000e+01 72 72 2.5132741228718316e-06 2.5132741228718350e-06 -1.3322676295501878e-15 - 1.3725000000000000e+03 2.2500000000000000e+01 73 72 2.5132741228718409e-06 2.5132741228718316e-06 3.6637359812630166e-15 - 1.3950000000000000e+03 2.2500000000000000e+01 73 73 2.5132741228718358e-06 2.5132741228718409e-06 -1.9984014443252818e-15 - 1.4175000000000000e+03 2.2500000000000000e+01 74 73 2.5132741228718350e-06 2.5132741228718358e-06 -4.4408920985006262e-16 - 1.4400000000000000e+03 2.2500000000000000e+01 74 74 2.5132741228718401e-06 2.5132741228718350e-06 1.9984014443252818e-15 - 1.4625000000000000e+03 2.2500000000000000e+01 75 74 2.5132741228718316e-06 2.5132741228718401e-06 -3.3306690738754696e-15 - 1.4850000000000000e+03 2.2500000000000000e+01 75 75 2.5132741228718456e-06 2.5132741228718316e-06 5.5511151231257827e-15 - 1.5075000000000000e+03 2.2500000000000000e+01 76 75 2.5132741228718354e-06 2.5132741228718456e-06 -3.9968028886505635e-15 - 1.5300000000000000e+03 2.2500000000000000e+01 76 76 2.5132741228718405e-06 2.5132741228718354e-06 1.9984014443252818e-15 - 1.5525000000000000e+03 2.2500000000000000e+01 77 76 2.5132741228718397e-06 2.5132741228718405e-06 -4.4408920985006262e-16 - 1.5750000000000000e+03 2.2500000000000000e+01 77 77 2.5132741228718414e-06 2.5132741228718397e-06 6.6613381477509392e-16 - 1.5975000000000000e+03 2.2500000000000000e+01 78 77 2.5132741228718392e-06 2.5132741228718414e-06 -8.8817841970012523e-16 - 1.6200000000000000e+03 2.2500000000000000e+01 78 78 2.5132741228718439e-06 2.5132741228718392e-06 1.8873791418627661e-15 - 1.6425000000000000e+03 2.2500000000000000e+01 79 78 2.5132741228718418e-06 2.5132741228718439e-06 -8.8817841970012523e-16 - 1.6650000000000000e+03 2.2500000000000000e+01 80 79 2.5132741228718384e-06 2.5132741228718418e-06 -1.3322676295501878e-15 - 1.6875000000000000e+03 2.2500000000000000e+01 80 80 2.5132741228718371e-06 2.5132741228718384e-06 -4.4408920985006262e-16 - 1.7100000000000000e+03 2.2500000000000000e+01 81 80 2.5132741228718375e-06 2.5132741228718371e-06 2.2204460492503131e-16 - 1.7325000000000000e+03 2.2500000000000000e+01 82 81 2.5132741228718342e-06 2.5132741228718375e-06 -1.3322676295501878e-15 - 1.7550000000000000e+03 2.2500000000000000e+01 82 82 2.5132741228718358e-06 2.5132741228718342e-06 6.6613381477509392e-16 - 1.7775000000000000e+03 2.2500000000000000e+01 83 82 2.5132741228718354e-06 2.5132741228718358e-06 -2.2204460492503131e-16 - 1.8000000000000000e+03 2.2500000000000000e+01 84 83 2.5132741228718384e-06 2.5132741228718354e-06 1.2212453270876722e-15 - 1.8225000000000000e+03 2.2500000000000000e+01 84 84 2.5132741228718435e-06 2.5132741228718384e-06 1.9984014443252818e-15 - 1.8450000000000000e+03 2.2500000000000000e+01 85 84 2.5132741228718486e-06 2.5132741228718435e-06 1.9984014443252818e-15 - 1.8675000000000000e+03 2.2500000000000000e+01 86 85 2.5132741228718430e-06 2.5132741228718486e-06 -2.2204460492503131e-15 - 1.8900000000000000e+03 2.2500000000000000e+01 86 86 2.5132741228718426e-06 2.5132741228718430e-06 -2.2204460492503131e-16 - 1.9125000000000000e+03 2.2500000000000000e+01 87 86 2.5132741228718430e-06 2.5132741228718426e-06 2.2204460492503131e-16 - 1.9350000000000000e+03 2.2500000000000000e+01 88 87 2.5132741228718405e-06 2.5132741228718430e-06 -1.1102230246251565e-15 - 1.9575000000000000e+03 2.2500000000000000e+01 89 88 2.5132741228718574e-06 2.5132741228718405e-06 6.7723604502134549e-15 - 1.9800000000000000e+03 2.2500000000000000e+01 89 89 2.5132741228719405e-06 2.5132741228718574e-06 3.2973623831367149e-14 - 2.0025000000000000e+03 2.2500000000000000e+01 90 89 2.5132741228722437e-06 2.5132741228719405e-06 1.2068124277675452e-13 - 2.0250000000000000e+03 2.2500000000000000e+01 90 90 2.5132741228730831e-06 2.5132741228722437e-06 3.3395508580724709e-13 - 2.0475000000000000e+03 2.2500000000000000e+01 90 90 2.5132741228750389e-06 2.5132741228730831e-06 7.7815531795977222e-13 - 2.0700000000000000e+03 2.2500000000000000e+01 91 90 2.5132741228786938e-06 2.5132741228750389e-06 1.4542811399564926e-12 - 2.0925000000000000e+03 2.2500000000000000e+01 91 91 2.5132741228842970e-06 2.5132741228786938e-06 2.2294388557497768e-12 - 2.1150000000000000e+03 2.2500000000000000e+01 91 91 2.5132741228917958e-06 2.5132741228842970e-06 2.9837243786801082e-12 - 2.1375000000000000e+03 2.2500000000000000e+01 92 91 2.5132741229007311e-06 2.5132741228917958e-06 3.5552671917571388e-12 - 2.1600000000000000e+03 2.2500000000000000e+01 92 92 2.5132741229105588e-06 2.5132741229007311e-06 3.9103165150322639e-12 - 2.1825000000000000e+03 2.2500000000000000e+01 92 92 2.5132741229207257e-06 2.5132741229105588e-06 4.0453196348266829e-12 - 2.2050000000000000e+03 2.2500000000000000e+01 93 92 2.5132741229307720e-06 2.5132741229207257e-06 3.9972469778604136e-12 - 2.2275000000000000e+03 2.2500000000000000e+01 93 93 2.5132741229403773e-06 2.5132741229307720e-06 3.8218317399696389e-12 - 2.2500000000000000e+03 2.2500000000000000e+01 93 93 2.5132741229493406e-06 2.5132741229403773e-06 3.5663694220033904e-12 - 2.2725000000000000e+03 2.2500000000000000e+01 94 93 2.5132741229575742e-06 2.5132741229493406e-06 3.2760461010639119e-12 - 2.2950000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229650175e-06 2.5132741229575742e-06 2.9616309404900676e-12 - 2.3175000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229717112e-06 2.5132741229650175e-06 2.6633140137732880e-12 - 2.3400000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229776857e-06 2.5132741229717112e-06 2.3772095403273852e-12 - 2.3625000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229830068e-06 2.5132741229776857e-06 2.1171953079601735e-12 - 2.3850000000000000e+03 2.2500000000000000e+01 95 94 2.5132741229877540e-06 2.5132741229830068e-06 1.8888224317947788e-12 - 2.4075000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229920044e-06 2.5132741229877540e-06 1.6912027334115010e-12 - 2.4300000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229958173e-06 2.5132741229920044e-06 1.5171197631502764e-12 - 2.4525000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229992487e-06 2.5132741229958173e-06 1.3652412533815550e-12 - 2.4750000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230023522e-06 2.5132741229992487e-06 1.2349010702905616e-12 - 2.4975000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230051855e-06 2.5132741230023522e-06 1.1273204592043840e-12 - 2.5200000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230077969e-06 2.5132741230051855e-06 1.0390577287466840e-12 - 2.5425000000000000e+03 2.2500000000000000e+01 96 95 2.5132741230102114e-06 2.5132741230077969e-06 9.6067598320814795e-13 - 2.5650000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230124598e-06 2.5132741230102114e-06 8.9461771324295114e-13 - 2.5875000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230145901e-06 2.5132741230124598e-06 8.4765527930130702e-13 - 2.6100000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230166061e-06 2.5132741230145901e-06 8.0213613529167560e-13 - 2.6325000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230185301e-06 2.5132741230166061e-06 7.6549877547904543e-13 - 2.6550000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230203881e-06 2.5132741230185301e-06 7.3929751209789174e-13 - 2.6775000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230221808e-06 2.5132741230203881e-06 7.1331829332166308e-13 - 2.7000000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230239219e-06 2.5132741230221808e-06 6.9277916736609768e-13 - 2.7225000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230256176e-06 2.5132741230239219e-06 6.7468253206470763e-13 - 2.7450000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230272791e-06 2.5132741230256176e-06 6.6102678886181820e-13 - 2.7675000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230289215e-06 2.5132741230272791e-06 6.5347727229436714e-13 - 2.7900000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230305279e-06 2.5132741230289215e-06 6.3915539527670262e-13 - 2.8125000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230321013e-06 2.5132741230305279e-06 6.2605476358612577e-13 - 2.8350000000000000e+03 2.2500000000000000e+01 97 96 2.5132741230336687e-06 2.5132741230321013e-06 6.2361227293195043e-13 - 2.8575000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230352116e-06 2.5132741230336687e-06 6.1384231031524905e-13 - 2.8800000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230367248e-06 2.5132741230352116e-06 6.0207394625422239e-13 - 2.9025000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230382274e-06 2.5132741230367248e-06 5.9785509876064680e-13 - 2.9250000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230397068e-06 2.5132741230382274e-06 5.8864024765625800e-13 - 2.9475000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230411713e-06 2.5132741230397068e-06 5.8275606562574467e-13 - 2.9700000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230426193e-06 2.5132741230411713e-06 5.7609472747799373e-13 - 2.9925000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230440393e-06 2.5132741230426193e-06 5.6499249723174216e-13 - 3.0150000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230454361e-06 2.5132741230440393e-06 5.5577764612735336e-13 - 3.0375000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230468155e-06 2.5132741230454361e-06 5.4889426337467739e-13 - 3.0600000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230481707e-06 2.5132741230468155e-06 5.3923532306043853e-13 - 3.0825000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230495213e-06 2.5132741230481707e-06 5.3734794391857577e-13 - 3.1050000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230508266e-06 2.5132741230495213e-06 5.1936233091964823e-13 - 3.1275000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230521357e-06 2.5132741230508266e-06 5.2091664315412345e-13 - 3.1500000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230534092e-06 2.5132741230521357e-06 5.0670578843892145e-13 - 3.1725000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230546561e-06 2.5132741230534092e-06 4.9604764740251994e-13 - 3.1950000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230558936e-06 2.5132741230546561e-06 4.9238391142125693e-13 - 3.2175000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230571023e-06 2.5132741230558936e-06 4.8094861426761781e-13 - 3.2400000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230583046e-06 2.5132741230571023e-06 4.7839510131097995e-13 - 3.2625000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230594854e-06 2.5132741230583046e-06 4.6984638402136625e-13 - 3.2850000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230606552e-06 2.5132741230594854e-06 4.6540549192286562e-13 - 3.3075000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230617940e-06 2.5132741230606552e-06 4.5308201634952638e-13 - 3.3300000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230629269e-06 2.5132741230617940e-06 4.5075054799781356e-13 - 3.3525000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230640424e-06 2.5132741230629269e-06 4.4386716524513758e-13 - 3.3750000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230651491e-06 2.5132741230640424e-06 4.4031445156633708e-13 - 3.3975000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230662375e-06 2.5132741230651491e-06 4.3309800190627357e-13 - 3.4200000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230673239e-06 2.5132741230662375e-06 4.3220982348657344e-13 - 3.4425000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230683860e-06 2.5132741230673239e-06 4.2266190547479709e-13 - 3.4650000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230694452e-06 2.5132741230683860e-06 4.2144066014770942e-13 - 3.4875000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230704871e-06 2.5132741230694452e-06 4.1455727739503345e-13 - 3.5100000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230715404e-06 2.5132741230704871e-06 4.1910919179599659e-13 - 3.5325000000000000e+03 2.2500000000000000e+01 98 97 2.5132741230725543e-06 2.5132741230715404e-06 4.0345504714878189e-13 - 3.5550000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230735775e-06 2.5132741230725543e-06 4.0711878313004490e-13 - 3.5775000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230745910e-06 2.5132741230735775e-06 4.0323300254385686e-13 - 3.6000000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230756074e-06 2.5132741230745910e-06 4.0445424787094453e-13 - 3.6225000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230765976e-06 2.5132741230756074e-06 3.9401815143946806e-13 - 3.6450000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230776030e-06 2.5132741230765976e-06 4.0001335577244390e-13 - 3.6675000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230785830e-06 2.5132741230776030e-06 3.8991032624835498e-13 - 3.6900000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230795631e-06 2.5132741230785830e-06 3.8991032624835498e-13 - 3.7125000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230805426e-06 2.5132741230795631e-06 3.8979930394589246e-13 - 3.7350000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230815070e-06 2.5132741230805426e-06 3.8369307731045410e-13 + 0.0000000000000000e+00 2.2500000000000000e+01 19 10 2.5132741228718380e-06 2.5132741228718329e-06 1.9984014443252818e-15 + 2.2500000000000000e+01 2.2500000000000000e+01 23 19 2.5132741228718316e-06 2.5132741228718380e-06 -2.4424906541753444e-15 + 4.5000000000000000e+01 2.2500000000000000e+01 26 23 2.5132741228718346e-06 2.5132741228718316e-06 1.2212453270876722e-15 + 6.7500000000000000e+01 2.2500000000000000e+01 28 26 2.5132741228718282e-06 2.5132741228718346e-06 -2.4424906541753444e-15 + 9.0000000000000000e+01 2.2500000000000000e+01 29 28 2.5132741228718350e-06 2.5132741228718282e-06 2.6645352591003757e-15 + 1.1250000000000000e+02 2.2500000000000000e+01 31 29 2.5132741228718380e-06 2.5132741228718350e-06 1.2212453270876722e-15 + 1.3500000000000000e+02 2.2500000000000000e+01 32 31 2.5132741228718367e-06 2.5132741228718380e-06 -4.4408920985006262e-16 + 1.5750000000000000e+02 2.2500000000000000e+01 34 32 2.5132741228718316e-06 2.5132741228718367e-06 -1.9984014443252818e-15 + 1.8000000000000000e+02 2.2500000000000000e+01 35 34 2.5132741228718409e-06 2.5132741228718316e-06 3.6637359812630166e-15 + 2.0250000000000000e+02 2.2500000000000000e+01 36 35 2.5132741228718405e-06 2.5132741228718409e-06 -2.2204460492503131e-16 + 2.2500000000000000e+02 2.2500000000000000e+01 37 36 2.5132741228718392e-06 2.5132741228718405e-06 -4.4408920985006262e-16 + 2.4750000000000000e+02 2.2500000000000000e+01 38 37 2.5132741228718325e-06 2.5132741228718392e-06 -2.6645352591003757e-15 + 2.7000000000000000e+02 2.2500000000000000e+01 39 38 2.5132741228718346e-06 2.5132741228718325e-06 8.8817841970012523e-16 + 2.9250000000000000e+02 2.2500000000000000e+01 40 39 2.5132741228718342e-06 2.5132741228718346e-06 -2.2204460492503131e-16 + 3.1500000000000000e+02 2.2500000000000000e+01 41 40 2.5132741228718358e-06 2.5132741228718342e-06 6.6613381477509392e-16 + 3.3750000000000000e+02 2.2500000000000000e+01 42 41 2.5132741228718363e-06 2.5132741228718358e-06 2.2204460492503131e-16 + 3.6000000000000000e+02 2.2500000000000000e+01 43 42 2.5132741228718299e-06 2.5132741228718363e-06 -2.4424906541753444e-15 + 3.8250000000000000e+02 2.2500000000000000e+01 44 43 2.5132741228718358e-06 2.5132741228718299e-06 2.3314683517128287e-15 + 4.0500000000000000e+02 2.2500000000000000e+01 45 44 2.5132741228718320e-06 2.5132741228718358e-06 -1.5543122344752192e-15 + 4.2750000000000000e+02 2.2500000000000000e+01 46 45 2.5132741228718274e-06 2.5132741228718320e-06 -1.7763568394002505e-15 + 4.5000000000000000e+02 2.2500000000000000e+01 47 46 2.5132741228718363e-06 2.5132741228718274e-06 3.5527136788005009e-15 + 4.7250000000000000e+02 2.2500000000000000e+01 48 47 2.5132741228718299e-06 2.5132741228718363e-06 -2.4424906541753444e-15 + 4.9500000000000000e+02 2.2500000000000000e+01 49 48 2.5132741228718358e-06 2.5132741228718299e-06 2.3314683517128287e-15 + 5.1750000000000000e+02 2.2500000000000000e+01 50 49 2.5132741228718367e-06 2.5132741228718358e-06 3.3306690738754696e-16 + 5.4000000000000000e+02 2.2500000000000000e+01 51 50 2.5132741228718337e-06 2.5132741228718367e-06 -1.1102230246251565e-15 + 5.6250000000000000e+02 2.2500000000000000e+01 52 51 2.5132741228718329e-06 2.5132741228718337e-06 -4.4408920985006262e-16 + 5.8500000000000000e+02 2.2500000000000000e+01 52 52 2.5132741228718312e-06 2.5132741228718329e-06 -6.6613381477509392e-16 + 6.0750000000000000e+02 2.2500000000000000e+01 53 52 2.5132741228718409e-06 2.5132741228718312e-06 3.8857805861880479e-15 + 6.3000000000000000e+02 2.2500000000000000e+01 54 53 2.5132741228718354e-06 2.5132741228718409e-06 -2.2204460492503131e-15 + 6.5250000000000000e+02 2.2500000000000000e+01 55 54 2.5132741228718388e-06 2.5132741228718354e-06 1.3322676295501878e-15 + 6.7500000000000000e+02 2.2500000000000000e+01 56 55 2.5132741228718371e-06 2.5132741228718388e-06 -6.6613381477509392e-16 + 6.9750000000000000e+02 2.2500000000000000e+01 56 56 2.5132741228718333e-06 2.5132741228718371e-06 -1.5543122344752192e-15 + 7.2000000000000000e+02 2.2500000000000000e+01 57 56 2.5132741228718375e-06 2.5132741228718333e-06 1.6653345369377348e-15 + 7.4250000000000000e+02 2.2500000000000000e+01 58 57 2.5132741228718358e-06 2.5132741228718375e-06 -6.6613381477509392e-16 + 7.6500000000000000e+02 2.2500000000000000e+01 58 58 2.5132741228718312e-06 2.5132741228718358e-06 -1.7763568394002505e-15 + 7.8750000000000000e+02 2.2500000000000000e+01 59 58 2.5132741228718443e-06 2.5132741228718312e-06 5.2180482157382357e-15 + 8.1000000000000000e+02 2.2500000000000000e+01 60 59 2.5132741228718401e-06 2.5132741228718443e-06 -1.7763568394002505e-15 + 8.3250000000000000e+02 2.2500000000000000e+01 60 60 2.5132741228718337e-06 2.5132741228718401e-06 -2.4424906541753444e-15 + 8.5500000000000000e+02 2.2500000000000000e+01 61 60 2.5132741228718384e-06 2.5132741228718337e-06 1.8873791418627661e-15 + 8.7750000000000000e+02 2.2500000000000000e+01 61 61 2.5132741228718375e-06 2.5132741228718384e-06 -4.4408920985006262e-16 + 9.0000000000000000e+02 2.2500000000000000e+01 62 61 2.5132741228718392e-06 2.5132741228718375e-06 6.6613381477509392e-16 + 9.2250000000000000e+02 2.2500000000000000e+01 63 62 2.5132741228718418e-06 2.5132741228718392e-06 9.9920072216264089e-16 + 9.4500000000000000e+02 2.2500000000000000e+01 63 63 2.5132741228718418e-06 2.5132741228718418e-06 0.0000000000000000e+00 + 9.6750000000000000e+02 2.2500000000000000e+01 64 63 2.5132741228718363e-06 2.5132741228718418e-06 -2.2204460492503131e-15 + 9.9000000000000000e+02 2.2500000000000000e+01 64 64 2.5132741228718388e-06 2.5132741228718363e-06 9.9920072216264089e-16 + 1.0125000000000000e+03 2.2500000000000000e+01 65 64 2.5132741228718333e-06 2.5132741228718388e-06 -2.2204460492503131e-15 + 1.0350000000000000e+03 2.2500000000000000e+01 65 65 2.5132741228718367e-06 2.5132741228718333e-06 1.3322676295501878e-15 + 1.0575000000000000e+03 2.2500000000000000e+01 66 65 2.5132741228718388e-06 2.5132741228718367e-06 8.8817841970012523e-16 + 1.0800000000000000e+03 2.2500000000000000e+01 66 66 2.5132741228718460e-06 2.5132741228718388e-06 2.8865798640254070e-15 + 1.1025000000000000e+03 2.2500000000000000e+01 67 66 2.5132741228718358e-06 2.5132741228718460e-06 -3.9968028886505635e-15 + 1.1250000000000000e+03 2.2500000000000000e+01 67 67 2.5132741228718325e-06 2.5132741228718358e-06 -1.3322676295501878e-15 + 1.1475000000000000e+03 2.2500000000000000e+01 68 67 2.5132741228718401e-06 2.5132741228718325e-06 2.9976021664879227e-15 + 1.1700000000000000e+03 2.2500000000000000e+01 68 68 2.5132741228718342e-06 2.5132741228718401e-06 -2.4424906541753444e-15 + 1.1925000000000000e+03 2.2500000000000000e+01 69 68 2.5132741228718333e-06 2.5132741228718342e-06 -4.4408920985006262e-16 + 1.2150000000000000e+03 2.2500000000000000e+01 69 69 2.5132741228718325e-06 2.5132741228718333e-06 -4.4408920985006262e-16 + 1.2375000000000000e+03 2.2500000000000000e+01 70 69 2.5132741228718312e-06 2.5132741228718325e-06 -4.4408920985006262e-16 + 1.2600000000000000e+03 2.2500000000000000e+01 70 70 2.5132741228718409e-06 2.5132741228718312e-06 3.8857805861880479e-15 + 1.2825000000000000e+03 2.2500000000000000e+01 71 70 2.5132741228718350e-06 2.5132741228718409e-06 -2.4424906541753444e-15 + 1.3050000000000000e+03 2.2500000000000000e+01 71 71 2.5132741228718384e-06 2.5132741228718350e-06 1.3322676295501878e-15 + 1.3275000000000000e+03 2.2500000000000000e+01 72 71 2.5132741228718350e-06 2.5132741228718384e-06 -1.3322676295501878e-15 + 1.3500000000000000e+03 2.2500000000000000e+01 72 72 2.5132741228718426e-06 2.5132741228718350e-06 2.9976021664879227e-15 + 1.3725000000000000e+03 2.2500000000000000e+01 73 72 2.5132741228718481e-06 2.5132741228718426e-06 2.2204460492503131e-15 + 1.3950000000000000e+03 2.2500000000000000e+01 73 73 2.5132741228718312e-06 2.5132741228718481e-06 -6.6613381477509392e-15 + 1.4175000000000000e+03 2.2500000000000000e+01 74 73 2.5132741228718439e-06 2.5132741228718312e-06 5.1070259132757201e-15 + 1.4400000000000000e+03 2.2500000000000000e+01 74 74 2.5132741228718308e-06 2.5132741228718439e-06 -5.3290705182007514e-15 + 1.4625000000000000e+03 2.2500000000000000e+01 75 74 2.5132741228718409e-06 2.5132741228718308e-06 3.9968028886505635e-15 + 1.4850000000000000e+03 2.2500000000000000e+01 75 75 2.5132741228718375e-06 2.5132741228718409e-06 -1.3322676295501878e-15 + 1.5075000000000000e+03 2.2500000000000000e+01 76 75 2.5132741228718354e-06 2.5132741228718375e-06 -8.8817841970012523e-16 + 1.5300000000000000e+03 2.2500000000000000e+01 76 76 2.5132741228718418e-06 2.5132741228718354e-06 2.5535129566378600e-15 + 1.5525000000000000e+03 2.2500000000000000e+01 77 76 2.5132741228718422e-06 2.5132741228718418e-06 2.2204460492503131e-16 + 1.5750000000000000e+03 2.2500000000000000e+01 77 77 2.5132741228718388e-06 2.5132741228718422e-06 -1.3322676295501878e-15 + 1.5975000000000000e+03 2.2500000000000000e+01 78 77 2.5132741228718401e-06 2.5132741228718388e-06 5.5511151231257827e-16 + 1.6200000000000000e+03 2.2500000000000000e+01 78 78 2.5132741228718295e-06 2.5132741228718401e-06 -4.2188474935755949e-15 + 1.6425000000000000e+03 2.2500000000000000e+01 79 78 2.5132741228718363e-06 2.5132741228718295e-06 2.6645352591003757e-15 + 1.6650000000000000e+03 2.2500000000000000e+01 80 79 2.5132741228718460e-06 2.5132741228718363e-06 3.8857805861880479e-15 + 1.6875000000000000e+03 2.2500000000000000e+01 80 80 2.5132741228718435e-06 2.5132741228718460e-06 -1.1102230246251565e-15 + 1.7100000000000000e+03 2.2500000000000000e+01 81 80 2.5132741228718312e-06 2.5132741228718435e-06 -4.8849813083506888e-15 + 1.7325000000000000e+03 2.2500000000000000e+01 82 81 2.5132741228718426e-06 2.5132741228718312e-06 4.5519144009631418e-15 + 1.7550000000000000e+03 2.2500000000000000e+01 82 82 2.5132741228718358e-06 2.5132741228718426e-06 -2.6645352591003757e-15 + 1.7775000000000000e+03 2.2500000000000000e+01 83 82 2.5132741228718337e-06 2.5132741228718358e-06 -8.8817841970012523e-16 + 1.8000000000000000e+03 2.2500000000000000e+01 84 83 2.5132741228718325e-06 2.5132741228718337e-06 -4.4408920985006262e-16 + 1.8225000000000000e+03 2.2500000000000000e+01 84 84 2.5132741228718384e-06 2.5132741228718325e-06 2.3314683517128287e-15 + 1.8450000000000000e+03 2.2500000000000000e+01 85 84 2.5132741228718371e-06 2.5132741228718384e-06 -4.4408920985006262e-16 + 1.8675000000000000e+03 2.2500000000000000e+01 86 85 2.5132741228718392e-06 2.5132741228718371e-06 8.8817841970012523e-16 + 1.8900000000000000e+03 2.2500000000000000e+01 87 86 2.5132741228718439e-06 2.5132741228718392e-06 1.8873791418627661e-15 + 1.9125000000000000e+03 2.2500000000000000e+01 87 87 2.5132741228718397e-06 2.5132741228718439e-06 -1.7763568394002505e-15 + 1.9350000000000000e+03 2.2500000000000000e+01 88 87 2.5132741228718452e-06 2.5132741228718397e-06 2.2204460492503131e-15 + 1.9575000000000000e+03 2.2500000000000000e+01 89 88 2.5132741228718524e-06 2.5132741228718452e-06 2.8865798640254070e-15 + 1.9800000000000000e+03 2.2500000000000000e+01 89 89 2.5132741228719485e-06 2.5132741228718524e-06 3.8302694349567901e-14 + 2.0025000000000000e+03 2.2500000000000000e+01 90 89 2.5132741228722780e-06 2.5132741228719485e-06 1.3111733920823099e-13 + 2.0250000000000000e+03 2.2500000000000000e+01 90 90 2.5132741228731678e-06 2.5132741228722780e-06 3.5405012255296242e-13 + 2.0475000000000000e+03 2.2500000000000000e+01 90 90 2.5132741228752388e-06 2.5132741228731678e-06 8.2400752887679118e-13 + 2.0700000000000000e+03 2.2500000000000000e+01 91 90 2.5132741228790111e-06 2.5132741228752388e-06 1.5009105069907491e-12 + 2.0925000000000000e+03 2.2500000000000000e+01 91 91 2.5132741228847794e-06 2.5132741228790111e-06 2.2951640588075861e-12 + 2.1150000000000000e+03 2.2500000000000000e+01 91 91 2.5132741228923874e-06 2.5132741228847794e-06 3.0271340989429518e-12 + 2.1375000000000000e+03 2.2500000000000000e+01 92 91 2.5132741229014168e-06 2.5132741228923874e-06 3.5926817076870066e-12 + 2.1600000000000000e+03 2.2500000000000000e+01 92 92 2.5132741229112906e-06 2.5132741229014168e-06 3.9286351949385789e-12 + 2.1825000000000000e+03 2.2500000000000000e+01 92 92 2.5132741229214614e-06 2.5132741229112906e-06 4.0467629247586956e-12 + 2.2050000000000000e+03 2.2500000000000000e+01 93 92 2.5132741229315064e-06 2.5132741229214614e-06 3.9968028886505635e-12 + 2.2275000000000000e+03 2.2500000000000000e+01 93 93 2.5132741229410698e-06 2.5132741229315064e-06 3.8051783946002615e-12 + 2.2500000000000000e+03 2.2500000000000000e+01 93 93 2.5132741229499979e-06 2.5132741229410698e-06 3.5523806118931134e-12 + 2.2725000000000000e+03 2.2500000000000000e+01 94 93 2.5132741229581621e-06 2.5132741229499979e-06 3.2484015477507455e-12 + 2.2950000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229655639e-06 2.5132741229581621e-06 2.9450886174231528e-12 + 2.3175000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229721906e-06 2.5132741229655639e-06 2.6366686611822843e-12 + 2.3400000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229781275e-06 2.5132741229721906e-06 2.3622215294949456e-12 + 2.3625000000000000e+03 2.2500000000000000e+01 94 94 2.5132741229834163e-06 2.5132741229781275e-06 2.1044277431769842e-12 + 2.3850000000000000e+03 2.2500000000000000e+01 95 94 2.5132741229881314e-06 2.5132741229834163e-06 1.8760548670115895e-12 + 2.4075000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229923492e-06 2.5132741229881314e-06 1.6782131240233866e-12 + 2.4300000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229961206e-06 2.5132741229923492e-06 1.5005774400833616e-12 + 2.4525000000000000e+03 2.2500000000000000e+01 95 95 2.5132741229995193e-06 2.5132741229961206e-06 1.3523626662959032e-12 + 2.4750000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230026143e-06 2.5132741229995193e-06 1.2314593789142236e-12 + 2.4975000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230054303e-06 2.5132741230026143e-06 1.1204370764517080e-12 + 2.5200000000000000e+03 2.2500000000000000e+01 95 95 2.5132741230080273e-06 2.5132741230054303e-06 1.0332845690186332e-12 + 2.5425000000000000e+03 2.2500000000000000e+01 96 95 2.5132741230104354e-06 2.5132741230080273e-06 9.5812247025151009e-13 + 2.5650000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230126737e-06 2.5132741230104354e-06 8.9062091035430058e-13 + 2.5875000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230147955e-06 2.5132741230126737e-06 8.4421358792496903e-13 + 2.6100000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230167979e-06 2.5132741230147955e-06 7.9669604247101233e-13 + 2.6325000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230187266e-06 2.5132741230167979e-06 7.6738615462090820e-13 + 2.6550000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230205676e-06 2.5132741230187266e-06 7.3252515164767829e-13 + 2.6775000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230223655e-06 2.5132741230205676e-06 7.1531669476598836e-13 + 2.7000000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230240993e-06 2.5132741230223655e-06 6.8989258750207227e-13 + 2.7225000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230257951e-06 2.5132741230240993e-06 6.7468253206470763e-13 + 2.7450000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230274502e-06 2.5132741230257951e-06 6.5858429820764286e-13 + 2.7675000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230290896e-06 2.5132741230274502e-06 6.5225602696727947e-13 + 2.7900000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230306893e-06 2.5132741230290896e-06 6.3649086001760224e-13 + 2.8125000000000000e+03 2.2500000000000000e+01 96 96 2.5132741230322694e-06 2.5132741230306893e-06 6.2871929884522615e-13 + 2.8350000000000000e+03 2.2500000000000000e+01 97 96 2.5132741230338343e-06 2.5132741230322694e-06 6.2261307220978779e-13 + 2.8575000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230353704e-06 2.5132741230338343e-06 6.1117777505614868e-13 + 2.8800000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230368866e-06 2.5132741230353704e-06 6.0329519158131006e-13 + 2.9025000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230383951e-06 2.5132741230368866e-06 6.0018656711235963e-13 + 2.9250000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230398728e-06 2.5132741230383951e-06 5.8797411384148290e-13 + 2.9475000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230413390e-06 2.5132741230398728e-06 5.8342219944051976e-13 + 2.9700000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230427751e-06 2.5132741230413390e-06 5.7143179077456807e-13 + 2.9925000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230441952e-06 2.5132741230427751e-06 5.6499249723174216e-13 + 3.0150000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230456021e-06 2.5132741230441952e-06 5.5977444901600393e-13 + 3.0375000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230469667e-06 2.5132741230456021e-06 5.4289905904170155e-13 + 3.0600000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230483313e-06 2.5132741230469667e-06 5.4289905904170155e-13 + 3.0825000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230496611e-06 2.5132741230483313e-06 5.2913229353634961e-13 + 3.1050000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230509753e-06 2.5132741230496611e-06 5.2291504459844873e-13 + 3.1275000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230522678e-06 2.5132741230509753e-06 5.1425530500637251e-13 + 3.1500000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230535502e-06 2.5132741230522678e-06 5.1025850211772195e-13 + 3.1725000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230548064e-06 2.5132741230535502e-06 4.9982240568624547e-13 + 3.1950000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230560384e-06 2.5132741230548064e-06 4.9016346537200661e-13 + 3.2175000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230572454e-06 2.5132741230560384e-06 4.8028248045284272e-13 + 3.2400000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230584389e-06 2.5132741230572454e-06 4.7484238763217945e-13 + 3.2625000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230596273e-06 2.5132741230584389e-06 4.7284398618785417e-13 + 3.2850000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230607962e-06 2.5132741230596273e-06 4.6507242501547807e-13 + 3.3075000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230619304e-06 2.5132741230607962e-06 4.5130565951012613e-13 + 3.3300000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230630633e-06 2.5132741230619304e-06 4.5075054799781356e-13 + 3.3525000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230641843e-06 2.5132741230630633e-06 4.4608761129438790e-13 + 3.3750000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230652753e-06 2.5132741230641843e-06 4.3409720262843621e-13 + 3.3975000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230663875e-06 2.5132741230652753e-06 4.4253489761558740e-13 + 3.4200000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230674598e-06 2.5132741230663875e-06 4.2665870836344766e-13 + 3.4425000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230685305e-06 2.5132741230674598e-06 4.2599257454867256e-13 + 3.4650000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230695787e-06 2.5132741230685305e-06 4.1711079035167131e-13 + 3.4875000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230706281e-06 2.5132741230695787e-06 4.1755487956152137e-13 + 3.5100000000000000e+03 2.2500000000000000e+01 97 97 2.5132741230716696e-06 2.5132741230706281e-06 4.1433523279010842e-13 + 3.5325000000000000e+03 2.2500000000000000e+01 98 97 2.5132741230726919e-06 2.5132741230716696e-06 4.0678571622265736e-13 + 3.5550000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230737181e-06 2.5132741230726919e-06 4.0834002845713258e-13 + 3.5775000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230747312e-06 2.5132741230737181e-06 4.0312198024139434e-13 + 3.6000000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230757379e-06 2.5132741230747312e-06 4.0056846728475648e-13 + 3.6225000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230767331e-06 2.5132741230757379e-06 3.9601655288379334e-13 + 3.6450000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230777246e-06 2.5132741230767331e-06 3.9446224064931812e-13 + 3.6675000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230787164e-06 2.5132741230777246e-06 3.9468428525424315e-13 + 3.6900000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230796927e-06 2.5132741230787164e-06 3.8846703631634227e-13 + 3.7125000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230806672e-06 2.5132741230796927e-06 3.8780090250156718e-13 + 3.7350000000000000e+03 2.2500000000000000e+01 98 98 2.5132741230816459e-06 2.5132741230806672e-06 3.8946623703850491e-13 From 051726c5fbb608dade7ce61425c7fa2a4183ee87 Mon Sep 17 00:00:00 2001 From: Patrick Mullen <33095288+pdmullen@users.noreply.github.com> Date: Thu, 18 Sep 2025 10:08:30 -0400 Subject: [PATCH 37/38] Update src/dust/coagulation/coagulation.hpp Co-authored-by: Adam M. Dempsey --- src/dust/coagulation/coagulation.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index a49547ee..836431d3 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -205,10 +205,10 @@ static void InitializeArray(const int nm, int &pgrid, const Real &rho_p, const R // Set fragmentation variables const Real ten_a = std::pow(10.0, a); const Real ten_ma = 1.0 / ten_a; - const int ce = int(-1.0 / a * std::log10(1.0 - ten_ma)) + 1; + const int ce = static_cast( std::floor(-1.0 / a * std::log10(1.0 - ten_ma))) + 1; // Used in integration - pgrid = floor(1.0 / a); + pgrid = static_cast(std::floor(1.0 / a)); // Initialization Part II const int iphifrag = coag2drv::phifrag; From 75f41a769d59f20e5c066d02ce815eb5fc474a77 Mon Sep 17 00:00:00 2001 From: Patrick Mullen <33095288+pdmullen@users.noreply.github.com> Date: Thu, 18 Sep 2025 10:08:50 -0400 Subject: [PATCH 38/38] Update src/dust/coagulation/coagulation.hpp Co-authored-by: Adam M. Dempsey --- src/dust/coagulation/coagulation.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dust/coagulation/coagulation.hpp b/src/dust/coagulation/coagulation.hpp index 836431d3..81e8c32e 100644 --- a/src/dust/coagulation/coagulation.hpp +++ b/src/dust/coagulation/coagulation.hpp @@ -214,7 +214,7 @@ static void InitializeArray(const int nm, int &pgrid, const Real &rho_p, const R const int iphifrag = coag2drv::phifrag; const int iepsfrag = coag2drv::epsfrag; const int iafrag = coag2drv::afrag; - const Real frag_slope = 2.0 - 11.0 / 6.0; + const Real frag_slope = 1.0/6.0; // = 2.0 - 11.0 / 6.0; parthenon::par_for( parthenon::loop_pattern_flatrange_tag, "initializeCoag2", parthenon::DevExecSpace(), 0, nm - 1, KOKKOS_LAMBDA(const int i) {