diff --git a/doc/config.yml b/doc/config.yml index 7bbbb79185..31d39c90df 100644 --- a/doc/config.yml +++ b/doc/config.yml @@ -27,6 +27,7 @@ Extensions: Getting Started: Installation: getting_started/installation.md Running MASTODON: getting_started/running_mastodon.md + Tutorial: tutorial/tutorial.md Documentation: documentation.menu.md SQA: /sqa/index.md News: news/index.md diff --git a/doc/content.yml b/doc/content.yml index e271f2bc9f..04c88423aa 100644 --- a/doc/content.yml +++ b/doc/content.yml @@ -19,6 +19,7 @@ moose: - docs/content/documentation/modules/stochastic_tools/** - docs/content/documentation/examples/** + - docs/content/documentation/tutorial/** - docs/content/media/** - docs/content/bib/** diff --git a/doc/content/media/tutorial/acc_hist.png b/doc/content/media/tutorial/acc_hist.png new file mode 100644 index 0000000000..6092b0f436 Binary files /dev/null and b/doc/content/media/tutorial/acc_hist.png differ diff --git a/doc/content/tutorial/tutorial.md b/doc/content/tutorial/tutorial.md new file mode 100644 index 0000000000..56ef9c7afd --- /dev/null +++ b/doc/content/tutorial/tutorial.md @@ -0,0 +1,106 @@ +# Tutorial + +This tutorial is a breakdown of a full MASTODON input file. It will begin as a very simple site response analysis and will gain complexity as the tutorial proceeds. We will step through the problem in the same sort of way that an advanced user would. Each part of the input file will be briefly explained and links to useful areas in the documentation site will be provided. + +## Linear Site Response + +The first step is to begin with something very simple. Linear site response. No gravity, linear soil, everything in this step should be fairly straightforward. + +In general, users do not just start writing a text input file from scratch, instead the user should find a test or example input file that is generally related to the problem being set up and modify that input to better fit his or her model. With that stated, feel free to use this input file as a skeleton for your future site response analysis models. This tutorial will step through each block of text that comprises this input file. + +!alert note +The order in which you define these blocks within the input file does not matter! There is somewhat of a natural progression when it comes to defining the various blocks, but the order is not significant. + +### The Model + +The model we will be stepping through in this tutorial is a 1D site response. The model is a 100 m soil column containing 100 elements, each measuring 1 m x 1 m x 1 m. The base of the soil column is prescribed the acceleration history shown in [fig:tutorial_site_response]. Note that this is just a contrived example problem, there is no significance or meaning associated with the input motion. The outputs include an exodus file that can be used for visualizing results, and csv files containing accelerations and response spectra calculations at the top of the column. These outputs will be discussed in detail further into the tutorial. The input file is 'site_reponse_1.i' It can be executed in MASTODON, after compiling the code, by pointing to the executable and the input file as shown below: + +``` +~/projects/mastodon/mastodon-opt -i site_response_1.i +``` + +!media media/tutorial/acc_hist.png + style=width:60%;margin-left:150px;float:center; + id=fig:tutorial_site_response + caption=Acceleration history prescribed at the base of the soil column. + +At this point, we will start going through the input file. Each block of text in the input file will be briefly explained and useful links will be provided for further investigation. + +!listing tutorial/site_response_1.i + start=GlobalParams + end=Mesh + +The first block shown in this input file is the Global Params. This is an optional block of text in the MASTODON input file, which is useful for defining parameters that are required in multiple blocks of the input file. Instead of defining these parameters in each of the blocks that require it, you can define it only once in the GlobalParams block. In general this will help the user shorten his or her input file, but is not at all a requirement. In this instance, we have defined the displacement variables, which are required to be defined in the dynamic tensor mechanics kernel and the strain calculator block. Instead of defining them in those two places, we can define them only once in GlobalParams. The redundant lines are commented in the input file to show where they would be, if not set in the GlobalParams block. + +!listing tutorial/site_response_1.i + start=Mesh + end=Variables + +The next block in the input file is the Mesh block. This is a required block of text in the input file where the user defines the mesh to be used in the analysis. For simple geometry, the mesh can be created using the internal mesh generator which is the method demonstrated in this input file. The model is a 100 m soil column containing 100 elements, each measuring 1 m x 1 m x 1 m. If the geometry is more complex than rectangle/cube shapes, it is advised that the user create the mesh using an external mesh generation software. Mesh files can be imported in this block by changing the type to [FileMesh](source/mesh/FileMesh.md). Users and developers at INL utilize Cubit for most of our mesh generation needs, which is commercially available as Trelis. The preferred file type is an exodus (.e) file, although MASTODON can support other mesh file types, such as Abaqus (.inp) files (some limitations apply). See [Mesh](syntax/Mesh/index.md) for more information on the mesh system. + +!listing tutorial/site_response_1.i + start=Variables + end=AuxVariables + +The next block of text is the Variables block. This is where the user defines the non-linear variables being solved for, such as displacements, temperature, etc. See [Variables](syntax/Variables/index.md) for more information on the variables system. + +!listing tutorial/site_response_1.i + start=AuxVariables + end=Kernels + +Following Variables, the user must then define the AuxVariables. Auxiliary variables are values which can be derived from the primary variables or explicitly defined, this includes velocity, acceleration, stress etc. See [AuxVariables](syntax/AuxVariables/index.md) for more information on the AuxVariables system. + +!listing tutorial/site_response_1.i + start=Kernels + end=AuxKernels + +The Kernels block is where the physics of interest is defined. Because MASTODON is built on the MOOSE Framework, it can accomodate many types of problems, and therefore does not expect dynamics problems only. Because this is a dynamics simulation, the user must define the [DynamicTensorMechanics](syntax/Kernels/DynamicTensorMechanics/index.md) block, along with the inertia blocks for the three directions. There is a large library of options for this block in the input file. See [Kernels](syntax/Kernels/index.md) for more information on the Kernels system. + +!listing tutorial/site_response_1.i + start=AuxKernels + end=BCs + +The AuxKernels block is defined next. AuxKernels act on variables using explicit or know functions in order to determine the AuxVariable values. Here is where we define all accelerations and velocities, which are determined using the displacement variables in the [Newmark Method](source/auxkernels/NewmarkAccelAux.md). This block is also where stress or other field variables would be setup. See [AuxKernels](syntax/AuxKernels/index.md) for more information on the AuxKernels system. + +!listing tutorial/site_response_1.i + start=BCs + end=Functions + +Now that all of the variables have been defined and set up properly, we can begin to formulate the problem for the analysis. The BCs block is where problem boundary conditions are applied. We use the PresetBC type to fix the bottom surface of the soil column in the Y and Z directions, then prescribe an acceleration history to the bottom surface using the PresetAcceleration type. This is defined in the X direction only, for this problem. In order to constrain the soil column so that it only moves in shear, a periodic boundary condition is applied along the side surfaces of the soil column using the Periodic block. The side surfaces are input as boundaries. The boundaries called 'back', 'front', 'bottom', and 'top' are automatically created by the GeneratedMesh above. Usually, these boundaries will have to be defined in Cubit, Trelis, or any other meshing software being used. The Periodic BC requires the surfaces (input as boundaries) to be perfectly parallel and the normal vector of translation between the surfaces is input as the 'translation' parameter. See [BCs](syntax/BCs/index.md) for more information on the boundary conditions system including the Periodic BC. + +!listing tutorial/site_response_1.i + start=Functions + end=Materials + +The next block in this input file is the Functions block. This is another optional block that is not required for all simulations. Recall from the boundary conditions that for this model we are prescribing the base acceleration. There are a number of ways to do this within MASTODON, one of which is to supply a csv file that contains the acceleration history to be used. We input this file using a PiecewiseLinear function so that if the timesteps in the simulation do not exactly match those of the acceleration history, the acceleration values will be linearly interpolated. There are a wide variety of function types that can be defined within this block. See [Functions](syntax/Functions/index.md) for more information. + +!listing tutorial/site_response_1.i + start=Materials + end=Executioner + +The materials block is a required block in the MASTODON input file. This is where the user will define the material models to be used and the property values necessary for those calculations. For this example we have one block of material, which is linear soil. We define the material type as [ComputeIsotropicElasticityTensorSoil](source/materials/ComputeIsotropicElasticityTensorSoil.md) and define the necessary properties for each soil layer. Additionally we define the stress and strain formulations. There are a great deal of material options available to MASTODON users, see [Materials](syntax/Materials/index.md) for more information on the materials system. + +!listing tutorial/site_response_1.i + start=Executioner + end=Postprocessors + +The Executioner is a required block in the input file. It defines important solver information, start and end times, convergence criteria and timestep size. See [Executioner](syntax/Executioner/index.md) for more information on the executioner system. + +!listing tutorial/site_response_1.i + start=Postprocessors + end=VectorPostprocessors + +The Postprocessors block is another optional block in the input file. It is useful for obtaining various quantities of interest. For instance, if the user would like to get the acceleration history at the top of the soil column, there are a number of ways to do that. One way would be to run the analysis without any postprocessors, then probe the field values in an exodus viewer such as paraview. Another method, is to use a postprocessor in MASTODON. In this input file, we have two postprocessors defined, but both do the same thing - obtain the acceleration history at the top of the soil column. The data collected is output in a csv file. There are several postprocessors available for use in MASTODON, for more information see [Postprocessors](syntax/Postprocessors/index.md). + +!listing tutorial/site_response_1.i + start=VectorPostprocessors + end=Outputs + +Similar to Postprocessors, the user can also define vectorpostprocessors. These can be thought of as postprocessors that define multiple values at each step in the simulation. In this input we have setup the [ResponseHistoryBuilder](source/vectorpostprocessors/ResponseHistoryBuilder.md) in order to obtain the acceleation histories at the top of the soil column, and the [ResponseSpectraCalculator](source/vectorpostprocessors/ResponseSpectraCalculator.md) in order to obtain the response spectra for each of those acceleration histories. Like postprocessors, there are a wide variety of VectorPostprocessors available for use in MASTODON. See [VectorPostprocessors](syntax/VectorPostprocessors/index.md) for more information. + +!listing tutorial/site_response_1.i + start=Outputs + +The final block of text in this input file is the Outputs block. It is not required, and some information is automatically output by default. This block is useful for controlling the amount of information that is output to the screen during your simulation, as well as other useful information such as performance metrics. This is also where the user can specify the types of files to be output (csv, exodus, etc.). See [Outputs](syntax/Outputs/index.md) for more information on the outputs system. + +In general, an exodus file is the output file that will be useful for visualization of the results. For this, any exodus file viewing software will work. [Peacock](application_usage/peacock.md) is the MOOSE Graphical User Interface currently being developed and used within the MOOSE developer and user community. Another option that is widely used is [Paraview](https://www.paraview.org/). diff --git a/tutorial/acceleration_hist.csv b/tutorial/acceleration_hist.csv new file mode 100644 index 0000000000..d55488a94c --- /dev/null +++ b/tutorial/acceleration_hist.csv @@ -0,0 +1,402 @@ +time,accel +0,0 +0.01,0.099833417 +0.02,0.198669331 +0.03,0.295520207 +0.04,0.389418342 +0.05,0.479425539 +0.06,0.564642473 +0.07,0.644217687 +0.08,0.717356091 +0.09,0.78332691 +0.1,0.841470985 +0.11,0.89120736 +0.12,0.932039086 +0.13,0.963558185 +0.14,0.98544973 +0.15,0.997494987 +0.16,0.999573603 +0.17,0.99166481 +0.18,0.973847631 +0.19,0.946300088 +0.2,0.909297427 +0.21,0.863209367 +0.22,0.808496404 +0.23,0.745705212 +0.24,0.675463181 +0.25,0.598472144 +0.26,0.515501372 +0.27,0.42737988 +0.28,0.33498815 +0.29,0.239249329 +0.3,0.141120008 +0.31,0.041580662 +0.32,-0.058374143 +0.33,-0.157745694 +0.34,-0.255541102 +0.35,-0.350783228 +0.36,-0.442520443 +0.37,-0.529836141 +0.38,-0.611857891 +0.39,-0.687766159 +0.4,-0.756802495 +0.41,-0.818277111 +0.42,-0.871575772 +0.43,-0.916165937 +0.44,-0.951602074 +0.45,-0.977530118 +0.46,-0.993691004 +0.47,-0.999923258 +0.48,-0.996164609 +0.49,-0.982452613 +0.5,-0.958924275 +0.51,-0.925814682 +0.52,-0.883454656 +0.53,-0.832267442 +0.54,-0.772764488 +0.55,-0.705540326 +0.56,-0.631266638 +0.57,-0.550685543 +0.58,-0.464602179 +0.59,-0.373876665 +0.6,-0.279415498 +0.61,-0.182162504 +0.62,-0.083089403 +0.63,0 +0.64,0 +0.65,0 +0.66,0 +0.67,0 +0.68,0 +0.69,0 +0.7,0 +0.71,0 +0.72,0 +0.73,0 +0.74,0 +0.75,0 +0.76,0 +0.77,0 +0.78,0 +0.79,0 +0.8,0 +0.81,0 +0.82,0 +0.83,0 +0.84,0 +0.85,0 +0.86,0 +0.87,0 +0.88,0 +0.89,0 +0.9,0 +0.91,0 +0.92,0 +0.93,0 +0.94,0 +0.95,0 +0.96,0 +0.97,0 +0.98,0 +0.99,0 +1,0 +1.01,0 +1.02,0 +1.03,0 +1.04,0 +1.05,0 +1.06,0 +1.07,0 +1.08,0 +1.09,0 +1.1,0 +1.11,0 +1.12,0 +1.13,0 +1.14,0 +1.15,0 +1.16,0 +1.17,0 +1.18,0 +1.19,0 +1.2,0 +1.21,0 +1.22,0 +1.23,0 +1.24,0 +1.25,0 +1.26,0 +1.27,0 +1.28,0 +1.29,0 +1.3,0 +1.31,0 +1.32,0 +1.33,0 +1.34,0 +1.35,0 +1.36,0 +1.37,0 +1.38,0 +1.39,0 +1.4,0 +1.41,0 +1.42,0 +1.43,0 +1.44,0 +1.45,0 +1.46,0 +1.47,0 +1.48,0 +1.49,0 +1.5,0 +1.51,0 +1.52,0 +1.53,0 +1.54,0 +1.55,0 +1.56,0 +1.57,0 +1.58,0 +1.59,0 +1.6,0 +1.61,0 +1.62,0 +1.63,0 +1.64,0 +1.65,0 +1.66,0 +1.67,0 +1.68,0 +1.69,0 +1.7,0 +1.71,0 +1.72,0 +1.73,0 +1.74,0 +1.75,0 +1.76,0 +1.77,0 +1.78,0 +1.79,0 +1.8,0 +1.81,0 +1.82,0 +1.83,0 +1.84,0 +1.85,0 +1.86,0 +1.87,0 +1.88,0 +1.89,0 +1.9,0 +1.91,0 +1.92,0 +1.93,0 +1.94,0 +1.95,0 +1.96,0 +1.97,0 +1.98,0 +1.99,0 +2,0 +2.01,0 +2.02,0 +2.03,0 +2.04,0 +2.05,0 +2.06,0 +2.07,0 +2.08,0 +2.09,0 +2.1,0 +2.11,0 +2.12,0 +2.13,0 +2.14,0 +2.15,0 +2.16,0 +2.17,0 +2.18,0 +2.19,0 +2.2,0 +2.21,0 +2.22,0 +2.23,0 +2.24,0 +2.25,0 +2.26,0 +2.27,0 +2.28,0 +2.29,0 +2.3,0 +2.31,0 +2.32,0 +2.33,0 +2.34,0 +2.35,0 +2.36,0 +2.37,0 +2.38,0 +2.39,0 +2.4,0 +2.41,0 +2.42,0 +2.43,0 +2.44,0 +2.45,0 +2.46,0 +2.47,0 +2.48,0 +2.49,0 +2.5,0 +2.51,0 +2.52,0 +2.53,0 +2.54,0 +2.55,0 +2.56,0 +2.57,0 +2.58,0 +2.59,0 +2.6,0 +2.61,0 +2.62,0 +2.63,0 +2.64,0 +2.65,0 +2.66,0 +2.67,0 +2.68,0 +2.69,0 +2.7,0 +2.71,0 +2.72,0 +2.73,0 +2.74,0 +2.75,0 +2.76,0 +2.77,0 +2.78,0 +2.79,0 +2.8,0 +2.81,0 +2.82,0 +2.83,0 +2.84,0 +2.85,0 +2.86,0 +2.87,0 +2.88,0 +2.89,0 +2.9,0 +2.91,0 +2.92,0 +2.93,0 +2.94,0 +2.95,0 +2.96,0 +2.97,0 +2.98,0 +2.99,0 +3,0 +3.01,0 +3.02,0 +3.03,0 +3.04,0 +3.05,0 +3.06,0 +3.07,0 +3.08,0 +3.09,0 +3.1,0 +3.11,0 +3.12,0 +3.13,0 +3.14,0 +3.15,0 +3.16,0 +3.17,0 +3.18,0 +3.19,0 +3.2,0 +3.21,0 +3.22,0 +3.23,0 +3.24,0 +3.25,0 +3.26,0 +3.27,0 +3.28,0 +3.29,0 +3.3,0 +3.31,0 +3.32,0 +3.33,0 +3.34,0 +3.35,0 +3.36,0 +3.37,0 +3.38,0 +3.39,0 +3.4,0 +3.41,0 +3.42,0 +3.43,0 +3.44,0 +3.45,0 +3.46,0 +3.47,0 +3.48,0 +3.49,0 +3.5,0 +3.51,0 +3.52,0 +3.53,0 +3.54,0 +3.55,0 +3.56,0 +3.57,0 +3.58,0 +3.59,0 +3.6,0 +3.61,0 +3.62,0 +3.63,0 +3.64,0 +3.65,0 +3.66,0 +3.67,0 +3.68,0 +3.69,0 +3.7,0 +3.71,0 +3.72,0 +3.73,0 +3.74,0 +3.75,0 +3.76,0 +3.77,0 +3.78,0 +3.79,0 +3.8,0 +3.81,0 +3.82,0 +3.83,0 +3.84,0 +3.85,0 +3.86,0 +3.87,0 +3.88,0 +3.89,0 +3.9,0 +3.91,0 +3.92,0 +3.93,0 +3.94,0 +3.95,0 +3.96,0 +3.97,0 +3.98,0 +3.99,0 +4,0 \ No newline at end of file diff --git a/tutorial/site_response_1.i b/tutorial/site_response_1.i new file mode 100644 index 0000000000..67416234b8 --- /dev/null +++ b/tutorial/site_response_1.i @@ -0,0 +1,235 @@ +[GlobalParams] + displacements = 'disp_x disp_y disp_z' +[] + +[Mesh] + type = GeneratedMesh + nx = 1 + ny = 1 + nz = 100 + xmin = -0.5 + ymin = -0.5 + zmin = 0.0 + xmax = 0.5 + ymax = 0.5 + zmax = 100.0 + dim = 3 +[] + +[Variables] + [./disp_x] + [../] + [./disp_y] + [../] + [./disp_z] + [../] +[] + +[AuxVariables] + [./vel_x] + [../] + [./accel_x] + [../] + [./vel_y] + [../] + [./accel_y] + [../] + [./vel_z] + [../] + [./accel_z] + [../] + [./layer_id] + [../] +[] + +[Kernels] + [./DynamicTensorMechanics] + # displacements = 'disp_x disp_y disp_z' + [../] + [./inertia_x] + type = InertialForce + variable = disp_x + velocity = vel_x + acceleration = accel_x + beta = 0.25 + gamma = 0.5 + [../] + [./inertia_y] + type = InertialForce + variable = disp_y + velocity = vel_y + acceleration = accel_y + beta = 0.25 + gamma = 0.5 + [../] + [./inertia_z] + type = InertialForce + variable = disp_z + velocity = vel_z + acceleration = accel_z + beta = 0.25 + gamma = 0.5 + [../] +[] + +[AuxKernels] + [./accel_x] + type = NewmarkAccelAux + variable = accel_x + displacement = disp_x + velocity = vel_x + beta = 0.25 + execute_on = timestep_end + [../] + [./vel_x] + type = NewmarkVelAux + variable = vel_x + acceleration = accel_x + gamma = 0.5 + execute_on = timestep_end + [../] + [./accel_y] + type = NewmarkAccelAux + variable = accel_y + displacement = disp_y + velocity = vel_y + beta = 0.25 + execute_on = timestep_end + [../] + [./vel_y] + type = NewmarkVelAux + variable = vel_y + acceleration = accel_y + gamma = 0.5 + execute_on = timestep_end + [../] + [./accel_z] + type = NewmarkAccelAux + variable = accel_z + displacement = disp_z + velocity = vel_z + beta = 0.25 + execute_on = timestep_end + [../] + [./vel_z] + type = NewmarkVelAux + variable = vel_z + acceleration = accel_z + gamma = 0.5 + execute_on = timestep_end + [../] + [./layer_id] + type = UniformLayerAuxKernel + variable = layer_id + interfaces = '20 60 100.1' + direction = '0.0 0.0 1.0' + execute_on = initial + [../] +[] + + +[BCs] + [./bottom_z] + type = PresetBC + variable = disp_z + boundary = 'back' + value = 0.0 + [../] + [./bottom_y] + type = PresetBC + variable = disp_y + boundary = 'back' + value = 0.0 + [../] + [./bottom_accel] + type = PresetAcceleration + boundary = 'back' + function = accel_bottom + variable = 'disp_x' + beta = 0.25 + acceleration = 'accel_x' + velocity = 'vel_x' + [../] + [./Periodic] + [./y_dir] + variable = 'disp_x disp_y disp_z' + primary = 'bottom' + secondary = 'top' + translation = '0.0 1.0 0.0' + [../] + [./x_dir] + variable = 'disp_x disp_y disp_z' + primary = 'left' + secondary = 'right' + translation = '1.0 0.0 0.0' + [../] + [../] +[] + +[Functions] + [./accel_bottom] + type = PiecewiseLinear + data_file = 'acceleration_hist.csv' + format = 'columns' + [../] +[] + +[Materials] + [./linear_soil] + type = ComputeIsotropicElasticityTensorSoil + layer_variable = layer_id + layer_ids = '0 1 2' + shear_modulus = '3e6 2e6 1e6' + poissons_ratio = '0.2 0.2 0.2' + density = '1200 1000 800' + [../] + [./strain] + type = ComputeSmallStrain + # displacements = 'disp_x disp_y disp_z' + [../] + [./stress] + type = ComputeLinearElasticStress + [../] +[] + +[Executioner] + type = Transient + solve_type = NEWTON + start_time = 0 + end_time = 4 + dt = 0.01 + timestep_tolerance = 1e-6 +[] + +[Postprocessors] + [top_ax_pv] + type = PointValue + point = '0 0 100' + variable = 'accel_x' + [] + [./top_ax_nvv] + type = NodalVariableValue + variable = accel_x + nodeid = 401 + [../] +[] + +[VectorPostprocessors] + [./accel_hist] + type = ResponseHistoryBuilder + variables = 'accel_x accel_y accel_z' + nodes = '401' + [../] + [./accel_spec] + type = ResponseSpectraCalculator + vectorpostprocessor = accel_hist + regularize_dt = 0.01 + # outputs = out + [../] +[] + + +[Outputs] + csv = true + exodus = true +[] diff --git a/tutorial/tests b/tutorial/tests new file mode 100644 index 0000000000..a7967f2a87 --- /dev/null +++ b/tutorial/tests @@ -0,0 +1,8 @@ +[Tests] + [./tutorial] + type = RunApp + input = site_response_1.i + method = opt + check_input = True + [../] +[../]