<?xml version="1.0" encoding="UTF-8" ?>
<case>
    <casedef>
        <constantsdef>                        
            <gravity x="0" y="0" z="-9.81" comment="Gravitational acceleration" units_comment="m/s^2" />
            <rhop0 value="1000" comment="Reference density of the fluid" units_comment="kg/m^3" />
            <hswl value="0" auto="true" comment="Maximum still water level to calculate speedofsound using coefsound" units_comment="metres (m)" />
            <gamma value="7" comment="Polytropic constant for water used in the state equation" />
            <speedsystem value="0" auto="true" comment="Maximum system speed (by default the dam-break propagation is used)" />
            <coefsound value="20" comment="Coefficient to multiply speedsystem" />
            <speedsound value="0" auto="true" comment="Speed of sound to use in the simulation (by default speedofsound=coefsound*speedsystem)" />
            <coefh value="1.2" comment="Coefficient to calculate the smoothing length (h=coefh*sqrt(3*dp^2) in 3D)" />            
            <cflnumber value="0.2" comment="Coefficient to multiply dt" />    
        </constantsdef>    
        <mkconfig boundcount="230" fluidcount="9">
            <mkorientfluid mk="0" orient="Xyz" />
        </mkconfig>
        <geometry>
            <definition dp="0.01" units_comment="metres (m)">
                <!-- <pointmin x="-5.5" y="0" z="-0.5" /> -->
                <!-- <pointmax x="10" y="0" z="0.75" /> -->
                <pointmin x="-5.5" y="-0.55" z="-0.5" />
                <pointmax x="10" y="0.55" z="0.75" />                
            </definition>
            <commands>
                <mainlist>
                    <setshapemode>real | dp | bound</setshapemode>
                    <setdrawmode mode="full" />
                    <setmkbound mk="50" />
                    <drawbox>
                        <boxfill>solid</boxfill>
                        <point x="-2" y="-0.10" z="-0.0786" />
                        <size x="0.20" y="0.20" z="0.132" />
                    </drawbox>
					<setmkbound mk="51" />
                    <drawbox>
                        <boxfill>solid</boxfill>
                        <point x="1.5" y="-0.10" z="-0.0786" />
                        <size x="0.20" y="0.20" z="0.132" />
                    </drawbox>
                    <setmkbound mk="10" />
                    <drawbox>
                        <boxfill>solid</boxfill>
                        <point x="-4.01" y="-0.5" z="-0.5" />
                        <size x="0.01" y="1" z="1.0" />
                    </drawbox>                    
                    <setmkbound mk="0" />
                    <drawprism mask="1  | 2 | 7 | 8 | 9">
                        <point x="10" y="-0.5" z="0.75" />                           
                        <point x="3" y="-0.5" z="-0.25" />
                        <point x="0" y="-0.5" z="-0.25" />
                        <point x="0" y="-0.5" z="-0.5" />                             
                        <point x="-4" y="-0.5" z="-0.5" />    
                        <point x="-4" y="-0.5" z="0.75" />    
                        <point x="10" y="0.5" z="0.75" />
                        <point x="3" y="-0.5" z="-0.25" />                           
                        <point x="0" y="0.5" z="-0.25" />
                        <point x="0" y="0.5" z="-0.5" />                            
                        <point x="-4" y="0.5" z="-0.5" />    
                        <point x="-4" y="0.5" z="0.75" />    
                    </drawprism>                    
                    <setmkfluid mk="0" />
                    <fillbox x="-1" y="0" z="-0.1">
                        <modefill>void</modefill>
                        <point x="-4" y="-0.5" z="-0.5" />
                        <size x="10" y="1" z="0.75" />
                    </fillbox>
                    <shapeout file="" reset="true" />
                </mainlist>
            </commands>
        </geometry>
       <floatings>
            <floating mkbound="50">
                <massbody value="3.163" />
                <center x="-1.9 " y="0" z="-0.0126" />                   
                <_inertia x="1506420" y="1506420" z="2098670" />
            </floating>
			  <floating mkbound="51">
                <massbody value="3.163" />
                <center x="1.6" y="0" z="-0.0126" />                   
                <_inertia x="1506420" y="1506420" z="2098670" />
            </floating>
        </floatings>
        <motion>
            <objreal ref="10">
                <begin mov="1" start="0" />
                <mvnull id="1" />
            </objreal>
        </motion>
    </casedef>
    <execution>
        <special>
            <wavepaddles>
                <piston>
                    <mkbound value="10" comment="Mk-Bound of selected particles" />
                    <waveorder value="2" comment="Order wave generation 1:1st order, 2:2nd order (def=1)" />
                    <start value="0" comment="Start time (def=0)" />
                    <duration value="0" comment="Movement duration, Zero is the end of simulation (def=0)" />
                    <depth value="0.5" comment="Fluid depth (def=0)" />
                    <pistondir x="1" y="0" z="0" comment="Movement direction (def=(1,0,0))" />
                    <waveheight value="0.12" comment="Wave height" />
                    <waveperiod value="1.6" comment="Wave period" />
                    <phase value="0" comment="Initial wave phase in function of PI (def=0)" />
                    <ramp value="1" comment="Periods of ramp (def=0)" />
                </piston>
            </wavepaddles>
			<moorings>
				<savevtk_moorings value="true" comment="Saves vtk with moorings (default=true)" />
				<savecsv_points value="true" comment="Saves csv with link points (default=true)" />
				<savevtk_points value="false" comment="Saves vtk with link points (default=false)" />
				<mooredfloatings>
					<floating mkbound="50" comment="Mkbound of the Floating body the mooring is linked to" />
					<floating mkbound="51" comment="Mkbound of the Floating body the mooring is linked to" />
				</mooredfloatings>
			<!-- <moordyn file="moordyn.xml" />  % Loads the configuration of the file indicates in attrtibute "file"  -->
				<moordyn comment="MoorDyn configuration"> %Loads the next configuration
					<solverOptions>
						<waterDepth value="0.25" comment="Water depth" units_comment="m"/>
						<freesurface value="0" comment="Z position of the water free surface.(default=0)" />
						<kBot value="3.0e6" comment="Bottom stiffness constant. (default=3.0e6)" units_comment="Pa/m"/>
						<cBot value="3.0e5" comment="Bottom damping constant. (default=3.0e5)"  units_comment="Pa*s/m" />
						<dtM value="0.00002" comment="time step to use in mooring integration. (default=0.001)"/> 
						<waveKin value="0" comment="Wave kinematics flag ( 0: neglect [the only option currently supported] ). (default=0)"/>
						<writeUnits value="yes" comment="Write units line. value=[yes|no]. (default=yes)"/>
						<frictionCoefficient value="0" comment="General bottom friction coefficient, as a start. (default=0.0)"/>
						<fricDamp value="200" comment="Damping coefficient used to model the friction with speeds near zero. (default=200.0)"/>
						<statDynFricScale value="1.0" comment="Ratio between static and dynamic friction (mu_static/mu_dynamic). (default=1.0)"/>    
						<dtIC value="1.0" comment="Period to analyse convergence of dynamic relaxation for initial conditions. (default=1.0)" units_comment="s"/>
						<cdScaleIC value="2" comment="Factor to scale drag coefficients during dynamic relaxation for initial conditions. (default=5)"/>    
						<threshIC value="0.001" comment="Convergence threshold for for initial conditions. (default=0.001)"/>
						<tmaxIC value="2" comment="Maximum time for initial conditions without convergence.(default=0)" units_comment="s"/>
					</solverOptions>
					<bodies>
						<body ref="50" comment="Floating driven structure to attach mooring lines.">
                                                                                                                <depth value="0.9" comment="Water depth for current object. This value overwrites the global water depth only for its lines." units_comment="m"/>
						</body>
						<body ref="51" comment="Floating driven structure to attach mooring lines."/>
					</bodies>
					<lines>
						<linedefault comment="Shared properties for each line.">
							<ea value="2.9e1" comment="Line stiffness, product of elasticity modulus and cross-sectional area." units_comment="N"/>
							<diameter value="3.656e-3" comment="Volume-equivalent diameter of the line." units_comment="m"/>
							<massDenInAir value="0.0607" comment="Mass per unit length of the line." units_comment="kg/m"/>
							<ba value="-0.8" comment="Line internal damping (BA/-zeta). (default=-0.8)" units_comment="Ns"/>
							<can value="1.0" comment="Transverse added mass coefficient (with respect to line displacement). (default=1.0)"/>      
							<cat value="0.0" comment="Tangential added mass coefficient (with respect to line displacement). (default=0.0)"/>   
							<cdn value="1.6" comment="Transverse drag coefficient (with respect to frontal area, d*l). (default=1.6)"/>    
							<cdt value="0.05" comment="Tangential drag coefficient (with respect to surface area, π*d*l). (default=0.05)"/>  
							<outputFlags value="p" comment="Node output properties.(default=-) [-:None|p:Positions|v:Telocities|U:Wave Velocities|t:Tension|D:Hydrodynamic Drag Force|c=Internal Damping|s:Strain of each segment|d: rate of strain of each segment]"/>
						</linedefault>
						<line>  %line 0                            
							<vesselconnection bodyref="50" x="-1.9" y="0.1" z="-0.0736" />
							<fixconnection x="-0.615" y="0.423" z="-0.50" />
							<length value="1.455" comment="(m)"/>
							<segments value="40" />
						</line>
						<line>  %line 1
							<vesselconnection bodyref="50" x="-1.9" y="-0.1" z="-0.0736" />
							<fixconnection x="-0.615" y="-0.423" z="-0.50" />
							<length value="1.455" comment="(m)"/>
							<segments value="40" />
						</line>
						<line>  %line 2
							<vesselconnection bodyref="50" x="-2.1" y="-0.1" z="-0.0736" />
							<fixconnection x="-3.385" y="-0.423" z="-0.50" />
							<length value="1.455" comment="(m)"/>
							<segments value="40" />
						</line>
						<line>  %line 3
							<vesselconnection bodyref="50" x="-2.1" y="0.1" z="-0.0736" />
							<fixconnection x="-3.385" y="0.423" z="-0.50" />
							<length value="1.455" comment="(m)"/>
							<segments value="40" />
						</line>
						<line>  %line 4                            
							<vesselconnection bodyref="51" x="1.7" y="0.1" z="-0.0736" />
							<fixconnection x="2.985" y="0.423" z="-0.250" />
							<length value="1.455" comment="(m)"/>
							<segments value="40" />
						</line>
						<line>  %line 5
							<vesselconnection bodyref="51" x="1.7" y="-0.1" z="-0.0736" />
							<fixconnection x="2.985" y="-0.423" z="-0.250" />
							<length value="1.455" comment="(m)"/>
							<segments value="40" />
						</line>
						<line>  %line 6
							<vesselconnection bodyref="51" x="1.5" y="-0.1" z="-0.0736" />
							<fixconnection x="0.215" y="-0.423" z="-0.250" />
							<length value="1.455" comment="(m)"/>
							<segments value="40" />
						</line>
						<line>  %line 7
							<vesselconnection bodyref="51" x="1.5" y="0.1" z="-0.0736" />
							<fixconnection x="0.215" y="0.423" z="-0.250" />
							<length value="1.455" comment="(m)"/>
							<segments value="40" />
						</line>
					</lines>
					<output comment="Output data properties for each line.">
						<time startTime="0" endTime="20.0" dtOut="0.01" comment="Default [startTime= 0; endTime= 0; dtOut=0.01]"/>
						<tension type="all" comment="Stores tensions at the connections. type=[fixed|vessel|all]. (default: type=all)"/>
						<position type="all" comment="Stores positions at the connections. type=[fixed|vessel|all]. (default: type=all)"/>
					</output>
				</moordyn>
			</moorings>
		</special>
        <parameters>
            <parameter key="SavePosDouble" value="0" comment="Saves particle position using double precision (default=0)" />        
            <parameter key="StepAlgorithm" value="2" comment="Step Algorithm 1:Verlet, 2:Symplectic (default=1)" />
            <parameter key="VerletSteps" value="40" comment="Verlet only: Number of steps to apply Euler timestepping (default=40)" />
            <parameter key="Kernel" value="2" comment="Interaction Kernel 1:Cubic Spline, 2:Wendland (default=2)" />
            <parameter key="ViscoTreatment" value="1" comment="Viscosity formulation 1:Artificial, 2:Laminar+SPS (default=1)" />
            <parameter key="Visco" value="0.01" comment="Viscosity value" /> % Note alpha can depend on the resolution. A value of 0.01 is recommended for near irrotational flows.
            <parameter key="ViscoBoundFactor" value="0" comment="Multiply viscosity value with boundary (default=1)" />
            <parameter key="DensityDT" value="2" comment="Density Diffusion Term 0:None, 1:Molteni, 2:Fourtakas, 3:Fourtakas(full) (default=0)" />
            <parameter key="DensityDTvalue" value="0.1" comment="DDT value (default=0.1)" />
            <parameter key="Shifting" value="0" comment="Shifting mode 0:None, 1:Ignore bound, 2:Ignore fixed, 3:Full (default=0)" />
            <parameter key="ShiftCoef" value="-2" comment="Coefficient for shifting computation (default=-2)" />
            <parameter key="ShiftTFS" value="0" comment="Threshold to detect free surface. Typically 1.5 for 2D and 2.75 for 3D (default=0)" />
            <parameter key="RigidAlgorithm" value="1" comment="Rigid Algorithm 0:collision-free, 1:SPH, 2:DEM, 3:Chrono (default=1)" />
            <parameter key="FtPause" value="0.0" comment="Time to freeze the floatings at simulation start (warmup) (default=0)" units_comment="seconds" />
            <parameter key="CoefDtMin" value="0.05" comment="Coefficient to calculate minimum time step dtmin=coefdtmin*h/speedsound (default=0.05)" />
            <parameter key="DtIni" value="0" comment="Initial time step. Use 0 to defult use (default=h/speedsound)" units_comment="seconds" />
            <parameter key="DtMin" value="0" comment="Minimum time step. Use 0 to defult use (default=coefdtmin*h/speedsound)" units_comment="seconds" />
            <parameter key="DtFixed" value="0" comment="Fixed Dt value. Use 0 to disable (default=disabled)" units_comment="seconds" />
            <parameter key="DtFixedFile" value="NONE" comment="Dt values are loaded from file. Use NONE to disable (default=disabled)" units_comment="milliseconds (ms)" />
            <parameter key="DtAllParticles" value="0" comment="Velocity of particles used to calculate DT. 1:All, 0:Only fluid/floating (default=0)" />
            <parameter key="TimeMax" value="20.0" comment="Time of simulation" units_comment="seconds" />
            <parameter key="TimeOut" value="0.01" comment="Time out data" units_comment="seconds" />
            <parameter key="PartsOutMax" value="1" comment="%/100 of fluid particles allowed to be excluded from domain (default=1)" units_comment="decimal" />
            <parameter key="RhopOutMin" value="700" comment="Minimum rhop valid (default=700)" units_comment="kg/m^3" />
            <parameter key="RhopOutMax" value="1300" comment="Maximum rhop valid (default=1300)" units_comment="kg/m^3" />
            <_parameter key="YPeriodicIncZ" value="0.0" comment="Increase of Z with periodic BC" units_comment="metres (m)" />
                        <simulationdomain comment="Defines domain of simulation (default=Uses minimun and maximum position of the generated particles)">
                <posmin x="default" y="default" z="default" comment="e.g.: x=0.5, y=default-1, z=default-10%" />
                <posmax x="default" y="default" z="default + 50%" />
            </simulationdomain>            
        </parameters>
    </execution>
</case>
