Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3D coupled deliverable #209

Merged
merged 142 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
5199bd3
Fix a CMake syntax error that meant the 'SOLVER_LIBS' list wasn't bei…
oparry-ukaea May 22, 2023
40e5b17
Skeleton for the Hermes-3 LAPD solver.
oparry-ukaea May 22, 2023
eda45d4
Rename solver source directory for consistency.
oparry-ukaea May 23, 2023
15bee2d
First attempt at a mesh for the H3LAPD problem - tries to match H3 re…
oparry-ukaea May 24, 2023
cd80756
A much lower res mesh for testing the H3LAPD solver.
oparry-ukaea May 24, 2023
36f0ce0
Add a convenience script for converting a .geo gmsh config to a Nekta…
oparry-ukaea Jun 6, 2023
262c630
First version of LAPD (low-res) config.
oparry-ukaea Jun 6, 2023
028b331
Add advection terms.
oparry-ukaea Jun 6, 2023
d9d808b
Add pressure gradient terms.
oparry-ukaea Jun 6, 2023
b21a6f1
Add E_perp terms.
oparry-ukaea Jun 6, 2023
011eadc
Reorder H3LAPDSystem variables and functions.
oparry-ukaea Jun 6, 2023
3e05d2c
Store perp velocities at class level to allow use in multiple terms.
oparry-ukaea Jun 2, 2023
168e5c4
Add collision terms to momentum equations and polarisation drift term…
oparry-ukaea Jun 2, 2023
89503aa
Add some comments and docstrings.
oparry-ukaea Jun 6, 2023
bb45911
Add explicit values to the low res config file, rather than relying o…
oparry-ukaea Jun 6, 2023
b550653
Added a note on initial conditions.
oparry-ukaea Jun 6, 2023
2652b8f
More flexible PrintArrVals
oparry-ukaea Jun 8, 2023
12edaec
Add density source term.
oparry-ukaea Jun 8, 2023
fd350c9
Label low, high z boundaries in config
oparry-ukaea Jun 8, 2023
78872f7
Initial guess at ICs.
oparry-ukaea Jun 8, 2023
54b6b47
Comment on the density source term
oparry-ukaea Jun 8, 2023
97875cf
Removed two places where Bvec=(0,0,B) and |Bvec| = 1 were assumed.
oparry-ukaea Jun 8, 2023
52129e7
Comments and cosmetic
oparry-ukaea Jun 8, 2023
1a76a4c
Fix domain cross section size in low, full res meshes.
oparry-ukaea Jun 8, 2023
e62e990
Phi solve attempt 1
oparry-ukaea Jun 9, 2023
a6354ac
Comments in config xml.
oparry-ukaea Jun 9, 2023
267d1a3
Set BCs.
oparry-ukaea Jun 9, 2023
d19735a
Fix typo in config comment.
oparry-ukaea Jun 27, 2023
2e68e00
Fix error in config - IterativeSolverTolerance can be in GLOBALSYSSOL…
oparry-ukaea Jun 27, 2023
6891a7b
Improvements to PrintArrVals debugging func.
oparry-ukaea Jun 27, 2023
4ef4274
Apply non-dimensionalisation factors to input params, BCs, ICs, densi…
oparry-ukaea Jun 27, 2023
f49467b
ne, w BCs to Dirichlet, since we don't expect Neumann to be supported…
oparry-ukaea Jun 27, 2023
fa2b0ef
Modified timestep, number of steps for consistency with H3 and to ref…
oparry-ukaea Jun 28, 2023
5beab9d
Calculate density-dependent Coulomb logarithm and collision frequency…
oparry-ukaea Jun 28, 2023
e173564
Rename a config file variable, for consistency, and explicitly includ…
oparry-ukaea Jun 28, 2023
17d35c3
Changed some variable and function names to clarify collision frequen…
oparry-ukaea Jun 28, 2023
8694db1
Correction to nu_ei calc (equations doc is wrong).
oparry-ukaea Jun 29, 2023
b9b954f
More readable expression for nu_ei_const.
oparry-ukaea Jun 29, 2023
c787101
Correct electric potential scaling factor; rearrange temperature scal…
oparry-ukaea Jul 3, 2023
55166c4
Rename temperature scaling param; avoids clash with time scaling fact…
oparry-ukaea Jul 3, 2023
1299038
Allow build dir to be supplied as a relative path in run_eg.sh
oparry-ukaea Jul 5, 2023
4e1548e
Correct m_u value.
oparry-ukaea Jul 5, 2023
e05cb1f
Different scaling approach; set B0 and derive ts, rather than vice ve…
oparry-ukaea Jul 5, 2023
ce0036c
Rename dimensionless density and velocity params to match Hermes 3 docs.
oparry-ukaea Jul 5, 2023
002beb9
Fix confusion between n_e and nRef in the phi solve.
oparry-ukaea Jul 5, 2023
4fe1b7b
Minor; xml formatting
oparry-ukaea Jul 7, 2023
8a1a0c9
Add an H3LAPD example that uses a cuboid mesh, works with PhiSolve().
oparry-ukaea Jul 7, 2023
e9473a9
Correct function misnomer - AddEPerpTerms => AddEParTerms.
oparry-ukaea Jul 7, 2023
1fbc52b
Correct misleading variable names.
oparry-ukaea Jul 7, 2023
7676336
Zero outarray.
oparry-ukaea Jul 21, 2023
eadae92
Correct a number of misnamed variables.
oparry-ukaea Jul 27, 2023
981945c
Implement density floor when computing parallel velocity.
oparry-ukaea Jul 27, 2023
08019de
Add convenience function to zero outarray.
oparry-ukaea Aug 2, 2023
236e9c9
Implement polarisation drift term via an advection object to properly…
oparry-ukaea Aug 4, 2023
7d8b781
Fix call to AddAdvTerms for polarisation drift term and add some erro…
oparry-ukaea Aug 4, 2023
7ed4ae8
Allow Helmsolve coefficients to be set by constant factors (not 'vari…
oparry-ukaea Aug 9, 2023
5dde97d
Make array arg of PrintArrSize const.
oparry-ukaea Aug 8, 2023
215fa51
Provide a virtual function to allow subclasses to define different RH…
oparry-ukaea Aug 9, 2023
da9b01a
Density source as separate function.
oparry-ukaea Aug 17, 2023
6aa283f
Added Ed's implementation of the 2D-in-3D Hasegawa-Wakatani equations.
oparry-ukaea Aug 23, 2023
16bfc09
Modified geo to xml script to allow output_basename != input_basename.
oparry-ukaea Aug 23, 2023
0e1a013
Renamed hw config xml to distinguish clearly from full LAPD config.
oparry-ukaea Aug 23, 2023
fe23b11
Strip LAPD-specific parameters from HW example and rename others for …
oparry-ukaea Aug 23, 2023
c5f1325
Modified H3LAPDSystem::CalcEAndAdvVels to avoid referencing momentum…
oparry-ukaea Aug 23, 2023
7fb7277
Remove unused momentum fields from HW example.
oparry-ukaea Aug 23, 2023
da33920
Remove unused class.
oparry-ukaea Aug 24, 2023
fa04333
Rename all .h extensions to .hpp.
oparry-ukaea Aug 24, 2023
0fb5423
Merge branch 'main' into feature/h3-lapd
oparry-ukaea Aug 24, 2023
39bddcc
Remove unused array of forcing objects.
oparry-ukaea Aug 24, 2023
0f3d9e5
Remove superfluous function in HW session file.
oparry-ukaea Aug 25, 2023
a7d15fa
Copy neutral_particles header from SimpleSOL and add particle system …
oparry-ukaea Aug 25, 2023
49a32e5
First go at adapting NeutralParticleSystem; no particle init yet.
oparry-ukaea Aug 25, 2023
6fc5b02
Add particle source to density field.
oparry-ukaea Aug 25, 2023
d411c28
Add background density via a session param.
oparry-ukaea Aug 29, 2023
2d2f05b
Reuse Te_eV param in particle system.
oparry-ukaea Aug 29, 2023
087321f
Fix get_point_in_subdomain() for 3D (#211)
will-saunders-ukaea Aug 31, 2023
49273eb
Add particle initialisation.
oparry-ukaea Sep 1, 2023
2b7a4e0
Merge branch 'main' into feature/3D-coupled-deliverable
oparry-ukaea Sep 1, 2023
ae602db
Reduce to 100 steps for debugging
oparry-ukaea Sep 1, 2023
381024c
track particle id offset between calls to add_particles
will-saunders-ukaea Sep 1, 2023
9ec2c5e
updated NESO-Particles submodule commit to include RNG updates
will-saunders-ukaea Sep 1, 2023
28febe6
Merge pull request #212 from ExCALIBUR-NEPTUNE/bugfix/3D-ids-rng
oparry-ukaea Sep 1, 2023
6a48f7b
Fix bug with assumed variable order.
oparry-ukaea Sep 1, 2023
8a7b463
Initialise ne, w, phi to zero.
oparry-ukaea Sep 1, 2023
4fd78df
Tweak params - makes it stable (ne doesn't NaN), but ionisation near …
oparry-ukaea Sep 1, 2023
51a56ae
added lower to higher order projection
will-saunders-ukaea Sep 11, 2023
a5aeb69
added drift velocity
will-saunders-ukaea Sep 12, 2023
2590487
tidy up of ionisation kernel
will-saunders-ukaea Sep 12, 2023
1c81971
removed ErrorPropagate instance that is dead code
will-saunders-ukaea Sep 12, 2023
8ae56e6
7 modes => 4 modes
oparry-ukaea Sep 13, 2023
2cc150c
Set a particle_drift_velocity in the session file.
oparry-ukaea Sep 13, 2023
80358d8
Tweak timestep, other params to get a stable example that demonstrate…
oparry-ukaea Sep 14, 2023
f1a0d2b
Increase mesh resolution slightly.
oparry-ukaea Sep 14, 2023
c8204d1
Typo.
oparry-ukaea Sep 14, 2023
8d58d69
Less particle output.
oparry-ukaea Sep 14, 2023
cd2e4e9
Set source width via a param.
oparry-ukaea Sep 14, 2023
3ec0322
Handle peralign args to NekMesh in geo_to_xml script.
oparry-ukaea Sep 14, 2023
efc98cb
Merge pull request #213 from ExCALIBUR-NEPTUNE/feature/3d-deliverable…
oparry-ukaea Sep 14, 2023
6016a31
Revert mesh extent, particle source width to more stable vals.
oparry-ukaea Sep 15, 2023
d3ecf2a
Increase particle_number_density to 1e16.
oparry-ukaea Sep 15, 2023
4ac361d
Reduce num_particles_total to 1e4
oparry-ukaea Sep 15, 2023
a0d57c1
Triple sim time limit.
oparry-ukaea Sep 15, 2023
260f839
Double sim length to try and see blob movement.
oparry-ukaea Sep 18, 2023
599eeb3
5 modes
oparry-ukaea Sep 18, 2023
1ef8f09
Fix a (non-critical) error in the geo_to_xml script and document the …
oparry-ukaea Sep 18, 2023
1480720
Make NeutralParticleSystem::integrate() behave when num_particles_tot…
oparry-ukaea Sep 18, 2023
4e622a9
Bugfix - actually apply the kappa value set in the input file.
oparry-ukaea Sep 20, 2023
c24caa8
num_particles_total back to 1e5, NUMMODES to 6.
oparry-ukaea Sep 20, 2023
065c373
Set alpha=0.1, kappa=10.
oparry-ukaea Sep 22, 2023
cf8a178
Restore Ed's example as 'hw_fluid-only'.
oparry-ukaea Sep 22, 2023
6d87060
Set alpha=0.1, kappa=10 in hw_fluid-only e.g.
oparry-ukaea Sep 22, 2023
8d6f13c
Tweak fluid-only e.g to get stable sim that produces turbulence. kap…
oparry-ukaea Oct 3, 2023
b7790ae
Make coupled sim's length, output times, and kappa value the same as …
oparry-ukaea Oct 3, 2023
ab35779
Automatically pick up RelWithDebInfo version of NekMesh in geo_to_xml…
oparry-ukaea Oct 3, 2023
913ecdf
Various tweaks to make it easier to run fluid-only sims, including re…
oparry-ukaea Oct 17, 2023
c50b400
Modify NektarSolverTest to allow solver name to be set independently …
oparry-ukaea Oct 9, 2023
437683a
Add test for growth rate of energy and enstrophy.
oparry-ukaea Oct 17, 2023
c45e2e7
Remove some debugging messages.
oparry-ukaea Oct 17, 2023
7154400
Rename 2D HW equation system, tests and examples in anticipation of 3…
oparry-ukaea Oct 18, 2023
2f7254b
Refactor equation system classes.
oparry-ukaea Oct 18, 2023
804eb5d
Fix gamma_alpha def in GrowthRatesRecorder.
oparry-ukaea Oct 19, 2023
713c763
Tweak E definition in GrowthRatesRecorder.
oparry-ukaea Oct 19, 2023
7c624c7
Modify growth rates test to give non-zero gamma_alpha (initial n != p…
oparry-ukaea Oct 19, 2023
aa9d740
Tighten up growth rate tolerances.
oparry-ukaea Oct 19, 2023
37506e7
var rename
oparry-ukaea Oct 19, 2023
d4ec0b1
Move a header.
oparry-ukaea Oct 19, 2023
4210275
Add a mass conservation test for the coupled 2Din3DHW solver (alpha=k…
oparry-ukaea Oct 20, 2023
7434824
Rename particle system source file.
oparry-ukaea Oct 20, 2023
62f0ff8
Set a more suitable namespace for all H3LAPD solver components.
oparry-ukaea Oct 23, 2023
ed3c3c6
Remove superfluous variables from GrowthRatesRecorder.
oparry-ukaea Oct 23, 2023
fc0e15f
Consistent variable naming, ordering and doxygen markup.
oparry-ukaea Oct 24, 2023
4b48d1f
Remove superfluous variable.
oparry-ukaea Oct 24, 2023
3ce9e8e
Make non-zero return code a fatal error in HW tests.
oparry-ukaea Oct 24, 2023
d040714
Various tweaks to geo_to_xml script. Added description and example us…
oparry-ukaea Oct 26, 2023
33ca442
Remove old Nektar licence headers from equation system source files a…
oparry-ukaea Oct 26, 2023
55bb201
Add some links to initial markdown for lapd e.g.
oparry-ukaea Oct 30, 2023
4e40bca
Assert that all required fields have the same number of quadrature po…
oparry-ukaea Oct 30, 2023
34b35f4
Changes to address various review comments.
oparry-ukaea Oct 30, 2023
8a12d4e
Handle B_xy = 0 correctly.
oparry-ukaea Oct 30, 2023
ef655bf
Update neso-particles to use NESOASSERT fix and modify some calls to …
oparry-ukaea Oct 31, 2023
6d53b49
Use NESOASSERT for NaN check.
oparry-ukaea Oct 31, 2023
a167c50
Small increase to mass conservation test tolerance.
oparry-ukaea Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ set(LIB_SRC_FILES
${SRC_DIR}/nektar_interface/basis_reference.cpp
${SRC_DIR}/nektar_interface/expansion_looping/jacobi_coeff_mod_basis.cpp
${SRC_DIR}/nektar_interface/function_evaluation.cpp
${SRC_DIR}/nektar_interface/geometry_transport/geometry_transport_2d.cpp
${SRC_DIR}/nektar_interface/geometry_transport/geometry_transport_3d.cpp
${SRC_DIR}/nektar_interface/geometry_transport/halo_extension.cpp
${SRC_DIR}/nektar_interface/particle_cell_mapping/map_particles_2d.cpp
Expand All @@ -114,7 +115,7 @@ set(LIB_SRC_FILES
${SRC_DIR}/run_info.cpp
${SRC_DIR}/simulation.cpp
${SRC_DIR}/species.cpp)

set(LIB_SRC_FILES_IGNORE ${SRC_DIR}/main.cpp)
check_file_list(${SRC_DIR} cpp "${LIB_SRC_FILES}" "${LIB_SRC_FILES_IGNORE}")

Expand Down
4 changes: 4 additions & 0 deletions examples/H3LAPD/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore xml files generated from .geos
cuboid*.xml
low_res.xml
full_res.xml
37 changes: 37 additions & 0 deletions examples/H3LAPD/2Din3D-hw/cuboid_periodic_8x8x16.geo
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//=============================== Parameters ==================================
// Lengths and resolutions in each dimension
xsize = 5;
ysize = 5;
zsize = 10;
nx = 8;
ny = 8;
nz = 16;
//=============================================================================

// Create a line in the x-direction of length <xsize>, with <nx> divisions
Point(1) = {-xsize/2, -ysize/2, 0, 0.01};
Point(2) = {xsize/2, -ysize/2, 0, 0.01};
Line(1) = {1, 2};
Transfinite Line(1) = nx+1;

// Extrude split line into meshed square/rectangle
sq = Extrude {0,ysize,0} {Curve{1}; Layers{ny}; Recombine;};

// Extrude square/rectangle into a cuboid
cbd = Extrude {0,0,zsize} {Surface{sq[1]}; Layers{nz}; Recombine;};

// Define physical volume, surfaces for BCs
// Domain
Physical Volume(0) = {cbd[1]};
// Low-x side
Physical Surface(1) = {cbd[5]};
// High-x side
Physical Surface(2) = {cbd[3]};
// Low-y side
Physical Surface(3) = {cbd[2]};
// High-y side
Physical Surface(4) = {cbd[4]};
// Low-z side
Physical Surface(5) = {sq[1]};
// High-z side
Physical Surface(6) = {cbd[0]};
128 changes: 128 additions & 0 deletions examples/H3LAPD/2Din3D-hw/hw.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8" ?>
<NEKTAR>

<COLLECTIONS DEFAULT="MatrixFree" />

<!--
The composite index for the domain is expected to be 0 if the mesh was generated from the included .geo file
-->
<EXPANSIONS>
<E COMPOSITE="C[0]" NUMMODES="6" TYPE="MODIFIED" FIELDS="ne,w,phi,ne_src" />
</EXPANSIONS>

<CONDITIONS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="2Din3DHW" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
</SOLVERINFO>

<GLOBALSYSSOLNINFO>
<V VAR="ne,w,phi,ne_src">
<I PROPERTY="GlobalSysSoln" VALUE="IterativeStaticCond" />
<I PROPERTY="IterativeSolverTolerance" VALUE="1e-6"/>
</V>
</GLOBALSYSSOLNINFO>

<PARAMETERS>
<!-- Timestepping and output options -->
<P> TimeStep = 0.000625 </P>
<P> NumSteps = 64000 </P>
<P> TFinal = NumSteps*TimeStep </P>
<P> IO_InfoSteps = NumSteps/1600 </P>
<P> IO_CheckSteps = NumSteps/160 </P>
<!-- Magnetic field strength -->
<P> Bxy = 1.0 </P>
<!-- d22 Coeff for Helmholtz solve -->
<P> d22 = 0.0 </P>
<!-- HW params -->
<!-- Dissipates density? -->
<P> HW_alpha = 0.1 </P>
<!-- Drives turbulence?-->
<P> HW_kappa = 3.5 </P>
<!-- Scaling factor for ICs -->
<P> s = 0.5 </P>
<!-- Neutral particle system params -->
<P> num_particles_per_cell = -1 </P>
<P> num_particle_steps_per_fluid_step = 1 </P>
<P> num_particles_total = 100000 </P>
<P> particle_num_write_particle_steps = IO_CheckSteps </P>
<P> particle_number_density = 1e16 </P>
<P> particle_position_seed = 1 </P>
<P> particle_thermal_velocity = 1.0 </P>
<P> particle_drift_velocity = 2.0 </P>
<P> particle_source_width = 0.2 </P>
<!-- Temperature in eV used to compute ionisation rate -->
<P> Te_eV = 10.0 </P>
<!-- Assumed background density in SI -->
<P> n_bg_SI = 1e18 </P>
<!-- Unit conversion factors for ionisation calc -->
<P> t_to_SI = 2e-4 </P>
<P> n_to_SI = 1e17 </P>
</PARAMETERS>

<VARIABLES>
<V ID="0"> ne </V>
<V ID="1"> w </V>
<V ID="2"> phi </V>
<V ID="3"> ne_src </V>
</VARIABLES>

<BOUNDARYREGIONS>
<B ID="0"> C[1] </B> <!-- Low x -->
<B ID="1"> C[2] </B> <!-- High x -->
<B ID="2"> C[3] </B> <!-- Low y -->
<B ID="3"> C[4] </B> <!-- High y -->
<B ID="4"> C[5] </B> <!-- Low-z end -->
<B ID="5"> C[6] </B> <!-- High-z end -->
</BOUNDARYREGIONS>

<!-- Periodic conditions for all fields on all boundaries -->
<BOUNDARYCONDITIONS>
<REGION REF="0">
<P VAR="ne" VALUE="[1]" />
<P VAR="w" VALUE="[1]" />
<P VAR="phi" VALUE="[1]" />
<P VAR="ne_src" VALUE="[1]" />
</REGION>
<REGION REF="1">
<P VAR="ne" VALUE="[0]" />
<P VAR="w" VALUE="[0]" />
<P VAR="phi" VALUE="[0]" />
<P VAR="ne_src" VALUE="[0]" />
</REGION>
<REGION REF="2">
<P VAR="ne" VALUE="[3]" />
<P VAR="w" VALUE="[3]" />
<P VAR="phi" VALUE="[3]" />
<P VAR="ne_src" VALUE="[3]" />
</REGION>
<REGION REF="3">
<P VAR="ne" VALUE="[2]" />
<P VAR="w" VALUE="[2]" />
<P VAR="phi" VALUE="[2]" />
<P VAR="ne_src" VALUE="[2]" />
</REGION>
<REGION REF="4">
<P VAR="ne" VALUE="[5]" />
<P VAR="w" VALUE="[5]" />
<P VAR="phi" VALUE="[5]" />
<P VAR="ne_src" VALUE="[5]" />
</REGION>
<REGION REF="5">
<P VAR="ne" VALUE="[4]" />
<P VAR="w" VALUE="[4]" />
<P VAR="phi" VALUE="[4]" />
<P VAR="ne_src" VALUE="[4]" />
</REGION>
</BOUNDARYCONDITIONS>
<FUNCTION NAME="InitialConditions">
<E VAR="ne" DOMAIN="0" VALUE="0" />
<E VAR="w" DOMAIN="0" VALUE="0" />
<E VAR="phi" DOMAIN="0" VALUE="0" />
<E VAR="ne_src" DOMAIN="0" VALUE="0.0" />
</FUNCTION>
</CONDITIONS>
</NEKTAR>
1 change: 1 addition & 0 deletions examples/H3LAPD/2Din3D-hw/run_cmd_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mpirun -np <NMPI> <SOLVER_EXEC> hw.xml cuboid.xml
37 changes: 37 additions & 0 deletions examples/H3LAPD/2Din3D-hw_fluid-only/cuboid_periodic_5x5x10.geo
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//=============================== Parameters ==================================
// Lengths and resolutions in each dimension
xsize = 5;
ysize = 5;
zsize = 10;
nx = 5;
ny = 5;
nz = 10;
//=============================================================================

// Create a line in the x-direction of length <xsize>, with <nx> divisions
Point(1) = {-xsize/2, -ysize/2, 0, 0.01};
Point(2) = {xsize/2, -ysize/2, 0, 0.01};
Line(1) = {1, 2};
Transfinite Line(1) = nx+1;

// Extrude split line into meshed square/rectangle
sq = Extrude {0,ysize,0} {Curve{1}; Layers{ny}; Recombine;};

// Extrude square/rectangle into a cuboid
cbd = Extrude {0,0,zsize} {Surface{sq[1]}; Layers{nz}; Recombine;};

// Define physical volume, surfaces for BCs
// Domain
Physical Volume(0) = {cbd[1]};
// Low-x side
Physical Surface(1) = {cbd[5]};
// High-x side
Physical Surface(2) = {cbd[3]};
// Low-y side
Physical Surface(3) = {cbd[2]};
// High-y side
Physical Surface(4) = {cbd[4]};
// Low-z side
Physical Surface(5) = {sq[1]};
// High-z side
Physical Surface(6) = {cbd[0]};
103 changes: 103 additions & 0 deletions examples/H3LAPD/2Din3D-hw_fluid-only/hw.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8" ?>
<NEKTAR>

<COLLECTIONS DEFAULT="MatrixFree" />

<!--
The composite index for the domain is expected to be 0 if the mesh was generated from the included .geo file
-->
<EXPANSIONS>
<E COMPOSITE="C[0]" NUMMODES="7" TYPE="MODIFIED" FIELDS="ne,w,phi" />
</EXPANSIONS>

<CONDITIONS>
<SOLVERINFO>
<I PROPERTY="EQTYPE" VALUE="2Din3DHW" />
<I PROPERTY="AdvectionType" VALUE="WeakDG" />
<I PROPERTY="Projection" VALUE="DisContinuous" />
<I PROPERTY="TimeIntegrationMethod" VALUE="ClassicalRungeKutta4" />
<I PROPERTY="UpwindType" VALUE="Upwind" />
</SOLVERINFO>

<GLOBALSYSSOLNINFO>
<V VAR="ne,w,phi,ne_src">
<I PROPERTY="GlobalSysSoln" VALUE="IterativeStaticCond" />
<I PROPERTY="IterativeSolverTolerance" VALUE="1e-6"/>
</V>
</GLOBALSYSSOLNINFO>

<PARAMETERS>
<!-- Timestepping and output options -->
<P> TimeStep = 0.00125 </P>
<P> NumSteps = 32000 </P>
<P> TFinal = NumSteps*TimeStep </P>
<P> IO_InfoSteps = NumSteps/1600 </P>
<P> IO_CheckSteps = NumSteps/160 </P>
<!-- Magnetic field strength -->
<P> Bxy = 1.0 </P>
<!-- d22 Coeff for Helmholtz solve -->
<P> d22 = 0.0 </P>
<!-- HW params -->
<P> HW_alpha = 0.1 </P>
<P> HW_kappa = 3.5 </P>
<!-- Scaling factor for ICs -->
<P> s = 0.5 </P>
<!-- No particles -->
<P> num_particles_total = 0 </P>
</PARAMETERS>

<VARIABLES>
<V ID="0"> ne </V>
<V ID="1"> w </V>
<V ID="2"> phi </V>
</VARIABLES>

<BOUNDARYREGIONS>
<B ID="0"> C[1] </B> <!-- Low x -->
<B ID="1"> C[2] </B> <!-- High x -->
<B ID="2"> C[3] </B> <!-- Low y -->
<B ID="3"> C[4] </B> <!-- High y -->
<B ID="4"> C[5] </B> <!-- Low-z end -->
<B ID="5"> C[6] </B> <!-- High-z end -->
</BOUNDARYREGIONS>

<!-- Periodic conditions for all fields on all boundaries -->
<BOUNDARYCONDITIONS>
<REGION REF="0">
<P VAR="ne" VALUE="[1]" />
<P VAR="w" VALUE="[1]" />
<P VAR="phi" VALUE="[1]" />
</REGION>
<REGION REF="1">
<P VAR="ne" VALUE="[0]" />
<P VAR="w" VALUE="[0]" />
<P VAR="phi" VALUE="[0]" />
</REGION>
<REGION REF="2">
<P VAR="ne" VALUE="[3]" />
<P VAR="w" VALUE="[3]" />
<P VAR="phi" VALUE="[3]" />
</REGION>
<REGION REF="3">
<P VAR="ne" VALUE="[2]" />
<P VAR="w" VALUE="[2]" />
<P VAR="phi" VALUE="[2]" />
</REGION>
<REGION REF="4">
<P VAR="ne" VALUE="[5]" />
<P VAR="w" VALUE="[5]" />
<P VAR="phi" VALUE="[5]" />
</REGION>
<REGION REF="5">
<P VAR="ne" VALUE="[4]" />
<P VAR="w" VALUE="[4]" />
<P VAR="phi" VALUE="[4]" />
</REGION>
</BOUNDARYCONDITIONS>
<FUNCTION NAME="InitialConditions">
<E VAR="ne" DOMAIN="0" VALUE="6*exp((-x*x-y*y)/(s*s))*sin(4*PI*z/10)" />
<E VAR="w" DOMAIN="0" VALUE="(4*exp((-x*x-y*y)/(s*s))*(-s*s+x*x+y*y)/s^4)*sin(4*PI*z/10)" />
<E VAR="phi" DOMAIN="0" VALUE="exp(-(x*x+y*y)/(s*s))*sin(4*PI*z/10)" />
</FUNCTION>
</CONDITIONS>
</NEKTAR>
1 change: 1 addition & 0 deletions examples/H3LAPD/2Din3D-hw_fluid-only/run_cmd_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mpirun -np <NMPI> <SOLVER_EXEC> hw.xml cuboid.xml
31 changes: 31 additions & 0 deletions examples/H3LAPD/cuboid/cuboid.geo
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//=============================== Parameters ==================================
// Lengths and resolutions in each dimension
xsize = 5;
ysize = 5;
zsize = 10;
nx = 5;
ny = 5;
nz = 10;
//=============================================================================

// Create a line in the x-direction of length <xsize>, with <nx> divisions
Point(1) = {-xsize/2, -ysize/2, 0, 0.01};
Point(2) = {xsize/2, -ysize/2, 0, 0.01};
Line(1) = {1, 2};
Transfinite Line(1) = nx+1;

// Extrude split line into meshed square
sq = Extrude {0,ysize,0} {Curve{1}; Layers{ny}; Recombine;};

// Extrude square into a cuboid
cbd = Extrude {0,0,zsize} {Surface{sq[1]}; Layers{nz}; Recombine;};

// Define physical volume, surfaces for BCs
// Domain
Physical Volume(0) = {cbd[1]};
// Long sides, parallel to z-axis
Physical Surface(1) = {cbd[2],cbd[3],cbd[4],cbd[5]};
// Low-z square
Physical Surface(2) = {sq[1]};
// High-z square
Physical Surface(3) = {cbd[0]};
Loading