2. Spilling breaker [NB:OUTDATED!!]

Download input files as ZIP archive here.

In this example ComFLOW is used to simulate an irregular wave on a 2D domain with a spilling breaker event.

<?xml version="1.0"?>

<!-- COMFLOW: This file was automatically generated by ComFLOW. Defaults are 
 substituted for missing settings. This file may require manual editing 
 before it can be used as simulation input. -->
 <comflow>

 <!-- SIMULATION: A brief description of the simulation -->
      <simulation title="wave test">
           <description>A CFD simulation</description>
      </simulation>

 <!-- OPTIONS: Basic simulation options -->
      <options free_surface="true" multi_phase="0"/>

 <!-- DOMAIN: Definition of computational domain -->
      <domain>
           <extents>-101. 307. -10. 10. -115. 41.</extents>
           <periodic>false false false</periodic>
           <symmetry>false false false false false false</symmetry>

      <!-- MOVING_FRAME: Moving reference frame -->
           <moving_frame type="simple" set_gravity_in_moving_frame="0" set_forces_in_moving_frame="0">
                <omega>0. 0. 0.</omega>
                <amplitude>0. 0. 0.</amplitude>
                <frequency>0. 0. 0.</frequency>
                <origin>0. 0. 0.</origin>
                <initial_position>0. 0. 0.</initial_position>
           </moving_frame>
      </domain>

 <!-- SHAPES: Geometric shapes that can be used for setup of geometry and 
      liquid. NB: shapes will only appear in the simulation if included in 
      geometry or liquid objects inside "/comflow/geometry/object[*]" or 
      "/comflow/initial_conditions/liquid/object[*]" -->
      <shapes/>

 <!-- GEOMETRY: Geometry setup: actual definition of objects -->
      <geometry exclude_exterior="false" integration_points="3" method="legacy" apply_cutoff="true" read_apertures="true" use_aabb_tree="true" use_moving_markers="false" open_up_io_boundaries="true">
           <domain_walls>false false false false false false</domain_walls>
           <object name="geo_fixed" moves_according_to="*">
                <file_reader geodef_legacy_file="xml://geometry.in" filter="only_fixed"/>
           </object>
           <object name="geo_movingobject1" moves_according_to="*">
                <file_reader geodef_legacy_file="xml://geometry.in" filter="only_moving"/>
           </object>
      </geometry>

 <!-- WAVES: Definition of incoming/initial wave field and current -->
      <waves start_with_still_water="false" initialize_fs="true" mean_depth="90.">

      <!-- MODEL: Definition of wave model -->
           <model model="none" period="8." length="0." height="0." angle="0." location_of_crest="0." order="10" dispersion_mode="calculate_k" standing="false" surface_tension="true"/>

      <!-- CURRENT: Current -->
           <current magnitude="0." angle="NaN"/>

      <!-- RAMPING: Ramping for smooth startup of a simulation -->
           <ramping ramptype="1" rampfs="1" ramp1="1." ramp2="0."/>
      </waves>

 <!-- INITIAL_CONDITIONS: Initial conditions of the simulation -->
      <initial_conditions>

      <!-- LIQUID: Settings for initial liquid configuration which can be defined 
           by a <box> and/or an <object> element -->
           <liquid/>

      <!-- GREENWATER: Settings for initial greenwater configuration -->
           <greenwater mode="0" high="0." low="0." length="0." width="0." a="0." b="0."/>
      </initial_conditions>

 <!-- TIME: Time parameters and time integration settings -->
      <time tmax="70." tcyclemax="Inf" dt="2.5E-002" dtmin="0." dtmax="2.5E-002" dtfact="0.5" fixed="false" tmaxexact="true" customdt="false">

      <!-- CFL_FLOW: time step control based on a flow CFL criterion -->
           <cfl_flow enable="true" min="0.5" max="0.9"/>

      <!-- CFL_WAVE: time step control based on a wave CFL criterion -->
           <cfl_wave enable="true" min="0." max="1."/>

      <!-- INTEGRATION_METHOD: Time integration method -->
           <integration_method feab1="1." feab2="0." ab_beta="10000." ddta="1." ddtb="0." ddtd="1."/>
      </time>

 <!-- BOUNDARIES: Setup of boundary conditions -->
      <boundaries>
           <freeslip>false false false false false false</freeslip>
           <forcing>0. 0. 0.</forcing>
           <boundary io="52" spec="0." tstart="0." tfull="0.">-101. -101. -Inf Inf -Inf Inf</boundary>
           <boundary io="11" spec="0." tstart="0." tfull="0.">307. 307. -Inf Inf -Inf Inf</boundary>

      <!-- GABC: Parameters for the (generating-)absorbing boundary condition (G)ABC -->
           <gabc a0="1.386" a1="0.141" b1="0.453" kh1="8.64" kh2="5." alpha1="0." alpha2="0." order="1" auto_tune="false"/>

      <!-- WALLS: Diffusion, wall modeling and partial slip settings -->
           <walls wallmodel="none" diffusion="ls_stag" psl="0." pscnf="0"/>
      </boundaries>

 <!-- PHYSICAL: Physical parameters -->
      <physical atmospheric_pressure="100000.">

      <!-- LIQUID_PHASE: Properties of the liquid phase (phase 1) -->
           <liquid_phase density="1025." viscosity="1.E-003"/>

      <!-- GAS_PHASE: Properties of the gas phase (phase 2) -->
           <gas_phase density="1." viscosity="1.7E-005" gamma="1.4"/>

      <!-- SURFACE_TENSION: Surface tension properties -->
           <surface_tension sigma="0." theta="90."/>
           <gravitation>0. 0. -9.81</gravitation>
      </physical>

 <!-- TURBULENCE: Turbulence modeling options -->
      <turbulence model="none"/>

 <!-- GRID: Grid and local refinement setup -->
      <grid globalrefine="1" all_blocks="false">
           <dimension>204 1 78</dimension>
           <blocksize>6 1 6</blocksize>
           <refinement>2 2 2</refinement>

      <!-- COORDINATES: Coordinates of the base grid (level 0) -->
           <coordinates griddef="legacy_comflow_in">

           <!-- CUSTOM: Custom grid from (embedded) file -->
                <custom file="*" format="with_dimensions"/>

           <!-- STRETCHED_GRID: Simple stretched grid setup -->
                <stretched_grid>
                     <center>0.5 0. 0.</center>
                     <stretch>1. 1. 1.</stretch>
                </stretched_grid>
           </coordinates>

      <!-- SUBGRIDS: Definition of subgrids for local grid refinement -->
           <subgrids>
                <subgrid active="true" everywhere="true" level="-1" persistent="false"/>
                <subgrid active="true" everywhere="false" level="0" persistent="false">-Inf Inf -Inf Inf -30. 35.</subgrid>
                <subgrid active="true" everywhere="false" level="1" persistent="false">-Inf Inf -Inf Inf -20. 25.</subgrid>
           </subgrids>

      <!-- ADAPTIVITY: Adaptive grid refinement -->
           <adaptivity maximum_level="1" enable="true">
               <criterion type="surface" level="1" threshold="0.05"/>
           </adaptivity>
      </grid>

 <!-- COUPLING: Settings for coupling to a.o. moving objects (prescribed and 
      interactive motions), XMF mooring module, external solutions (e.g. other 
      ComFLOW simulations), ... -->
      <coupling>

      <!-- XMF_MOORING: Settings for coupling to the XMF mooring module -->
           <xmf_mooring xmf_mooring="false"/>

      <!-- EXTERNAL_SOLUTION: Settings for coupling to a shared library -->
           <external_solution specialbc_dllfile="linearwavesuperposition" specialbc_impose="false" specialbc_initialize="true" specialbc_ramp="false"/>

      <!-- MOVING_OBJECTS: Setup of object motions and interaction -->
           <moving_objects interaction_method="under_relaxation"/>
      </coupling>

 <!-- NUMERICAL: Setup of the discretization method and linear solver -->
      <numerical imptol="1.E-003">

      <!-- LINEAR_SOLVER: Settings for the linear solver -->
           <linear_solver solver_choice="bicgstab_ilu" verbosity="0">

           <!-- ILU_PRECONDITIONER: Settings for the ILU preconditioner (only used by 
                the BiCGSTAB solver) -->
                <ilu_preconditioner droptol_p="1.E-002" droptol_uvw="1.E-002" droptol_gabc="1.E-006"/>

           <!-- RELAXATION: Over-relaxation settings (only used by the SOR solver) -->
                <relaxation omega="1.0001"/>

           <!-- STOPPING_CRITERION: Stopping criterion and maximum number of iterations -->
                <stopping_criterion inner_p="1.E-010" inner_uvw="-1." outer_p="1.E-014" outer_uvw="-1." iter_max="10000"/>
           </linear_solver>

      <!-- VOF: Settings for the Volume-of-Fluid method -->
           <vof method="PLIC_VOF" correction="basic" advection="MACHO" plic_scheme="PLIC/Youngs" divl="0"/>

      <!-- CONVECTION: Settings for the discretization of convection -->
           <convection artificial_diffusion="1." scheme="b2" limiter="false"/>

      <!-- STEADYSTATE: Options for steady-state calculations -->
           <steadystate/>

      <!-- LIMITS: Hard limits on velocities (e.g. in 2-phase flow) -->
           <limits truncate_velocities_at="150."/>

      <!-- INTERPOLATIONS: Settings for reconstruction of velocities (1-phase) / 
           densities (2-phase) at the free surface -->
           <interpolations velocity_extrapolation="constant" pressure_extrapolation="linear" surface_irrotationality="false" density_averaging="gravity_consistent"/>
      </numerical>

 <!-- PARALLEL: Parallelization settings (note: it is recommended to use 
      command line options instead) -->
      <parallel redblack="false" withomp="false" sequential_sor="false" sequential_bicgstab="false" sequential_momentum="false" enable_profiler="true" domains_per_thread="1"/>

 <!-- OUTPUT: Settings for post-processing output -->
      <output compression="none" precision="single">

           <commoi dt="NaN" nr="0" tmin="-Inf" tmax="Inf"/>

           <criterion dt="NaN" nr="0" tmin="-Inf" tmax="Inf"/>

           <matrix dt="NaN" nr="0" tmin="-Inf" tmax="Inf"/>

      <!-- PRINT: Output interval for time step summaries -->
           <print dt="0.25" nr="0" tmin="-Inf" tmax="Inf"/>

      <!-- PROFILING: Output interval for profiling information -->
           <profiling dt="NaN" nr="0" tmin="-Inf" tmax="Inf"/>

      <!-- VARIABLES: Extra output of grid variables in snapshots -->
           <variables/>

      <!-- VTK: Output interval for binary VTK-XML snapshot files -->
           <vtk dt="0.5" nr="0" tmin="-Inf" tmax="Inf"/>

      <!-- BOXES: Setup of observation boxes -->
           <boxes/>

      <!-- MONITORING: Setup of monitoring objects -->
           <monitoring/>

           <particles/>

      <!-- RELATIVE_WATER_HEIGHT: Definition of relative water height lines -->
           <relative_water_height>
               <line dt="0.0"> 50.  50. 0. 0. -30. 30. </line>
               <line dt="0.0">100. 100. 0. 0. -30. 30. </line>
               <line dt="0.0">150. 150. 0. 0. -30. 30. </line>
               <line dt="0.0">200. 200. 0. 0. -30. 30. </line>
               <line dt="0.0">250. 250. 0. 0. -30. 30. </line>
           </relative_water_height>

      <!-- SPECIAL: Setup of high-frequency special box output -->
           <special/>
      </output>

 <!-- RESTART: Settings for checkpoints and restarts -->
      <restart reset_counters="false" load="false" dt="NaN" nr="0" tmin="-Inf" tmax="Inf"/>

 <!-- DEBUG: Developer options -->
      <debug debugmode="false" debuglabfs="false" divergence="false" debugexactsolution="false" withconvection="1." force_inline_velbc="false" keep_ee_labels="false" force_init_new_momentum="false" idbg="-1000" jdbg="-1000" kdbg="-1000" ldbg="-1000">

           <symmetry_check threshold="1.E-005" absolute="true" uniformity="false" fix="false">0 0 0</symmetry_check>

           <vof vofdbg_info="false" vofdbg_outofloopcheck="false" vofdbg_liqpct="false" vofdbg_sumfsk="false" vofdbg_snaps="false" vofdbg_pause="false" vofdbg_dump="false" vofdbg_monitor="false" vofdbg_allmonitor="false" vofdbg_print="false" voffix="false"/>
      </debug>

 <!-- TESTCASE: Built-in testcases -->
      <testcase exactapertures="false" flow_period="0." impose="0" type="0" velocity="0." thetaflow="0." phiflow="0." plane="0" tstart="0." tfull="0.">
           <center>0. 0. 0.</center>
      </testcase>

 <!-- RESEARCH: Research options (use at own risk) -->
      <research flags="0" lgr_with_e_cells="true" sqcyl_disturbance_u="0." hfmax="2"/>

 <!-- FILES: Embedded files. These files can be referenced elsewhere by using 
      "xml://$filename". For ASCII files it is recommended to use 
      encoding="cdata"; for binary files it is recommended to use 
      encoding="base64". -->
      <files>
           <file name="geometry.in" trim="true" encoding="cdata">
<![CDATA[

]]>
           </file>
      </files></comflow>
; MODEL 1: LINEAR SUPERPOSITION W/ EXTRAPOLATION AT FREE SURFACE
om_cutoff = 2.0
wd = 115.0
componentsfile=${INPUT}/components.in
   127
   0.27965    0.06274   -0.37818
   0.50956    0.12547    2.00028
   0.30514    0.18821   -3.42244
   0.81656    0.25094   -0.93713
   2.11012    0.31368   -1.32605
   6.14684    0.37641    0.56363
   7.59716    0.43915   -3.59918
   3.24425    0.50189   -0.10402
   0.87410    0.56462   -2.84143
   0.42244    0.62736   -3.60548
   1.01702    0.69009   -3.31476
   0.45363    0.75283   -6.02112
   0.26867    0.81556   -5.33883
   0.50725    0.87830   -7.87558
   0.31402    0.94104  -11.06370
   0.51657    1.00377  -11.83251
   0.45981    1.06651  -11.44028
   0.21644    1.12924  -10.22902
   0.14102    1.19198  -12.09660
   0.18325    1.25471  -15.62191
   0.05086    1.31745  -15.19736
   0.20983    1.38018  -21.89442
   0.19753    1.44292  -21.81007
   0.13707    1.50566  -23.10238
   0.03706    1.56839  -28.07729
   0.18052    1.63113  -29.64146
   0.03728    1.69386  -29.49961
   0.11875    1.75660  -29.75235
   0.02071    1.81933  -36.92489
   0.04503    1.88207  -36.34227
   0.03227    1.94481  -36.96779
   0.08853    2.00754  -42.13743
   0.07798    2.07028  -41.83655
   0.06732    2.13301  -47.81916
   0.02489    2.19575  -47.22373
   0.04583    2.25848  -54.93979
   0.06096    2.32122  -54.81498
   0.05393    2.38396  -61.48891
   0.03579    2.44669  -61.99101
   0.01921    2.50943  -66.96868
   0.02180    2.57216  -67.27626
   0.03341    2.63490  -73.43820
   0.03066    2.69763  -73.42508
   0.01826    2.76037  -79.49898
   0.02823    2.82311  -80.74334
   0.02309    2.88584  -85.95024
   0.05245    2.94858  -86.83201
   0.00200    3.01131  -90.26924
   0.04801    3.07405  -99.20329
   0.00786    3.13678  -99.66902
   0.05378    3.19952 -105.42040
   0.01027    3.26225 -108.74557
   0.05640    3.32499 -111.40846
   0.00779    3.38773 -120.19756
   0.06023    3.45046 -124.05499
   0.01245    3.51320 -126.06867
   0.06544    3.57593 -130.19554
   0.02927    3.63867 -138.34314
   0.04801    3.70140 -142.56237
   0.02183    3.76414 -144.82467
   0.04729    3.82688 -148.61477
   0.02316    3.88961 -156.68401
   0.03547    3.95235 -161.25296
   0.02950    4.01508 -163.42713
   0.03778    4.07782 -173.42576
   0.02956    4.14055 -175.85238
   0.03032    4.20329 -179.49970
   0.02860    4.26603 -188.17942
   0.02639    4.32876 -191.79709
   0.03101    4.39150 -200.93775
   0.03156    4.45423 -204.37237
   0.02639    4.51697 -207.29627
   0.01995    4.57970 -216.80539
   0.02482    4.64244 -219.40346
   0.02111    4.70518 -228.73112
   0.02227    4.76791 -232.00413
   0.02168    4.83065 -241.20464
   0.02292    4.89338 -244.08171
   0.02197    4.95612 -253.41767
   0.02225    5.01885 -256.67937
   0.02067    5.08159 -265.77729
   0.02726    5.14432 -275.07578
   0.02131    5.20706 -278.23009
   0.02325    5.26980 -287.70512
   0.01423    5.33253 -291.03485
   0.01717    5.39527 -300.11029
   0.01226    5.45800 -308.89631
   0.02813    5.52074 -312.38727
   0.01280    5.58347 -321.66370
   0.02546    5.64621 -331.17217
   0.01051    5.70895 -333.54226
   0.02575    5.77168 -343.68438
   0.00937    5.83442 -351.74526
   0.02716    5.89715 -356.12431
   0.00945    5.95989 -363.85858
   0.02293    6.02262 -374.61695
   0.01712    6.08536 -382.90977
   0.02345    6.14810 -387.33964
   0.01695    6.21083 -395.00881
   0.01999    6.27357 -406.16890
   0.01848    6.33630 -413.65459
   0.01637    6.39904 -418.66889
   0.01690    6.46177 -432.50635
   0.01502    6.52451 -437.77971
   0.01762    6.58725 -444.81592
   0.01500    6.64998 -456.74750
   0.01559    6.71272 -463.49024
   0.01200    6.77545 -469.54828
   0.01559    6.83819 -482.22886
   0.00972    6.90092 -488.09184
   0.01310    6.96366 -501.22537
   0.01538    7.02639 -507.27434
   0.01336    7.08913 -519.94566
   0.01230    7.15187 -526.14131
   0.01184    7.21460 -538.74892
   0.01138    7.27734 -544.84910
   0.01336    7.34007 -557.63860
   0.01374    7.40281 -563.91279
   0.01441    7.46554 -576.40710
   0.01082    7.52828 -582.50101
   0.01249    7.59102 -595.13768
   0.00823    7.65375 -601.72805
   0.01479    7.71649 -614.01878
   0.01069    7.77922 -620.70233
   0.01489    7.84196 -632.69158
   0.00941    7.90469 -645.85569
   0.01440    7.96743 -651.41793