Skip to content

Commit

Permalink
refactor: setup eurec4a1D example with different boundary conditions
Browse files Browse the repository at this point in the history
- initialise 15260 out of 32768 superdroplets rather than 15260 out of 15260
- use AddSupersAtDomainTop not Null boundary conditions
  • Loading branch information
yoctoyotta1024 committed May 6, 2024
1 parent ceb3220 commit 48ed274
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 4 deletions.
18 changes: 17 additions & 1 deletion examples/eurec4a1d/src/config/eurec4a1d_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
domain:
nspacedims : 1 # no. of spatial dimensions to model
ngbxs : 60 # total number of Gbxs
maxnsupers: 15360 # maximum number of SDs
maxnsupers: 32768 # maximum number of SDs

timesteps:
CONDTSTEP : 0.1 # time between SD condensation [s]
Expand All @@ -44,6 +44,7 @@ inputfiles:
initsupers:
type: frombinary # type of initialisation of super-droplets
initsupers_filename : ./share/eurec4a1d_ddimlessSDsinit.dat # binary filename for initialisation of SDs
initnsupers: 15360 # initial no. of super-droplets to initialise

### Output Parameters ###
outputdata:
Expand All @@ -69,3 +70,18 @@ coupled_dynamics:
qvap : ./share/eurec4a1d_dimlessthermo_qvap.dat # binary filename for vapour mixing ratio
qcond : ./share/eurec4a1d_dimlessthermo_qcond.dat # binary filename for liquid mixing ratio
wvel : ./share/eurec4a1d_dimlessthermo_wvel.dat # binary filename for vertical (coord3) velocity

### Bounday Conditions Parameters ###
boundary_conditions:
type: addsupersatdomaintop
COORD3LIM: 800 # SDs added to domain with coord3 >= COORD3LIM [m]
newnsupers: 1024 # number SDs to add to each gridbox above COORD3LIM
DRYRADIUS: 1e-9 # dry radius of new super-droplets (for solute mass) [m]
MINRADIUS: 1e-8 # minimum radius of new super-droplets [m]
MAXRADIUS: 1e-4 # maximum radius of new super-droplets [m]
NUMCONC_a: 2e8 # number conc. of 1st droplet lognormal dist [m^-3]
GEOMEAN_a: 0.2e-6 # geometric mean radius of 1st lognormal dist [m]
geosigma_a: 2.3 # geometric standard deviation of 1st lognormal dist
NUMCONC_b: 4e8 # number conc. of 2nd droplet lognormal dist [m^-3]
GEOMEAN_b: 3.5e-6 # geometric mean radius of 2nd lognormal dist [m]
geosigma_b: 2.0 # geometric standard deviation of 2nd lognormal dist
10 changes: 7 additions & 3 deletions examples/eurec4a1d/src/main_eurec4a1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Author: Clara Bayley (CB)
* Additional Contributors:
* -----
* Last Modified: Friday 19th April 2024
* Last Modified: Saturday 4th May 2024
* Modified By: CB
* -----
* License: BSD 3-Clause "New" or "Revised" License
Expand All @@ -29,6 +29,7 @@
#include <stdexcept>
#include <string_view>

#include "cartesiandomain/add_supers_at_domain_top.hpp"
#include "cartesiandomain/cartesianmaps.hpp"
#include "cartesiandomain/cartesianmotion.hpp"
#include "cartesiandomain/createcartesianmaps.hpp"
Expand All @@ -38,6 +39,7 @@
#include "gridboxes/gridboxmaps.hpp"
#include "initialise/config.hpp"
#include "initialise/init_all_supers_from_binary.hpp"
#include "initialise/init_supers_from_binary.hpp"
#include "initialise/initgbxsnull.hpp"
#include "initialise/initialconditions.hpp"
#include "initialise/timesteps.hpp"
Expand Down Expand Up @@ -76,7 +78,8 @@ inline CoupledDynamics auto create_coupldyn(const Config &config, const Cartesia
}

inline InitialConditions auto create_initconds(const Config &config) {
const InitAllSupersFromBinary initsupers(config.get_initsupersfrombinary());
// const InitAllSupersFromBinary initsupers(config.get_initsupersfrombinary());
const InitSupersFromBinary initsupers(config.get_initsupersfrombinary());
const InitGbxsNull initgbxs(config.get_ngbxs());

return InitConds(initsupers, initgbxs);
Expand All @@ -94,7 +97,8 @@ inline auto create_movement(const Config &config, const Timesteps &tsteps,
const Motion<CartesianMaps> auto motion =
CartesianMotion(tsteps.get_motionstep(), &step2dimlesstime, terminalv);

const auto boundary_conditions = NullBoundaryConditions{};
// const auto boundary_conditions = NullBoundaryConditions{};
const auto boundary_conditions = AddSupersAtDomainTop(config.get_addsupersatdomaintop());

return MoveSupersInDomain(gbxmaps, motion, boundary_conditions);
}
Expand Down

0 comments on commit 48ed274

Please sign in to comment.