Home

MOOSE Workshop - MOOSE Framework

image

Contents

1. 117 313 118 313 ANE q CC TES A Idaho National Laboratory Example 5 Output convected diffused 0 25 0 5 0 75 25 5 7 5 D cecil ial 0 10 119 313 Executioners lad www inl gov Idaho National Laboratory e WL Idaho National Laboratory q h Built in Executioners e There are two main types of Executioners Steady and Transient e MOOSE provides a number of built in executioners but you can extend this system and add your own MooseObject UserObjectInterface PostprocessorInterface Restartable Executioner CoupledExecutioner PetscTSExecutioner Steady CoupledTransientExecutioner 121 313 o Steady state Executioner e Steady state executioners generally solve the nonlinear system just once e However our steady state executioner can solve the nonlinear system multiple times while adapting the mesh to better fit the solution as was seen in the previous example i NN 4 NAMI o National Laboratory d 122 313 Some Common Options for
2. 157 313 Idaho National Laborato Execution Peacock moose_test oprof Input File RSENS Postprocess Visualize to execute the input file LO ml ee Current Working Directory Users slauae projects trunk moose test tests outputs exodus e You don t need to save the Time Step 15 time 1 5000000 dt 0 1000000 a fai Initial R 1 149646e 02 O wonlinear Rj 1 149646e 02 0 Linear n 1 149646e 02 1 Linear 24323598 04 e The second tab allows you mi 2 Linear R 3 382316e 07 5 Linear R 2 1689998 09 1 Nonlinear R 2 1900208 09 O Linear R 2 190020e 09 Linear R 2 209437e 11 2 Linear R 6 928081e 14 e MPI procs and threads are ase HEE Time Step 16 time 1 6000000 dt 0 1000000 initial R 1 044799 02 O Nonlinear R 1 044799e 02 easily set a 3 Linear r 1 Nonlinear R 1 952994e 09 O Linear R 1 952994e 09 1 Linear R 1 912922e 11 2 Linear R 6 290411e 14 3 Linear R 4 093691e 16 bd 2 Nonlinear R 4 242513e 16 e r mmana lin aa O Linear R 9 497965e 03 options can be passed ac O Linear R 1 791397e 09 1 Linear R 1 774098 2 Linear R 5 70932 3 Linear R 3 686713e 16 2 nonlinear R 3 859063e 16 Solve Converged The output of the run iS Tine step 10 Sige 0 100000 initial n 635897e 03 O Nonlinear R 8 635897e
3. gt C fi A https www moosebuild com it apps Email 4 Moose G GitHub Gil Doxygen nucleus HPC 3 Stack Overflow EM Documents Help P Pand to ensure everything is still working a ER a idaholab mi devel master pee devel_to_master tt o e The current build status is shown on de mam mooseframework org o q Ri BIB B E B g slalsiele 2222223828 3 2 B18 181818 ol2 slolels BEER BISRBIR e Additional details are available on moosebuild com SEE Yellow In progress Green All tests passed Red Something compilation testing etc failed r g g z 2 E B g g a 2 a g fo Es ij E RSE e The status of Pull Requests are also included 243 313 Visualization Tools lad www inl gov Idaho National Laboratory e NL Idaho National Laboratory Visualization e MOOSE can write results in several formats Exodusll GMV Tecplot Miscellaneous others e The INL has a network Tecplot license For installation instructions see http hpcweb inel gov home Software Tecplot e Paraview is a free visualization and data analysis program that reads Exodusll files http www paraview org 245 313 a EEE Te GGG HGO Co Pipeline Browser builtin o oute Object Inspector Properties Display Information Apply D Reset R Delete Variables Object ids ff Global Element ids
4. Variables ae eae ene e Use ILU for the u block and AMG for v active myPBp myPBP aoe pee e Use the lower diagonal v u block solve order u preconditioner ILU AMG off diag row off diag column When using t ype PBP MOOSE will set solve type JFNK automatically 180 313 0 Applying PBP e Applying these ideas to a coupled thermo mechanics problem Not Preconditioned Diagonal L Two Sweeps Linear Residual 0 10 20 30 40 50 60 70 80 90 Linear Iteration NL Idaho National Laboratory 181 313 WNL Idaho National Laborat Look at Example 12 pac 182 313 Functions lad www inl gov Idaho National Laboratory CC TEN AL Idaho National Laboratory Functions Function objects allow you to evaluate analytic expressions based on x y z and time You can create your own custom Function object in the general MOOSE way of inheriting from Function and overriding value and optionally gradient Functions can be used in any MOOSE based object by calling getFunction name where name matches a name from the input file In this way you can create generic BCs ICs Forcing Functions Materials and more where you can plug and play different Functions to change behavior A number of these have already been created that you can use including FunctionDirichletBc FunctionNeumannBC FunctionIcC
5. XYZ coordinates of the current q point Only valid for element AuxKernels _qp Current quadrature point Used even for nodal AuxKernels Just for consistency current elem pointer to the current element that is being operated on Only valid for element AuxKernels O current node pointer to the current node that is being operated on Only valid for nodal AuxKernels e And more 162 313 0 WNL Idaho National Labora 163 313 em CC TEN CAL Idaho National Laboratory Example 10 Output t 02 05 08 maio O oi aaa p element aux nodal aux L 4 2 4 4 4 6 4 8 E 3 25 3 5 3 75 4 009949 4 991391 3 4 164 313 Preconditioning lad www inl gov Idaho National Laboratory Preconditioning SS Krylov methods need preconditioning to be efficient or even effective Even though the Jacobian is never formed JFNK methods still require preconditioning MOOSE s automatic without user intervention preconditioning is fairly minimal Many options exist for implementing improved preconditioning in MOOSE e WL Idaho National Laboratory 166 313 N NAMI o National Laboratory d io a Preconditioned JFN e Using right preconditioning solve R u M Mdu R u e Msymbolically represents the preconditioning matrix or process e Inside GMRES we only apply the action of M on a vector e Right preconditi
6. template lt gt include ODEKernel h InputParameters validParams lt ImplicitODEx gt class ImplicitODEx InputParameters params validParams lt ODEKernel gt params addCoupledVar y coupled variable Y template lt gt return params InputParameters validParams lt ImplicitODE class ImplicitODEx public ODEKernel ImplicitODEx ImplicitODEx const std string amp name InputParameters parameters public ODEKernel name parameters ImplicitODEx const std string amp name y ven Coupe disc auleatar W54 i InputParameters parameters _y coupledScalarValue y protected virtual Real computeQpResidual virtual Real computeQpJacobian Real virtual Real computeQpOffDiagJacobian unsigned int jvar ImplicitODEx computeQpResiduali unsigned int _y var returns Ula Zo wlia VariableValue amp _y Real ImplicitODEx computeQpJacobian return 3 Real ImplicitODEx computeQpOffDiagJacobian unsigned int jvar if jvar _y_var return 2 else return 0 WNL Idaho National Laborat Look at Example 18 pac 275 313 ANS F gt ENS Idaho National Laboratory Example 18 Output diffused 2 0 922626 2 830435 276 313 Geometric Search Advanced Topic lad www inl gov Idaho National Laboratory POUL ions ll s q RI Idaho National Laboratory Geome
7. Just like in polynomial fitting except the functions aren t typically as simple as x although they can be The Galerkin Finite Element method is different from finite difference and finite volume methods because it finds a piecewise continuous function which is an approximate solution to the governing PDE Just as in polynomial fitting you can evaluate a finite element solution anywhere in the domain You do it the same way by adding up shape functions evaluated at the point and multiplied by their coefficient FEM is widely applicable for a large range of PDEs and domains It is supported by a rich mathematical theory with proofs about accuracy Stability convergence and solution uniqueness 18 313 E NN Idaho National Laboratory Weak Form e Using FE to find the solution to a PDE starts with forming a weighted residual or variational statement or weak form We typically refer to this process as generating a Weak Form e The idea behind generating a weak form is to give us some flexibility both mathematically and numerically e A weak form is what you need to input into MOOSE in order to solve a new problem e Generating a weak form generally involves these steps ees aa Write down strong form of PDE Rearrange terms so that zero is on the right of the equals sign Multiply the whole equation by a test function 2 Integrate the whole equation over the do
8. The search string may contain wildcard characters Searches both block names and parameters All parameters are printed for a matching block e Option 2 Generate a tree based on your input file CLI option show input e Option 3 View it online http mooseframework org wiki InputFileSyntax 69 313 ANA SNL Idaho National Laboratory The InputParameters Object e The parser and Peacock work with the InputParameters object to read almost any kind of parameter e Built in types and std vector are supported via templated methods addReguiredParam lt Real gt required_const doc addParam lt int gt count 1 doc default supplied addParam lt unsigned i1nt gt anocher num doc addRequiredParam lt std vector lt int gt gt vec doc e Other supported parameter types include Point RealVectorValue RealTensorValue SubdomainID BoundaryID e For the complete list of supported types see Parser extractParams 70 313 o cj Idaho National Laboratory i The InputParameters Object cont e MOOSE uses a large number of string types to make Peacock more context aware All of these types can be treated just like strings but will cause compile errors if mixed improperly in the template functions SubdomainName BoundaryName FileName MeshFileName OutFileName VariableName NonlinearVariableName AuxVariableName FunctionName
9. CheckFiles e RunApp Runs a MOOSE based application with specified options e Exodiff Checks Exodus files for differences within specified tolerances e CSVDiff Checks CSV files for differences within specified tolerances e RunException Tests for various error conditions e CheckFiles Checks for the existence of specific files after a completed run Exodiff CSV Diff RunException 214 313 WL Idaho National Laboratory Adding Additional Testers rs Advanced e Inherit ffom Tester and override checkRunnable prepare Method to run right before a test starts getCommand Command to run in parallel with other tests processResults Process the results to check whether the test has passed e NO REGISTRATION REQUIRED Drop the Tester object in lt Your App gt scripts TestHarness testers 215 313 o ju Idaho National Laboratory i Options available to each Tester Run r n tests dump input The name of the input file exodiff The list of output filenames to compare abs_zero Absolute zero tolerance for exodiff rel_err Relative error tolerance for exodiff prereq Name of the test that needs to complete before running this test min_parallel Minimum number of processors to use for a test default 1 max_parallel Maximum number of processors to use for a test 216 313 Running your tests cun_tests options lt n FOLDER
10. UserForcingFunction Each of these objects takes a function parameter from the input file to know what Function object to use In addition to creating your own objects that inherit from Function there is also a ParsedFunction object This object will parse arbitrary expressions directly from the input file to define its value and gradient like value x x sin y xt 184 313 IL essa S WL Idaho National Laboratory Default Functions e Whenever a Function object is requested through an InputParameter object a default can be provided e Constant values or parsed functions can be supplied as the default function Adding a Function with a default constant params addParam lt FunctionName gt pressure_grad 0 5 doc Adding a Function with a default parsed function params addParam lt FunctionName gt power history t 100 sin y doc e ParsedFunction Of ConstantFunction object is automatically constructed based on the default value if a function name is not supplied in the input file 185 313 IL essa a WL Idaho National Laboratory E Input File Syntax e Functions are declared in the Function Functions block active bc func pc func e ParsedFunction allows you to type ParsedFunction value sin alphaxpixx vars alpha vals 11167 provide a string specifying the function e You can use constants like alpha and defi
11. gt 1 _p 1 _point_param 1 if point param size gt 2 _p 2 point param 2 void ExampleDirac addPoints sieloleoulinie 18 5 adePoint Point 4 9 0 9 0 9 Real ExampleDirac computeQpResidual return _test _i _qp _value 268 313 WNL Idaho National Laborat Look at Example 17 page 269 313 BN N N Ni Idaho National Laboratory Example 17 Output diffused 0 2 4286 270 313 Scalar Kernels Advanced Topic lad www inl gov Idaho National Laboratory e NL Idaho National Laboratory Scalar Kernels e Scalar Kernels Operate on scalar variables family SCALAR Are defined in the ScalarKernels section of your input file e Use them for Solving ODEs see example 18 Formulations with Lagrange multipliers Contact Other applications e Notes Mesh specific data such as agp and current elem are not available to ScalarkKernels 272 313 o NL Idaho National Laboratory Scalar Kernels e Problem being solved Ou _ S o af Vutt in 1 1 u X t ON Fett u Y t On Fright e Where the boundary conditions are governed by the ODEs dX OX _3y 4 0y 3X dy aY _axay at plus suitable initial conditions 273 313 Idaho National Laboratory ImplicitODEx h C ifndef IMPLICITODEX H include ImplicitoOD define IMPLICITODEX_H
12. EEE 428 A sub app can itself have MultiApps leading to multi level solves 298 313 A T i gt daho National Laboratory Input File Syntax o oo e MultiApps are declared in the Mult iApps type TransientMultiApp app_type SomeApp block xecute_on timestep POsSiciomas O 0 0 e They require a type just like any other block e app_type is required and is the name of the MooseApp derived App that is going to be run Generally this is something like AnimalApp 0 5 6 7 aL woe OM 6 Ds 57 Do input files sub e AMultiApp can be executed at any point during the master solve You set that using execute onto one of initial residual jacobian timestep begin Or timestep e positions Is a list of 3D coordinate pairs describing the offset of the sub application into the physical space of the master application More on this in a moment e You can either provide one input file for all the sub apps or provide one per position 299 313 o WL Idaho National Laboratory TransientMultiApp e The only currently available MultiApp is TransientMultiApp but that will change e ATransientMultiApp requires that your sub apps use an Executioner derived from Transient e ATransientMultiApp will be taken into account during time step selection inside the master Transient executioner e Currently the minimum dt over the master and all sub apps is used e That
13. curvilinear etc Reads and writes multiple formats Mesh Adaptivity Parallel User code agnostic of parallelism High Order User code agnostic of shape functions p Adaptivity Built in Postprocessing And much more 7 313 MOOSE solves prob Profile of A concentration at 4480 s o d a 4 NEM voo National Laboratory t challenge others Profile of C concentration at 4480 s Concentration mol L 3 0E 03 8 0E 03 7 0E 03 MOOSE RAT 6 0E 03 STOMP 5 0E 03 sessss Reference Solution a o m w 3 0E 03 Concentration mol L 2 0E 03 1 0E 03 0 0E 00 0 3 e e 0 6 1 0E 03 Distance m Concentration mol L 10 0 9 0 4 8 0 N em MOOSE RAT 4 0 STOMP Reference Solution Concentration mol L N w PF wa o o Oo So o L L L L ra o o o 0 0 0025 0 005 0 0075 0 01 Distance m Weak coupling excellent agreement between fully coupled and operator split approaches Strong coupling better agreement between fully coupled and the reference solution 8 313 pe NL Idaho National Laboratory i MOOSE Ecosystem Application Physics Results LoC BISON Thermo mechanics Chemical diffusion 4months 3 000 coupled mesoscale PRONGHORN Neutronics Porous flow eigenvalue 3 months 7 000 MARMOT 4 order phasefield mesoscale 1 month 6 000 RAT Porous ReActive Transport 1 month 1 50
14. vu or Vu Vy KV bj wi au i pi KV j J OB Bos OF E ou vu T pi B Voj v x Note that even for this simple equation the Jacobian entries are nontrivial especially when the partial derivatives of k G and f are actually expanded In a multiphysics setting with many coupled equations and complicated material properties the Jacobian might be extremely difficult to determine 30 313 ci i T i Idaho National Laboratory Jacobian Free Newton Krylov e J un Un R un is a linear system of equations to solve during each Newton step Lots of choices but we typically employ GMRES a Krylov subspace method Scales well in parallel Effective on a diverse set of problems In a Krylov iterative method such as GMRES we have the representation 2 k OUn 1 k Golo adro God ro akd ro Note that J is never explicitly needed Instead only the action of Jona vector needs to be computed This action can be approximated by as R u ev R u E J This form has many advantages No need to do analytic derivatives to form J No time needed to compute J just residual computations No space needed to store J 31 313 pe e NL Idaho National Laboratory i Wrap Up e The Finite Element Method is a way of numerically approximating the solution to PDEs Just like polynomial fitting FEM finds coefficients for basis functions The
15. 0 2 0 0 2 0 4 1 0 5 0 0 5 1 1 0 5 0 0 5 1 1 0 5 0 0 5 1 a E 5 24 313 CC TEN AL Idaho National Laboratory 2D Lagrange Shape Functions e Some biquadratic basis functions defined on the Quad9 element i Yo wa we e wo Is associated to a corner node it is zero on the opposite edges e 1 4 Is associated to a mid edge node it is zero on all other edges e bg is associated to the center node it is symmetric and gt 0 on the element 25 313 NL Idaho National Laboratory Numerical Integration e The only analytical piece left in the weak form are the integrals e To allow a computer to numerically compute these integrals we use quadrature typically Gaussian Quadrature e Quadrature approximates continuous integrals by discrete sums frog Pa gt f Xqp Wap 1 qp Here Xap is the position of the quadrature point and Wgp is the associated weight e Under certain common situations the approximation 1 is exact Ex In 1 dimension Gaussian Quadrature can exactly integrate polynomials of order 2n 1 with n quadrature points 26 313 Numerical Integration e NL Idaho National Laboratory e Note that sampling u for quadrature amounts to U Xap Uh Xap Ujbj Xap VU Xgp Vun Xgp gt UV Xqp e And our weak form becomes Ri un o Wap V Wi Xap K X qo Vun Xgp qp o gt WapPtace Vi x QPface k x QPf
16. 03 O Linear R B 635897e 03 1 Linear R 1 828970e 04 captured and can be P a Linear R 1 608860e 11 2 Linear R 5 196439e 14 3 Linear R 3 433322e 16 2 nonlinear R 3 691637e 16 solve Converged 5 Tine Step 19 time 1 9000000 dt 0 1000000 Initial R 7 852946e 03 O Nonlinear R 7 852946e 03 O Linear R 1 Linear R 2 Linear r 3 Linear R 1 4471278 09 e progress bar will appear E E 2 Linear r 4 6925458 14 3 3 Linear R 3 011230e 16 2 nonlinear R 3 192250e 16 solve Converged Time Step 20 time 2 0000000 de 0 1000000 initial R 7 141463e 03 O Nonlinear R 7 161663e 03 O Linear R 1 Linear 2 Linear 3 Linear 7 141463e 03 1 512881e 04 210757708 07 1 312717e 09 e The Kill button will stop Rn 3 Linear R 2 681638e 16 2 nonlinear R 2 880690e 16 solve Converged the currently running job E 12 5 0 Darwin Kernel Version 12 5 0 sun Sep 29 13 x86 64 ala ae Users slauae projects libmesh configure vith methods oprof opt dbg Users slauae projects 1ibmesh 1ibmesh clang enable unique id enable perf log enable tracefiles disabla varnings with cxx distee clang with co distee clang XX distee clang 147 PDT 2013 root xnu 2050 48 12 1 RELEASE_XB6_64 Clear Log 158 313 Auxiliary Variables lad www inl gov Idaho National Laboratory i N Idaho National L
17. All Executioners o WL Idaho National Laboratory e There a number of options that appear in the executioner block that control the solver The best way to view these is through peacock Here are a few common options 1 tol 1 max its nl rel tol nl max its Linear Tolerance Max Linear Iterations Nonlinear Relative Tolerance Max Nonlinear Iterations 123 313 Transient Executioners e WL Idaho National Laboratory A e Transient executioners solve the nonlinear system at least once per time step e Frequently used options Transient Executioners dt num steps start time end time scheme Starting time step size Number of time steps The start time of the simulation The end time of the simulation Time integration scheme discussed next 124 313 e WL Idaho National Laboratory Transient Analysis e Currently MOOSE includes support for these TimeIntegrator objects Backward Euler BDF2 Crank Nicolson Implicit Euler Explicit Euler o AWN e Each one of these supports adaptive time stepping e They are treated as TimeDerivative kernels for the time derivative terms that appear in PDEs Ou pp VE VR RS Becomes Fw Vu Vuj Vu vi v Vu yi 0 125 313 Custom Time Kernel e NL Idaho National Laboratory e f you need to provide a coefficient to the transient term such as density specific_heat for heat conduction inherit from one of the
18. Clobal Node Ids Cake V Apply Displacements 1 Blocks Hierarchy Materials Blocks Vg Unnamed block ID 1 Type QUAD4 Size 1024 Selection Inspector Selection Type IDs Field Type CELL Containing Cells Inside Out e_ NL Idaho National Laboratory 246 313 AN o NNL Idaho National Laboratory nsight Interface EnSight standard 10 0 3 e rattlesnake_out e wat ROH OP RBAOR MES ROLL Time aja pic Beg 0 Cur 116 End 116 Parts Name ld Show Color Color bv Case 1 Block ID 1 HEX8 1 x Constant Block ID 2 HEX8 2 x Constant Block ID 3 HEX8 3 x Constant Block ID 4 HEX8 4 x E Constant Block ID 5 HEX8 5 Constant Block ID 6 HEX8 6 x m Constant Block ID 7 HEX8 7 x Constant Block ID 8 HEX8 8 x Constant Block ID 9 HEX8 9 x Constant Block ID 10 HEX8 10 x Constant Block ID 11 HEX8 11 x Constant Block ID 12 HEX8 12 x Constant Block ID 13 HEX8 13 x Constant Block ID 14 HEX8 14 x Constant Block ID 15 HEX8 15 x Constant Block ID 16 HEX8 16 x Constant Block ID 17 HEX8 17 x Constant Block ID 18 HEX8 18 x Constant Block ID 19 HEX8 19 x Constant Block ID 20 HEX8 20 x Constant Block ID 21 HEX8 21 x Constant Block ID 22 HEX8 22 x Constant Block ID 23 HEX8 23 x Constant Block ID 24 HEX8 24 x Constant Block ID 25 HEX8 25 x Constant Block ID 26 HEX8 26 x Constant Block ID 2
19. E f1 You may use WikiFormatting here Type task B Priority major 18 Milestone Bridge Scaling LORD i Component MOOSE B Version Alpha E Keywords Cc Estimated Number of Hours 0 Add Hours to Ticket 0 Billable M Total Hours O Internal O Owner B O I have files to attach to this ticket TracTickets 237 313 Trac Build Status e Any time a change is made to MOOSE its modules or any application our regression test suite runs to ensure everything is still working e You can view the current status of the tests by clicking on Build Status in the upper right Yellow In progress Green All tests passed Red Something compilation testing etc failed e You can click on individual builds to get more information and diagnose failures o WL Idaho National Laboratory Latest builds 3923 by andrsd 03 22 11 08 31 51 Dummy commit Cc Sa Build Status MOOSE E a gt A hups hpesc data trac FPCP build Google o Mm 5 MOOSE libMesh Bookmark on Delicious STIMS MO MOOSE a MOOSE Trac as logged In as ga Logout net ide About Trac RPC Timell ne Roadmap Browse Source View Tickets New Ticket Search Doxygen Progres Build Status er Pan dear uilds s build All Applications because tof IMOOSE 4 pen ing Bul uilds Helio 1 Snout 1 1 rea s build Heli lia ole a Rebuilds
20. Refine if variable value is above a specific value Coarsen if under UniformMarker Refine or coarsen all elements BoxMarker Refine or coarsen inside or outside a given box ComboMarker Combine several Markers into one e Markers produce an element field that can be viewed in your visualization utility e Custom Markers are easy to create by inheriting from the Marker base class Elem Error Refine Fraction 0 6 89 0 6 53 4 Coarsen Fraction 0 1 89 0 1 8 9 o Trotaigo 114 313 NS E ll SNL Idaho National Laboratory Input File Syntax Adaptivity marker errorfrac steps 2 Incilcatorzs eeror type GradientJumplndicator variable convected EA A Markers o eerorrtrac type ErrorFractionMarker refine 0 5 coarsen 0 indicator error e To enable adaptivity create an Adaptivity block e The Adaptivity block itself has several parameters marker Optional Name of the Marker to use f not set no mesh adaptivity will be done steps Number of refinement steps to do in a steady state calculation Ignored in transient e Adaptivity has two sub blocks Indicators and Markers Within these blocks you can specify multiple Indicators and Markers that will be active in the simulation 115 313 WNL Idaho National Laborat Look at Example 5 pag 116 313 e NL Idaho National Laboratory Initial grid
21. UserOb jectName P stprocessorName IndicatorName MarkerName e For a complete list see the instantiations at the bottom of MooseTypes h 71 313 T in gt daho National Laboratory Default and Range checked Parameters e You may supply a default value for all optional parameters not required aclElPauicain lt iIRealWectorvalue gt cirection Realvectorvalue NOC e The following types allow you to supply scalar defaults in place of object Any coupled variable Postprocessors PostprocessorName Functions FunctionName e You may supply an expression to perform range checking within the parameter system e You should use the name of your parameter in the expression addRangeCheckedParam lt Real gt temp temp gt 300 amp temp lt 330 doc e Function Parser Syntax http warp povusers org FunctionParser fparser html 72 313 S N on WL Idaho National Laboratory MooseEnum e MOOSE includes a smart enum utility to overcome many of the deficiencies in the standard C enum type e It works in both integer and string contexts and is self checked for consistency include MooseEnum h The valid options are specified in a comma separated list You can optionally supply the default value as a second argument MooseEnums are case preserving but case insensitive MooseEnum option enum first 1 second fourth 4 second j Use in a string contex
22. Vu Vwi VV Vu 4 0 Vv Vwi e Each physics sums into residual e One way coupling u equation depends on v 89 313 e N f s CE gt i WL Idaho National Laboratory Coupling Parameter e To couple a Kernel or any other MOOSE object to other variables you must declare the coupling in the validParams method params addCoupledVar temperature doc string e You may then specify your coupling in the input file temp order FIRST family LAGRANGE coupled_diffusion type ExampleDiffusion variable u temperature temp PEN J e Important temp Is the arbitrary name of the variable in the input file temperature Is the name used by the kernel always the same 90 313 o WL Idaho National Laboratory Coupling in Kernels e The coupling of values and gradients into Kernels is done by calling the following functions in the initialization list of the constructor coupledValue coupledValueOld coupledValueOlder coupledGradient coupledGradientOld coupledGradientOlder coupledDot e These functions return references that you hold onto in the class e The references are then used in computeQpResidual computeQpJacobian 91 313 V Gu Idaho National Laboratory Default Coupling Parameters e To aid in rapid development debugging and flexibility MOOSE allows you to supply
23. all the applications beca of a checkin to Moose a spe o t Rebuilds applications that rely on Elk because Applications because of ELK of a checkin to Elk 238 313 MOOSE External GitHub Development lad www inl gov Idaho National Laboratory Co T i x gt Idaho National Laboratory Working With a GitHub Clone e Users non developers of MOOSE should follow the instructions at http mooseframework org getting started After setting up your environment the steps are he Clone MOOSE mkdir projects cd projects git clone https github com idaholab moose git git checkout master Compile libMesh cd moose scripts update_and_rebuild_libmesh sh Compile and test MOOSE all in one step cd test make Deuses sites e If you plan to develop in MOOSE alternate instructions are available https mooseframework org static media uploads docs moose_github pdf 240 313 om ee im Idaho National Laboratory Basic Git Usage e To see a brief summary of all current not yet committed modifications git status e f you ve added files git will list them as being untracked Add each one youd like to commit git add filename e To see changes you ve made to an existing file type git diff filename e When you are ready to locally commit your changes type git commit a m An informative message about your work e To see alist of recen
24. can take place in either the initial mesh configuration or the displaced configuration when requested e To enable displacements simply supply a vector of variables representing displacements for each spatial dimension in the Mesh section displacements disp x disp_y disp_z e Once enabled the parameter use_displaced_mesh can be set on individual MooseObjects which will enable them to use displaced coordinates during calculations template lt gt InputParameters validParams lt SomeKernel gt InputParameters params validParams lt Kernel gt params set lt bool gt use_displaced_mesh true return params e This can also be set in the input file but it s a good idea to do it in code if you have a pure Lagrangian formulation 57 313 e Mesh Modifiers e MeshModifiers perform additional manipulations to a mesh after it has been set up e This can range from adding an additional node set to performing a complex set of transformations e MOOSE has a pluggable system for adding your own modifiers e Inherit from MeshModifier and implement modi fy e A few built ins AddExtraNodeset SideSetFromNormals SideSetFromPoints Transform Scale Rotate Translate MeshExtruder WL Idaho National Laboratory 58 313 e NNL Idaho National Laboratory Extrusion type MeshExtruder Takes a 1D or 2D mesh and extrudes it to 2D or 3D respectively Tri
25. const std string amp name InputParameters parameters Material name parameters block average value getUserObject lt BlockAverageValue gt block average userobject e Use the reference by calling some of the interface functions defined by the UserObject _diffusivity _qp 0 5 _block_average_value averageValue _current_elem gt subdomain_id 292 313 e ee eee in Idaho National Laboratory Example 20 Overview e The problem is time dependent diffusion with Dirichlet boundary conditions of 0 on the left and 1 on the right e The diffusion coefficient being calculated by the Material is dependent on the average value of a variable on each block e This means that as the concentration diffuses the diffusion coefficient is getting larger but the coefficient is different for each block based on the average value of the variable on that block e To achieve this we need 3 objects working together BlockAverageValue A UserObject that computes the average value of a variable on each block of the domain and provides averageValue for retrieving the average value on a particular block BlockAverageDiffusionMaterial A Material that computes diffusivity based on the average value of a variable as computed by a BlockAverageValue UserObject ExampleDiffusion The same Kernel we ve seen before that uses a diffusivity material property 293 313 WNL Idaho National Labor
26. default scalar values where you might expect a coupled value params addCoupledVar temperature 300 doc string If a variable is not supplied through the input file a properly sized variable containing the default value will be made available to you at each integration point in your domain Additionally you may also supply a Real value in the input file in lieu of a coupled variable name Consider using this feature to decouple your non linear problems for troubleshooting 92 313 Convection h C ifndef CONVECTION EH define CONVECTION EH include Kernel h class Convection template lt gt InputParameters validParams lt Convection gt class Convection public Kernel public Convection const std string amp name InputParameters parameters protected virtual Real computeQpResidual virtual Real computeQpJacobian private VariableGradient amp _grad_some_variable endif CONVECTION_H include Convection h template lt gt InputParameters validParams lt Convection gt InputParameters params validParams lt Kernel gt params addRequiredCoupledVar some variable Doc return params Convection Convection const std string amp name InputParameters parameters Kernel name parameters _grad_some_variable coupledGradient some variable E Real Convection computeQpResidual return _test _i _qp _grad_some_
27. element e Their residuals look similar to kernels Vu Vwi f wi Vu i n wi 0 VI Vu h g on Q Becomes Vu Vabi f Wi E 91 Yi 0 Vi e Also note that if Vu A O then the boundary integral is zero sometimes known as the natural boundary condition e In the following example gi av 104 313 0 WNL Idaho National Laborat 105 313 106 313 e NL Idaho National Laboratory Periodic BCs e Periodic boundary conditions are useful for modeling quasi infinite domains and systems with conserved quantities e MOOSE has full support for Periodic BCs 1D 2D and 3D With mesh adaptivity Can be restricted to specific variables Supports arbitrary translation vectors for defining periodicity 107 313 ANS SNL Idaho National Laboratory Periodic BCs e Normal usage with an BCs ae een ee axis aligned mesh use Pret auto_direction to supply the variable i i coordinate directions to wrap Works for any regular orthogonal mesh with defined boundaries o Advanced usage specify a a do a ae a translation or transformation function Cs er Petento cane o x variable u primary left BCs Periochie eves primary 1 secondary 4 cransitodm tune CZK CE V lav cransiodm tome c ms ice y secondary right translation 10 0 0 108 313 NNAL Idaho National Laboratory Pe
28. error type ElementHlError variable forced column in the output agile be dino of 12_eiewoi type ElementL2Error Element and Side Postprocessors generally take a variable argument to work on but can also be coupled to other variables just like Kernels BCs etc forced DER Gin variable function Postprocessor Values time dofs hi error 12 error 0 000000e 00 9 000000e 00 2 224213e 01 9 341963e 01 1 000000e 00 9 000000e 00 2 224213e 01 9 341963e 01 2 000000e 00 2 500000e 01 6 351338e 00 1 941240e 00 3 000000e 00 8 100000e 01 1 983280e 01 1 232381e 00 4 000000e 00 2 890000e 02 7 790486e 00 2 693545e 01 5 000000e 00 1 089000e 03 3 995459e 00 7 130219e 02 6 000000e 00 4 225000e 03 2 010394e 00 1 808616e 02 7 000000e 00 1 664100e 04 1 006783e 00 4 538021e 03 196 313 eee in Idaho National Laboratory Code Verification Using MMS Method of Manufactured Solutions MMS is a useful tool for code verification making sure that your mathematical model is being properly solved MMS works by assuming a solution substituting it into the PDE and obtaining a forcing term The modified PDE with forcing term added is then solved numerically the result can be compared to the assumed solution By checking the norm of the error on successively finer grids you can verify your code obtains the theoretical convergence rate i e
29. gt FileMesh rile lt irilenene gt Some other commonly used options uniform_refine lt n gt second_order lt true false gt The Mesh block is generally associated with an Action that reads and or constructs the mesh for the simulation The default type Fi leMesh is suitable for reading any normal mesh format from a file The base class MooseMesh can be extended to construct or modify your own Meshes during runtime as needed There are additional advanced options for this and the following blocks which are not listed in this section 41 313 e NL Idaho National Laboratory e The Variables block declares the De nonlinear variables that will be solved l nonlinear varialalel order lt FIRST SECOND for in the simulation family lt LAGRANGE HERMI ado a e The default order and family are FIRST and LAGRANGE respectively nonlinear variable2 42 313 e NL Idaho National Laboratory The Kernels Block e The Kernels block declares PDE E eas operators that will be used in the type lt Any Registered Kernel simulation variable lt Nonlinear Variabl laa e The type parameter is used to specify the type of kernel to instantiate my kernel2 43 313 WL Idaho National Laboratory The Boundary Conditions ock q e The BCs block declares the boundary BCs oat i i RO conditions that will be used in the typ
30. include ExampleIC h template lt gt InputParameters validParams lt ExampleIC gt InputParameters params validParams lt InitialCondition gt params addRequiredParam lt Real gt coefficient A coef return params ExampleIC ExampleIC const std string amp name InputParameters parameters InitialCondition name parameters _coefficient getParam lt Real gt coefficient Real ExampleIC value const Point amp p Lif 2 Ome Coe ee return 2 0 _coefficientxstd abs p 0 136 313 e WL Idaho National Laboratory Using ExamplelC include Examplel registerinitialCondi tion rxamnplel And use it in an input file MES mat 1 type Examplel variable u coefficient 2 0 p Hloecek E mat 2 type Examplel variable u coefficient 1 plock 2 e 137 313 Constant Initial Conditions Initial Condition Shortc Variables active lo lo u order FIRST family LAGRANGE For simple constant I Ligshiesell comebicioim i ef t Syntax Restart from an existing solution o Variables active m Leda order FIRST family LAGRANGE For reading a soluti from an Exodus JE 9L WL Idaho National Laboratory Wise well rrom Cile var on e diffused initial_from_file_timestep 2 are al
31. material is going to have a Real valued property named diffusivity that Kernels can use _diffusivity declareProperty lt Real gt diffusivity Declare that we are going to have an old value of diffusivity Note this is _expensive_ Only do this if you REALLY need it _diffusivity_old declarePropertyOld lt Real gt diffusivity void ExampleMaterial initQpStatefulProperties init the diffusivity property this will become _diffusivity_old in the first call of computeProperties Gv ftusivity op initial dittusivity void ExampleMaterial computeQpProperties O frusivityl_ p diffusivity oldi ap 2 151 313 WNL Idaho National Laborat Look at Examp le 9 pad 152 313 T Beginning End 153 313 Peacock The MOOSE GUI lad www inl gov Idaho National Laboratory SIN sy a WL Idaho National Laboratory Input File Syntax e As MOOSE grows so does the amount of input file syntax Remembering it all is definitely out of the question Capabilities do exist to help you out Any MOOSE based application can be run using app opt dump to dump out the input file syntax You can pass another optional argument to dump and the syntax will be searched for that string On the Wiki an up to date set of searchable syntax is automatically rebuilt for every application we know about Each of those solutions requires
32. situation will change when we add the ability to do sub cycling 300 313 o NL Idaho National Laboratory Positions e The positions parameter allows you to l define a coordinate offset of the sub app s 0 10 Master Domain 10 10 coordinates into the master app s domain e You must provide one set of x y Z coordinates for each sub app Sub Domain 0 1 1 1 e The number of coordinate sets determines the actual number of sub applications e If you have a large number of positions you can read them from a file using positions file filename 0 0 1 0 e You can think of the x y Z coordinates as 0 0 10 0 a vector that is being added to the coordinates of your sub app s domain to put that domain in a specific spot within the master domain e If your sub app s domain starts at 0 0 0 it is easy to think of moving that point around using positions e For sub apps on completely different scales positions is the point in the master domain where that App is 301 313 Parallel MultiApp 1 MultiApp 2 WL Idaho National Laboratory The MultiApp system is designed for efficient parallel execution of hierarchical problems The master application utilizes all processors Within each MultiApp all of the processors are split among the sub apps If there are more sub apps than processors each processor will solve for multiple sub apps All sub apps of
33. solution is the combination of the coefficients and the basis functions and just like polynomial fitting the solution can be sampled anywhere in the domain e We can numerically find the values of integrals using quadrature Newton s Method provides a mechanism for solving a system of nonlinear equations The Jacobian Free Newton Krylov JFNK method allows us to circumvent tedious and error prone derivative calculations 32 313 The MOOSE Framework lad www inl gov Idaho National Laboratory SN im Idaho National Laboratory i MOOSE Requirements e MOOSE requires several pieces of software to be in place before it will build MPI Hypre Optionally if you want to use AMG PETSc libMesh e f you are working on your own workstation you will have to compile install all of these e We maintain binary builds of these packages for the following operating systems Ubuntu deb OpenSUSE rpm tarball installer coming soon OS X 10 7 10 8 and 10 9 e https www mooseframework org Getting Started Instructions Issue System Documentation Blog and Wiki 34 313 Anatomy 0 WNL Idaho National Laborator e Any MOOSE based application should have the following directory structure application LICENSE Makefile run_tests doc lib src main C base actions auxkernels bcs dampers dirackernels executioners functions ics kernels ma
34. that you go out of your way to find out about a piece of input file syntax 155 313 ci i T i Idaho National Laboratory Peacock e Peacock is a an integrated Graphical User Interface GUI for building input files and interacting with a MOOSE based application It is built using PyQt and will look like a native application on Mac Linux and even Windows It is located under moose gui e We recommend you add that path to your PATH environment variable Peacock will automatically mold itself to the MOOSE based application you are trying to use It will intelligently try to pick up the executable you are trying to use but it can also be specified with e e Peacock caches the input file syntax for the application the first time you run it To re cache use in case the syntax has changed for the app use r 156 313 NL Idaho National Laboratory Input File Editor e The main tab is the input file editor You can Create Open Edit Save any MOOSE based application s input file Add a subsection for instance a Kernel by double clicking the main section to open the Parameter editor To edit an existing subsection double click it Main blocks with parameters use a ParentParams subsection holding the parameters for that block Check boxes indicate active Status The box on the right updates to show the changing input file
35. 0 FALCON Geo mechanics coupled mesoscale 3 months 3 000 MAMBA Chem Rxn Precipitation Porous Flow 5 weeks 2 500 HYRAX phase field ZrH precipitation 3 months 1 000 9 313 e NL Idaho National Laboratory Code Platform e MOOSE is a simulation framework allowing rapid development of new Physi Cs simulations tools Specifically designed to simplify Thermal Solid Mechanics Fluid Reaction Diffusion development of multiphysics tools Provides an object oriented we MOOSE sa pluggable system for defining all aspects of a simulation tool r Leverages multiple DOE l L bMesh developed scientific computational Mesh Finite Element Method Input Output tools e Allows scientists and engineers to develop state of the art simulation Solvers Interface capabilities PETSc SNES Trilinos NOX Maximize Science Currently 64 000 lines of code 10 313 IME os vee utoe N Idaho National Laboratory Current MOOSE Architecture Application BC s IC s E ai Average Total Flux Power 11 313 TT ci i W a Se N Idaho National Laboratory MOOSE Software Quality Practices e MOOSE currently meets all NQA 1 Nuclear Quality Assurance Level 1 requirements All commits to MOOSE undergo review using GitHub Pull Requests and must pass a set of application regression tests before they are available to our users All changes must be accompanied by issue numbers and assessed an appropria
36. 138 313 WL Idaho National Laborat 139 313 e NUL Idaho National Laboratory Example 7 Output diffused o 8 f 6 l 4 i 2 140 313 ENFEITE lad www inl gov Idaho National Laboratory e WL Idaho National Laboratory Materials a e Material objects declare coefficients for use by kernels Use declareProperty lt TYPE gt to declare a material property One virtual to override computeQpProperties Compute all of the declared properties at one quadrature point Can use coupled variables using the same functions that Kernel uses like coupledValue etal To use a material property use getMaterialProperty lt TYPE gt ina Kernel 142 313 SPM sony NIE oho National Laboratory Example 8 Overview e This is a convection diffusion problem with a non linear material property e The ExampleDiffusion kernel uses a coefficient produced from a linearly interpolated tabulated Material property e The ExampleMaterial object couples in the gradient of the diffused variable and uses it to make a gradient material property that will be coupled into the convected variable e The Convection kernel uses the gradient material property as a velocity vector 143 313 ExampleMaterial h C ifndef EXAMP ERIA define EXAMP ERIA include Material h include LinearInterpolation h Forward Declarations class ExampleMater
37. 27 650 elements 25 227 nodes e Features Large displacement formulation Plasticity Creep 223 313 t N L Idaho National Laboratory Flow Example MOOSE modules LO oA O ogo 7 o O ro 2 N q Ko D D o O 5 LO p O Nn O vo O EE Am mp a 6855 gt Ot 5 Boyds SEx Fe Og corn 295 o9H O E Al O A eo Didi lt L E op e E he Mon fo ON Y an BON of E 8 OQ RO O cS ZN DN O 19 Sw N ne E O Zo Sed feat TR D 2 o S l 9 Te LO E E N 245 41 120 87 224 313 MOOSE Internal SVN Development lad www inl gov Idaho National Laboratory o Developer Audiences e The MOOSE team currently supports several distinct developer audiences Internal Developer with access to INL servers External Developer without access to INL servers e SVN Developer working with an SVN checkout of INL MOOSE applications e GitHub Developer working with a git checkout of MOOSE from GitHub WNL Idaho National Laboratory 226 313 Developer Audiences e These training slides focus primarily on Internal SVN users both on and off site External GitHub users e Detailed instructions for Internal and External GitHub developers people who will commit to MOOSE are also available https mooseframework org static media uploads docs moose_github pdf 227 313 www mooseframework Instructions sup
38. 7 HEX8 27 x Constant Variables Name Activated_ Ranae Location Computed Variables Coordina x 0 5 20329 Node Time x 7000 7 85222e 06 Case Scalars Constants Variables Annotations Plots Queries Viewports Time Step 116 000000 Simulation 7852222 500000 Stork lad www inl gov Idaho National Laboratory re ju Idaho National Laboratory i Using Stork with an SVN checkout e Stork is a template application for delivering new applications e To create a new internal application run the following commands sva co Metos s hpesc sywn herd trunk comer unk Stork make_new_application py lt new animal name gt e This will create a new barebones application that contains The standard app directory layout The standard main C file A basic Application Object where you can register new physics A Makefile that will link against MOOSE and its modules 249 313 WL Idaho National Laboratory N e em Using Stork on GitHub e Goto http github com idaholab stork and click the Fork button e Rename your fork Click on your Repository then the Settings button Rename your repository e Clone your fork and run make new application py cd projects git clone https github com lt username gt lt app name gt git cd lt app name gt make new application py e Commit and push it Coummle em Serato my mew syojollicaicio im Y it pu
39. 76 313 MyObject h ifndef MYOBJECT H define MYOBJECT H include BaseClass h class MyObject template lt gt InputParameters validParams lt MyObject gt class MyObject public BaseClass public MyObject const std string amp name InputParameters params protected virtual SomeType inheritedMethod be endif MYOBJECT_H Anatomy of a MOOSE object a o MyObject C include MyObject h template lt gt InputParameters validParams lt MyObject gt InputParameters params validParams lt BaseClass gt return params MyObject MyObject const std string amp name InputParameters params BaseClass name params th SomeType MyObject inheritedMethod M Do Stra WL Idaho National Laboratory 77 313 Co x NAMI o National Laboratory Some Values Available to Kernels e uu _grad_u Value and gradient of variable this Kernel is operating on e pha grad phi Value and gradient V q of the trial functions at the q points o test _grad_test Value y and gradient V of the test functions at the g points e q point XYZ coordinates of the current q point e i J Current shape functions for test and trial functions respectively e ap Current quadrature point index e current elem pointer to the current element that is being operated on e And more 78 313 NL Idaho National Dif
40. Act ion in MOOSE s Act ionWarehouse 256 313 e Actions System Model Mesh 1 2 3 Kernels diffusion 4 Variables temp f 5 Parser Action System 257 313 WNL Idaho National Laborat Look at Example 15 pac 258 313 TimeSteppers Advanced Topic lad www inl gov Idaho National Laboratory e TimeSteppers e TimeSteppers are lightweight objects used for computing suggested time steps for transient executioners e Use by extending TimeStepper and overriding computeDT e Using a TimeStepper Is easier than extending the Transient class if all you want to do is provide a custom method for picking the time step e TimeSteppers have access to current and old values of time and dt as well as access to the Problemand Executioner WL Idaho National Laboratory 260 313 Built in T imeSteppers e NL Idaho National Laboratory e MOOSE has several built in TimeSteppers ConstantDT SolutionTimeAdaptiveDT FunctionDT PostprocessorDT DT2 e Example 16 creates a custom TimeStepper that multiplies the current time step size by a fixed ratio each time step until it reaches a user specified minimum value 261 313 WNL Idaho National Laborat Look at Example 16 pac 262 313 Dirac Kernels Advanced Topic lad www inl gov Idaho National Laboratory ANS SNL Idaho National Laboratory P
41. MOOSE Workshop How to get stuff done lad www inl gov Idaho National Laboratory q INT isto Notional Laboratory Table of Contents Overview a 4 Finite Elements The MOOSE Way fo 4 amp a 14 The MOOSE Framework 33 The Input File ee 37 Mesh Types ee 50 The Outputs Block ae a ee 60 InputParameters and MOOSE Types os 66 Kernels a 3 75 Coupling e a ee ee eG 85 Boundary Conditions E ee es ee a 98 Mesh Adaptiviy 110 Executioners 120 Initial Conditions 133 Materials a 141 Peacock e ee ee ass 154 Auxiliary System cc 159 Preconditioning 165 FUNCIONS us s gt W ER amp amp 183 Postprocessors 188 Parallel Agnostic Random Number Generation 201 MOOSEApp a 205 Testing ot oe pe SS 4 d 210 MOOSE Modules O Gs ap E do ee q 219 2 313 Table of Contents Il MOOSE Internal SVN Development 225 MOOSE External GitHub AORA a 239 Visualization Tools 4 Co 4 244 Stork e a ee 4 248 Custom Actions Advanced E fh Ga e SS 251 TimeSteppers Advanced 259 Dirac Kernels Advanced is a 4 263 Scalar Kernels Advanced 271 Geometric Search Advanced 277 Dampers Advanced eo 281 Discontinuous Galerkin Advanced E o amp 286 UserObjects Advanced Lc 288 MultiApps Advanced e dos ee SX 296 Tra
42. NAME f heavy a group GROUP not_group GROUP q p lt n gt o WL Idaho National Laboratory run n jobs at a time run tests in debug mode debug binary run just one set of tests help run regular tests and those marked heavy write separate log file for each failed test all the tests in a user defined group opposite of group option quiet don t print output of FAILED tests request to run each test with n procs 217 313 o WL Idaho National Laboratory Other Notes on Tests _ e Individual tests should run relatively quickly 2 second rule e Outputs or other generated files should not be checked into the subversion repository Do not check in the solution that is created in the test directory when running the test e The MOOSE developers rely on application tests when refactoring to verify correctness Poor test coverage Higher code failure rate 218 313 MOOSE Modules lad www inl gov Idaho National Laboratory SIN sy a WL Idaho National Laboratory MOOSE Modules e MOOSE comes with a library of community developed physics modules e The purpose of the modules is to encapsulate common kernels boundary conditions etc to prevent code duplication Examples include heat conduction solid mechanics Navier Stokes and others No export controlled physics i e neutronics should be put into the MOOSE modules e The module
43. NY May 3 7 2009 12 L Guo H Huang D Gaston and G Redden Modeling of calcite precipitation driven by bacteria facilitated urea hydrolysis in a flow column using a fully coupled fully implicit parallel reactive transport simulator In Eos Transactions American Geophysical Union 90 52 Fall Meeting Supplement AGU 90 52 San Francisco CA Dec 14 18 2009 13 R Podgorney H Huang and D Gaston Massively parallel fully coupled implicit modeling of coupled thermal hydrological mechanical processes for enhanced geothermal system reservoirs In Proceedings 35th Stanford Geothermal Workshop Stanford University Palo Alto CA Feb 1 3 2010 14 H Park D Knoll D Gaston and R Martineau Tightly Coupled Multiphysics Algorithms for Pebble Bed Reactors Nuclear Science and Engineering 166 2 118 133 2010 13 313 Finite Elements The MOOSE way lad www inl gov Idaho National Laboratory aa IN gt Idaho National Laboratory i Polynomial Fitting e To introduce the idea of finding coefficients to functions let s consider simple polynomial fitting In polynomial fitting or interpolation you have a set of points and you are looking for the coefficients to a function that has the form f x a bx cx e Where a b and c are scalar coefficients and 1 x x are basis functions e The idea is to find a b c etc such that f x passes through the points you are given e More generally you are looking
44. TimeDerivative kernels that are in MOOSE e In computeQpResidual Jacobian multiply your coefficient by TimeDerivative computeQpResidual Jacobian 126 313 o WNL Idaho National Laboratory include ExampleTimeDerivative h template lt gt InputParameters validParams lt ExampleTimeDerivative gt InputParameters params validParams lt TimeDerivative gt params addParam lt Real gt time_coefficient 1 0 Time Coefficient return params ExampleTimeDerivative ExampleTimeDerivative const std string amp name InputParameters parameters TimeDerivative name parameters This kernel expects an input parameter named time_coefficient _time_coefficient getParam lt Real gt time_coefficient is Real ExampleTimeDerivative computeQpResidual return _time_coefficient TimeDerivative computeQpResidual Real ExampleTimeDerivative computeQpJacobian return time coefficient TimeDerivative computeOpJacobian 127 313 e WL Idaho National Laboratory Transient Input Syntax e Add appropriate time derivative Kernels e Switch your executioner type to Transient e Add a few required parameters to the Executioner block Real time The start time for the simulation Real dt The initial time step size int t step The initial time step string scheme Time integrator scheme crank nicolson backward e
45. WNL Idaho National Laborat Look at Example 6 pag 131 313 a a i NN IN s Idaho National Laboratory Watch the Movie Using Paraview On a Laptop yY La 0 25 05 0 75 0 25 Time 1 0 Time 75 diffused 0 5 0 0 75 132 313 Initial Conditions lad www inl gov Idaho National Laboratory e WL Idaho National Laboratory Initial Condition System e Allows for creation of arbitrary initial conditions Can be spatially dependent e Allows for selection of initial condition from input file e If using an Exodusll mesh you can read the value of a variable from a previous simulation e Allows initial conditions to be coupled together Automatic dependency resolution 134 313 o WL Idaho National Laboratory Base Class e value const Point amp p Returns the value the variable should have at point p All InitialCondition classes MUST override this 135 313 ExamplelC h C ifndef EXAMPLEIC H define EXAMPLEIC H finclude InitialCondition h class ExampleIC template lt gt InputParameters validParams lt ExampleIC gt class ExampleIC public InitialCondition public ExampleIC const std string amp name InputParameters parameters virtual Real value const Point amp p private Reole oeri renent endif EXAMPLEIC_H J Idaho National Laboratory
46. _qp _velocity _qp _grad_phi _j _qp 146 313 WNL Idaho National Laborat Look at Example 8 pag 147 313 SANS q a ll SN Idaho National Laboratory Example 8 Output convected diffused 0 0857348 0 08 4 0 06 0 04 2 0 02 0 4 81e 40 148 313 Material Property Output e WL Idaho National Laboratory e Material properties may be automatically output via the input file outputs none Disables outputting of all properties to all possible outputs default outputs all Enables outputting of all properties to all possible outputs outputs exodus Enables outputting of all properties to the output named exodus from the TOutputs block output properties propertyl property2 Limits the output to the properties listed e Supported types include Real RealVectorValue and RealTensorValue 149 313 SR i Idaho National Laboratory Stateful Material Properties e It can sometimes be useful to have properties at quadrature points that have old values This situation often arises in solid mechanics for constitutive models like plasticity Traditionally this type of value is called a state variable In MOOSE they are Stateful Material Properties i e material properties that have old values To provide a material property with an old state just use declarePropertyOld lt TYPE gt and declarePropertyOlder lt TYPE gt
47. a 294 313 ANY CC TEN NL Idaho National Laboratory Example 20 Output After 4 time steps 0 75 0 25 After 10 time steps 0 75 0 25 295 313 MultiApps Advanced Topic lad www inl gov Idaho National Laboratory IL essa S WL Idaho National Laboratory MultiApps e MOOSE was originally created to solve fully coupled systems of PDEs e Not all systems need to be are fully coupled Multiscale systems are generally loosely coupled between scales Systems with both fast and slow physics can be decoupled in time Simulations involving input from external codes might be solved somewhat decoupled e To MOOSE these situations look like loosely coupled systems of fully coupled equations e AMultiApp allows you to simultaneously solve for individual physics systems 297 313 NL Idaho National Laboratory MultiApps Cont There is always a master App that is d doing the main solve MultiApp 1 J MultiApp 2 J Ro Ro A master App can then have any number z 3 J of MultiApps e Each MultiApp can represent many hence Multi sub apps The sub apps can be solving for completely different physics from the main application They can be other MOOSE applications or might represent external applications e Each App is considered to be a solve that is independent MultiApp 3 MultiApp 4 e Sub app Sub app
48. a given MultiApp are run simultaneously in parallel Multiple MultiApps will be executed one after another 302 313 Transfers Advanced Topic lad www inl gov Idaho National Laboratory pe TT NL Idaho National Laboratory Transfers While a MultiApp allows you to execute many solves in parallel it doesn t allow for data to flow between those solves A Transfer allows you to move fields and data both to and from the master and sub applications There are three main kinds of Transfers Field interpolation UserObject interpolation volumetric value evaluation Value transfers like Postprocessor values Most Transfers put values into AuxVariable fields The receiving application can then couple to these values in the normal way Idea each application should be able to solve on its own and then later values can be injected into the solve using a Transfer thereby coupling that application to the one the Transfer came from 304 313 ANS SNL Idaho National Laboratory Field Interpolation Eo ire e An interpolation Transfer should be type MultiAppMeshFunctionTransfer direction from_multiapp multi_app sub source_variable sub_u variable transferred_u T A TO silo type MultiAppMeshFunctionTransfer direction to_multiapp multi_app sub source_variable u variable from_master used when the domains have some overlapping geo
49. aboratory Aux Variables e The auxiliary system s purpose is to allow explicit calculations using nonlinear variables These values can be used by kernels BCs and material properties Just couple to them as if they were a nonlinear variable They will also come out in the output file useful for viewing things you don t solve for e g velocity Auxiliary variables currently come in two flavors Element constant monomials Nodal linear Lagrange When using element auxiliary variables You are computing average values per element You can couple to nonlinear variables and both element and nodal auxiliary variables When using nodal auxiliary variables You are computing values at nodes You can only couple to nonlinear variables and other nodal auxiliary variables Auxiliary variables have old states just like nonlinear variables 160 313 e WL Idaho National Laboratory Aux Kernels iia e Aux kernels should go under include auxkernels and src auxkernels e They are similar to regular kernels except that they override computeValue instead of computeQpResidual They don t have Jacobians Note that there is no physical difference between a nodal auxiliary kernel and an elemental The difference is only in the input file 161 313 o WNL Idaho National Laboratory o u _grad_u Value and gradient of variable this AuxKernel is operating on q point
50. about svn add filename To see the actual modifications you have made to a file you can do svn diff filename When you are ready to commit your changes you first need to update your copy of the code svn update Note that this can fail if someone else modified the same piece of code you did You will get a conflict that you will have to resolve Just ask us the first time this happens O The next step before committing is to rerun the tests to make sure you haven t broken anything for your application o cun tests Finally when you are happy with the changes you have made and you ve svn added all the new files you can commit your changes using svn commit m Some descriptive message 235 313 eee Sin Idaho National Laboratory i Internal Wiki e The MOOSE Wiki is a one stop shop for information on how to develop applications using pg nc CN BH MOOSE libMesh Bookmark on Delicious STIMS MOOSE P am a a MOOSE Trac e To get to the wiki just point your browser to Ss eee me T a https hpcsc moose o E e Log in using your INL HPC username and a ce password a e The first thing you will see is the Wiki desen e Anyone can add or edit any page on the Wiki in fact it s encouraged e In the middle of the front page are links to C Tickets that are relevant to you explained in a a moment ue e On the right side is a menu with a lot of l
51. ace V Un x 9Ptace nn x 9Ptace 9Ptace gt Wapbi Xgo B Xgp VUn Xap qp WopWi Xqp f Xap qp 27 313 e Newton s Method e We now have a nonlinear system of equations Ri un 0 l PR to solve for the coefficients u j 1 N e Newton s method has good convergence properties we use it to solve this system of nonlinear equations e Newton s method is a root finding method it finds zeros of nonlinear equations e Newton s Method in Update Form for f x R gt R F Xn xn f Xn Xn 1 Xn Xn 1 WL Idaho National Laboratory 28 313 o WL Idaho National Laboratory _ Newton s Method Continue e We don t have just one scalar equation we have a system of nonlinear equations e This leads to the following form of Newton s Method J Un dUn1 R U Un 1 Un T dUn i e Where J un is the Jacobian matrix evaluated at the current iterate Es 9R Un Jj Un Ou e Note that On O 4 4 Ve yr O du dy F ay gt au UV ox V 29 313 0 T i gt daho National Laboratory Newton For A Simple Equation Consider the convection diffusion equation with nonlinear k 6 and f V kVu 8 Vu f The i component of the residual vector is Fi un Vi KV un Yi KV un Wi B Vun Wi f Using the previously defined rules for a and oe the entry of the Jacobian is then k P a Jij Un
52. adient Vw of the test functions at the q points e And more o aq point XYZ coordinates of the current q point cd ye i Current shape functions for test and trial functions respectively ap Current quadrature point 267 313 ExampleDirac h C ifndef EXAMPLEDIRAC H define EXAMPLEDIRAC H MOOSE Includes include DiracKernel h Forward Declarations class ExampleDirac template lt gt InputParameters validParams lt ExampleDirac gt class ExampleDirac public DiracKernel public ExampleDirac const std string amp name InputParameters parameters virtual void addPoints virtual Real computeQpResidual protected Real _value std vector lt Real gt point param ROME 19 endif EXAMPLEDIRAC H Idaho National Laboratory include ExampleDirac h template lt gt InputParameters validParams lt ExampleDirac gt InputParameters params validParams lt DirackKernel gt params addRequiredParam lt Real gt value params addRequiredParam lt std vector lt Real gt gt point return params ExampleDirac ExampleDirac const std string amp name InputParameters parameters DiracKernel name parameters value getParam lt Real gt value point param getParam lt std vector lt Real gt gt point _p 0 point param 0 if point param size
53. an interface for Material classes to access the data 289 313 be i q i N Idaho National Laboratory UserObject Anatomy All UserObjects must override the following functions le virtual void initialize Called just one time before beginning the Userobject calculation Useful for resetting data structures 2 virtual void execute Called once on each geometric object element node or side or just one time per calculation fora GeneralUserObject This is where you actually do your calculation read data etc 3 virtual void threadJoin const UserObject amp y During threaded execution this function is used to join together calculations generated on different threads In general you need to cast y to a const reference of your type of UserOb ject then extract data from y and add it to the data in this object Note this is not required for a GeneralUserOb ject because it is not threaded 4 virtual void finalize The very last function called after all calculations have been completed In this function the user must take all of the small calculations performed in execute and do some last operation to get the final values Be careful to do parallel communication where necessary to ensure all processors compute the same values 290 313 ae im Idaho National Laboratory UserObject Anatomy Cont e AUserObject defines its own interface by defining const accessor
54. angles are extruded to prisms wedges Quadrilaterals are extruded to hexahedra Sidesets are extruded and maintained Top and bottom sidesets can be specified The extrusion vector should be specified direction and length Extruded Mesh result from MAMBA courtesy of Michael Short 59 313 The Outputs Block lad www inl gov Idaho National Laboratory k ANS eS SNL Idaho National Laboratory The Outputs Block e The output system is like any other system in MOOSE modular and expandable Lont ente file_base lt base_file_name gt e Itis possible to create multiple output objects a each outputting at different intervals different variables or varying file types e Supports short cut syntax common Eee o output_initial true parameters and sub blocks vtk true console type Console petit log true Wi exodus type Exodus output initial false a exodus_displaced type Exodus file base displaced use_displaced true interval 3 ae 61 313 NL Idaho National Laboratory Supported Formats Format Short cut Syntax Console screen console true Exodus Il exodus true VTK vtk true GMV gmv true Nemesis nemesis true Tecplot Ltecplot true XDA xda true XDR xdr true CSV csv true GNUplot gnuplot true Checkpoint checkpoint true type type type type type type type type type type type Sub b
55. atives e To use all off diagonal blocks you can use the following input file syntax full true 174 313 aA q CC TEN AL Idaho National Laboratory Finite Difference Preconditioning FDP e The Finite Difference Preconditioner FDP allows you to form a Numerical Jacobian by doing direct finite differences of your residual statements e This is extremely slow and inefficient but is a great debugging tool because it allows you to form a nearly perfect preconditioner e You specify it by using CYPE FDP e You can use the same options for specifying off diagonal blocks as SMP Since FDP allows you to build the perfect approximate Jacobian it can be useful to use it directly to solve instead of using JFNK The finite differencing is sensitive to the differencing parameter which can be specified using petsc_options_iname mear ro colorinquerr mat re tys petsc_options_value le 6 disk e NOTE FDP currently works in serial only This might change in the future but FDP will always be meant for debugging purposes 175 313 ANS SNL Idaho National Laboratory Examples Executioner petsc_options_iname pec type pc_hypre_type ksp gmres restart petsc options value hypre boomeramg LOIL e Default Preconditioning Matrix Preconditioned JFNK monitor linear solver variable linear solver tolerance e Use Hypre with algebraic multigrid and store 101 Krylov vectors Preconditioni
56. c6200 i 1 at MooseArray h 256 0x0100007cf0 in ExampleDiffusion computeQpResidual this 0x1028c5a00 at ExampleDiffusion C 44 0x01008ed71la in Kernel computeResidual this 0x1028c5a00 at Kernel C 133 e This backtrace shows that in ExampleDiffusion computeQpResidual atline 44 of the file ExampleDiffusion c we attempted to use operator to index into something and failed e f we look at this line we see return _diffusivity _qp Diffusion computeQpResidual e There is only one thing we re indexing into on that line diffusivity e Therefore we can look at how _diffusivity was declared realize that we forgot an ampersand s and fix it 312 313 Cam WL Idaho National Labora THE END 313 313
57. ckedDish Command Error History Working Directory Applications Cubit 12 1 J Idaho National Laboratory 52 313 TT ci i N Idaho National Laboratory FileMesh e FileMesh is the default type when the type parameter is omitted from the Mesh section e MOOSE supports reading and writing a large number of formats and could be extended to read more dat Tecplot ASCII file e exd Sandia s Exodusll format fro ACDLs surface triangulation file gmv LANLs GMV General Mesh Viewer format mat Matlab triangular ASCII file read only msh GMSH ASCII file write only n nem Sandia s Nemesis format plt Tecplot binary file write only poly TetGen ASCII file write only inp Abaqus inp format read only UCC AVS s ASCII UCD format UNV l deas Universal format xda xdr libMesh formats vik Visualization Toolkit 53 313 e WL Idaho National Laboratory Generated Mesh e type GeneratedMesh Built in mesh generation is implemented for lines rectangles and rectangular prisms boxes but could be extended The sides of a GeneratedMesh are named in a logical way bottom top left right front and back The length width and height of the domain and the number of elements in each direction can be specified independently 54 313 E im Idaho National Laboratory Named Entity Support Mesh file three block e These names will be applied o
58. diffusivity e Not storing this as a reference will cause a copy of the MaterialProperty to be made e That copy will never be resized nor will values ever be inserted into it e Attempting to access that MaterialProperty results in a segfault Solving time step 1 time 0 1000000 Segmentation fault 11 e We can use a debugger to help us find the problem 310 313 9 TT NL Idaho National Laboratory i Debug Executable e To use a debugger with a MOOSE based application you must do the following 1 Compile your application in debug mode ed projects moose examples ex21_debugging METHOD dbg make j8 e You will now have a debug version of your application called appname dbg e Next you need to run your application using GDB gala args ex2Zi cCloe i 21 1 e args tells GDB that any arguments after the executable should be passed to the executable e This will start GDB load your executable and leave you at a GDB command prompt 311 313 e NNL Idaho National Laboratory Using GDB or LLDB e At any prompt in GDB or LLDB you can type h and hit enter to get help e We need to set a breakpoint at MPT_Abort in order to catch any crashes b MPI abort To run your application type r and hit enter After your application has crashed type where or bt to see a backtrace 0x0101e2baff in MET Abort 0x0100008d89 in MooseArray lt double gt operator this 0x1028
59. e lt Any Registered BC gt simulation variable lt Nonlinear Variable Name gt Laas e The type parameter is used to specify the type of boundary condition to instantiate ay TOBE 44 313 e NL Idaho National Laboratory The Executioner Block e The Executioner block declares the Executioner 7 i type lt Steady Transient oso gt executioner that will be used in the simulation e The type parameter is used to specify the type of executioner to instantiate 45 313 Com NL Idaho National Laborato The Outputs Block e The Outputs block controls the Outputs i o E te eee various output to screen and file used exodus true in the simulation console true 46 313 Example Input File Idaho National Laboratory Mesh file mug e 1 Variables active diffused diffused order FIRST family LAGRANGE fool Kernels active diff Acabo type Diffusion variable diffused eai BCs active bottom top bottom type DirichletBC variable diffused boundary bottom value 1 EEA leaa type DirichletBE variable diffused boundary top value 0 eee all Executioner type Steady Outputs file_base out exodus true console true 47 313 WL Idaho National Laborat 48 313 NS s Te ll N Idaho National Labo
60. e off diagonal blocks is the way MOOSE will precondition when using the default solve type 172 313 o Pn N on Idaho National Laboratory The Preconditioning Block Preconditioning active my_prec my_prec type SMP SMP Options Go Here Override PETSc Options Here RA other_prec type PBP PBP Options Go Here Override PETSc Options Here The Preconditioning block allows you to define which type of preconditioning matrix to build and what process to apply You can define multiple blocks with different names allowing you to quickly switch out preconditioning options Each sub block takes a type parameter to specify the type of preconditioning matrix Within the sub blocks you can also provide other options specific to that type of preconditioning matrix You can also override PETSc options here Only one block can be active at a time 173 313 im Idaho National Laboratory Single Matrix Preconditioning SMP e The Single Matrix Preconditioner SMP builds one matrix for preconditioning e You enable SMP with type SMP e You specify which blocks of the matrix to use with gu TY OPE olac Cow r orr Cilag collwn e Which would produce an M like this k s T V j Vwi 0 26 2 vs Vei D s DV o Vu e In order for this to work you must provide a computeQpoffDiagJacobian function in your Kernels that computes the required partial deriv
61. ep You can also reset less often e g Jacobian timestep or simulation initialization only Generators are advanced every time step unless you explicitly set the reset frequency to EXEC_INITIAL A multi level random seeding scheme is used to avoid patterning from mesh entity to mesh entity timestep to timestep and run to run 204 313 MooseApp and main lad www inl gov Idaho National Laboratory o cm Idaho National Laboratory MooseApp Base Class e A MOOSE Application MooseApp is just another plugable system e Your application will contain a MooseApp derived class e Each MooseApp is responsible for holding on to a number of essential objects such as the Factories where its objects are built and the Warehouses where its objects are stored e In this way MooseApp objects can be combined coupled together to form larger simulations See the MultiApp System e MooseApp objects also supply validParams like any other MOOSE object Parameters for MooseApps are extracted from the Command Line with special functions on InputParameters InputParameters addRequiredCommandLineParam InputParameters addCommandLineParam 206 313 a q NH NL Idaho National Laboratory Your AnimalApp h C e Your application will contain a MooseApp derived class which will contain a coupled of key static functions registerApps registerObjects associateSyntax op
62. for d f x gt cx i 0 where the c are coefficients to be determined f x is unique and interpolary if d 1 is the same as the number of points you need to fit Need to solve a linear system to find the coefficients 15 313 NL Idaho National o Example Points Linear System Solution A 1 1 1 fa 4 8 3 4 1 3 9 b 1 23 4 2 1 4 16 e 2 5 16 313 ci i T i Idaho National Laboratory Example Continued e First note that the coefficients themselves don t mean anything By themselves they are just numbers Second the solution is not the coefficients but rather the function they create when they are multiplied by their respective basis functions and summed Yes f x does go through the points we were given but it is also defined everywhere in between e We can evaluate f x at the point x 2 say by computing 2 2 f 2 gt c 2 or more generically f 2 X cgi 2 i 0 i 0 where the c correspond to the coefficients in the solution vector and the g are the respective functions Finally Note that the matrix consists of evaluating the functions at the points 17 313 CC TEN AL Idaho National Laboratory Finite Elements Simplified A method for numerically approximating the solution to Partial Differential Equations PDEs Works by finding a solution function that is made up of shape functions multiplied by coefficients and added together
63. functions e When another MOOSE object uses a UserOb ject they do so by calling these accessor functions e For example if a UserObject is computing the average value of a variable on every block in the mesh it might provide a function like Real averageValue SubdomainID block const e Another MOOSE object using this Userobject would then call averageValue to get the result of the calculation e Take special note of the const at the end of the function declaration e This const means the function cannot modify any member variables of the object and is required for UserObject accessor functions 291 313 NINL Idaho Notional Laboratory Using UserObjects e Any MOOSE object can retrieve a UserObject in a manner similar to retrieving a Function e Generally it is a good idea to take the name of the UserOb ject to use from the input file template lt gt InputParameters validParams lt BlockAverageDiffusionMaterial gt InputParameters params validParams lt Material gt params addRequiredParam lt UserObjectName gt block average userobject Doc return params AUserObject comes through as a const reference of the UserObject type So in your class const BlockAverageValue amp _block_average_value e Set the reference in the initialization list of your object by calling the templated get UserOb ject function BlockAverageDiffusionMaterial BlockAverageDiffusionMaterial
64. fusion V Vu f 0 Ulan 9 Vu v g2 e Multiply by test function integrate V Vu di f Yi 0 e Integrate by parts Vu Vi f pi 92 vi 0 e Jacobian Voj Vy 79 313 Diffusion Diffusion h ifndef DIFFUSION_H define DIFFUSION_H include Kernel h class Diffusion template lt gt InputParameters validParams lt Diffusion gt class Diffusion public Kernel public Diffusion const std string amp name InputParameters params protected virtual Real computeQpResidual virtual Real computeQpJacobian endif DIFFUSION_H o WL Idaho National Laboratory Diffusion C include Diffusion h template lt gt InputParameters validParams lt Diffusion gt InputParameters params validParams lt Kernel gt return params Diffusion Diffusion const std string amp name InputParameters params Kernel name params Real Diffusion computeQpResidual return _grad_test _i _qp _grad_u _gqp Real Diffusion computeQpJacobian return _grad_test _i _qp _grad_phi _j _qpl 80 313 SS NAMI o National Laboratory Kernel Registration e Before a Kernel is available for use it must be registered with the Factory inside your main application C file e g SomeApp C include Diffusion h int SomeApp registerObjects Factory amp factory registerkKe
65. ial template lt gt InputParameters validParams lt ExampleMaterial gt class ExampleMaterial public Material public ExampleMaterial const std string amp name InputParameters parameters protected virtual void computeQpProperties private MaterialProperty lt Real gt amp _diffusivity Material Property lt ReallGradient gt amp iconv vel Nonlinear coupling VariableGradient amp _diffusion_gradient Table data property LinearInterpolation _piecewise_func hi endif EXAMPL ERIAL H Idaho National Laboratory include ExampleMaterial h template lt gt InputParameters validParams lt ExampleMaterial gt InputParameters params validParams lt Material gt params addRequiredParam lt std vector lt Real gt gt independent_vals params addRequiredParam lt std vector lt Real gt gt dependent_vals params addCoupledVar diffusion gradient Doc return params ExampleMaterial ExampleMaterial const std string amp name InputParameters parameters Material name parameters Declare that this material is going to provide a Real prop _diffusivity declareProperty lt Real gt diffusivity Declare that this material is going to provide a RealGradient _conv_vel declareProperty lt RealGradient gt convection_velocity Get the reference to the variable coupled into this Material _diffus
66. ides an extendable Test Harness for executing your code with different input files e Each kernel or logical set of kernels you write should have test cases that verify the code s correctness e The test system is very flexible You can perform many different operations for example testing for expected error conditions e Additionally you can create your own Tester classes which extend the Test Harness 211 313 Tests setup e e Related tests should be grouped into an individual directory and have a consistent naming convention e We recommend organizing tests in a hierarchy similar to your application source i e kernels BCs materials etc e Tests are found dynamically by matching patterns highlighted below tests kernels my_kernel_test my kernel test e my kernel test i tests gold out e input mesh input file a specification file Lg s ld standard folder validated solution olution WL Idaho National Laboratory 212 313 o WNL Idaho National Laboratory A quick look at the test fication file e Same format as the standard MOOSE input file speci Tests my_kernel_test TYS Exodiff input my kernel cest exodiff my kernel test ouc e ee kernel_check_exception type RunException LAVE my kernel exception i expect_err Bad stuff happened with variable wt 213 313 e WL Idaho National Laboratory
67. inks to one info about developing applications using c MOOSE e The top menu allows you to navigate to different sections of the site e The first time you login you will need to go to Preferences and set your name and email address 236 313 WL Idaho National Laboratory Trac Tickets Tickets are bug reports or feature requests for your application If you run into a bug or think of a feature you would like just click on New Ticket and fill out the form When a new ticket is submitted and assigned an Owner he or she will automatically receive email regarding it If you don t know who the owner should be just leave it blank To view tickets you can either use the links provided on the front page of the Wiki or click on View Tickets and select a report When submitting bug reports try to be as thorough as possible Attach relevant input files Reference a specific test or example in the repository Tickets are bug reports for MOOSE must be submitted via www github com ale New Ticket MOOSE a a e Jab netps hpesc data trac FPCP newticket e OO FE MOOSE libMesh Bookmark on Delicious STIMS metida mos DE ed in as gastdr Logout Preferences Help Guide About Trac Timell ine Roadmap Browse Source View Tickets EES Search Doxygen Create New Ticket Summary y Report dr Description BIA
68. ion_gradient isCoupled diffusion gradient coupledGradient diffusion_gradient _grad_zero _piecewise_func getParam lt std vector lt Real gt gt independent_vals getParam lt std vector lt Real gt gt dependent_vals ie void ExampleMaterial computeQpProperties sample the function using the z coordinate _diffusivity _qp _piecewise_func sample _q_point _qp 2 conv_vel _qp _diffusion_gradient _qp 144 313 ExampleDiffusion h C with Material ifndef EXAMPLEDIFFUSION H define EXAMPLEDIFFUSION H include Diffusion h Forward Declarations class ExampleDiffusion template lt gt InputParameters validParams lt ExampleDiffusion gt class ExampleDiffusion public Diffusion public ExampleDiffusion const std string amp name InputParameters parameters protected virtual Real computeQpResidual virtual Real computeQpJacobian MaterialProperty lt Real gt amp _diffusivity hi endif EXAMPLEDIFFUSION_H Idaho National Laboratory rial P Property include ExampleDiffusion h template lt gt InputParameters validParams lt ExampleDiffusion gt InputParameters params validParams lt Diffusion gt return params ExampleDiffusion ExampleDiffusion const std string amp name InputParameters parameters Diffusion name parameters _diffusivity getMa
69. itial guess here will likely converge Root 283 313 WNL Idaho National Laborat Look at Example 19 page 284 313 a NL Idaho National Laboratory Example19 Output Damping 1 0 Damping 0 9 Outputting Initial Condition Outputting Initial Condition True Initial Nonlinear Residual 10 4403 True Initial Nonlinear Residual 10 4403 NL step 0 residual _2 1 044031e 01 NL step 0 residual 2 1 044031e 01 NL step 1 residual _2 6 366756e 05 NL step 1 residual _2 1 044031e 00 NL step 2 residual _2 3 128450e 10 NL step 2 residual 2 1 044031e 01 0 3 128450e 10 NL step 3 l residual 2 1 044031e 02 NL step 4 residual 2 1 044031e 03 NL step 5 residual 2 1 044031e 04 NL step 6 residual 2 1 044031e 05 NL step 7 residual 2 1 044031e 06 NL step 8 residual 2 1 044031e 07 NL step 9 residual 2 1 044031e 08 0 1 044031e 08 285 313 Discontinuous Galerkin Advanced Topic lad www inl gov Idaho National Laboratory MS Idaho National Laboratory Discontinuous Galerkin e Discontinuous Galerkin is a set of methods that rely on a discontinuous set of shape functions across the domain Essentially the idea is to allow discontinuities in the value of the function you are solving for along element boundaries e DG then relies on penalizing the j
70. le to BCs Integrated BCs Non Integrated BCs o u _grad_u Value and gradient of variable this BC is operating on e _u o q m l phi _grad_phi Value and gradient V amp of the trial Boundary id functions at the q points e current node A pointer to the O test _grad_test Value 1 and gradient Vw of the test current node that is being operated on functions at the q points e And more _q_point XYZ coordinates of the current q point e i _j Current shape function indices for test and trial functions respectively e ap Current quadrature point index O normals Normal vector at the current quadrature point _boundary_id The boundary ID this BC is currently computing on e current elem A pointer to the element that is being computed on O current side The side number of current elemthatis currently being computed on 100 313 e WNL Idaho National Laboratory Coupling and BCs e The coupling of values and gradients into BCs is done the same way as in kernels and materials coupledValue coupledValueOld coupledValueOlder coupledGradient coupledGradientOld coupledGradientOlder coupledDot 101 313 e NL Idaho National Laboratory Dirichlet BCs e Set a condition on the value of a variable on a boundary e Usually these are NOT integrated over the boundary e Non integrated BCs can t pro
71. level Level 0 1 2 o CAE FH WNL Idaho National Laboratory E A Er 112 313 Indicators e Indicators attempt to report a relative amount of error for each element e Built in Indicators include GradientJumpIndicator Jump in the gradient of a variable across element edges pictured to the right A good curvature indicator that works well over a wide range of problems FluxJumpIndicator Same as Gradient Jump except it can multiply by a scalar diffusivity like thermal conductivity to compute the real flux jump LaplacianJumpIndicator Jump in the second derivative of a variable Only useful for C shape functions AnalyticIndicator Computes the difference between the finite element solution and a given Function that usually represents the analytic solution to the problem e In higher dimensions the gradient jump is integrated around element edges to find contributions to each connected element 113 313 Markers e After an Indicator has computed the error for each element a decision to refine or coarsen elements must be made e The Marker class is used for this purpose Built in Markers include ErrorFractionMarker Selects elements based on how much each element contributes to the total error pictured to right ErrorToleranceMaker Refine if error over a specified value Coarsen if under ValueThresholdMarker
72. lock Type Console Exodus VTK GMV Nemesis Tecplot XDA XDR CSV GNUP lot Checkpoint 62 313 o TT NL Idaho National Laboratory Over Sampling e None of the generally available visualization ne packages currently display higher order console true 4 exodus solutions quadratic cubic etc natively Sg ae ee ern type Exodus o oversample true e To work around this limitation MOOSE can refinements 3 oversample a higher order solution by projecting it onto a finer mesh of linear elements e Note This is not mesh adaptivity nor does it improve the solution s accuracy in general e The following slide shows a sequence of solutions oversampled from a base solution on second order Lagrange elements 63 313 Over Sampling Refinements 0 to 5 levels s CC TN NT AL Idaho National Laboratory Over Sampling Cont e It s important to note that oversampling will not improve the solution e The solution on the left is solved on a coarse grid e The solution in the center is the same as on the left but has been oversampled for visualization purposes e The solution on the right is for the same problem but solved on a finer mesh and is therefore closer to the true solution 65 313 Input Parameters and MOOSE Types lad www inl gov Idaho National Laboratory k DN pe SNL Idaho National Laboratory Valid Parameters e set of cust
73. main 92 Integrate by parts use the divergence theorem to get the desired derivative order on your functions and simultaneously generate boundary integrals Code up with MOOSE and run 19 313 o ci Idaho National Laboratory i Refresher The divergence gt theorem e Transforms a volume integral into a surface integral i V Fdx F hds Q oQ e In finite element calculations for example with F k x Vu the divergence theorem implies tv KVU dx vu k x Vu ax w k x Vu n ds Q Q od e In this talk we will use the following inner product notation to represent integrals since it is more compact y V k x Vu Vu k x Vu y k x Vu e http en wikipedia org wiki Divergence theorem 20 313 e NL Idaho National Laboratory 1 V kVu 8 Vu f 2 V kVu 6 Vu f 0 3 W V kVu y 8 Vu vf 0 4 V kKV Vu f 0 fv u o u f 5 Vuw kVu kVu h Vu f 0 ve u fw uA fo u f 6 Vy kVu tp KVU A Y B Vu 4 f 0 Ce a Na A Kernel BC Kernel Kernel 21 313 ANS SNL Idaho National Laboratory More Depth e While the weak form is essentially what you need for adding physics to MOOSE in traditional finite element software more work is necessary e The next step is to discretize the weak form by selecting an expansion of u N US Uh gt Uj j j 1 The q are generally called shape functions In the expansi
74. metry The source field is evaluated at the destination points generally nodes or element centroids The evaluations are then put into the receiving AuxVariable field named variable All MultiAppTransfers take a direction parameter to specify the flow of information Options are from multiapp Or to_multiapp 305 313 Transfers layered_transfer type MultiAppUserObjectTransfer direction from_multiapp multi_app sub_app user_object layered_average variable multi_layered_average o WL Idaho National Laboratory e Many UserObjects compute spatially varying data that isn t associated directly with a mesh e Any UserObject Can override Real spatialValue Point amp to provide a value given a point in space e AUserObjectTransfer can sample this spatially varying data ffom one App and put the values into an AuxVariable in another App 306 313 pe _ _ NL Idaho National Laboratory Single Value Transfers Transfers sample_transfer type MultiAppVariableValueSampleTransfer direction to_multiapp multi_app sub execute_on timestep source_variable u variable from_master Peal pp_transfer type MultiAppPostprocessorInterpolationTransfer direction from_multiapp multi_app sub WOSeOBOCe Sis aa variable from_sub average A single value transfer will allow you to transfer scalar values between applications This is useful for Post
75. n that element We need to evaluate the shape function at xo and multiply the result by the point load This is what a DiracKernel achieves 265 313 k DN Null SNL Idaho National Laboratory Dirac Kernels e ADiracKernel provides a residual and optionally a Jacobian at a set of points in the domain The structure is very similar to kernels computeQpResidual computeQpJacobian Parameters Coupling Material Properties etc The only difference is that DiracKernel must override addPoints to tell MOOSE the points at which DiracKernel is active Inside of addPoints there are two different ways to notify MOOSE of the points addPoint Point p e Adds the physical point p that lies inside the domain of the problem addPoint Elem s e Point p e Adds the physical point p that lies inside the element e The second version is much more efficient if you Know a priori the element in which the point is located 266 313 o N Se i NEM voo National Laboratory Some Values Available to u _grad_u Value and gradient of variable this DiracKernel is operating on A pointer to the current element that is being operated on O current elem o phi _grad_phi Value amp and gradient V of the trial functions at the q points The Point where the DiracKernel is currently being asked to compute O current point O test grad test Value wz and gr
76. n the ily tco the mesh SO Chat they cam De sed iim the input file In addition they will be written to the output file rockia lt n237 lock name wood steel copper boundary id i 2Y boundary name left right Human readable names can be assigned to blocks sidesets and nodesets These names will be automatically read in and can be used throughout the input file This is typically done inside of Cubit Any parameter that takes entity IDs in the input file will accept either numbers or names Names can also be assigned to IDs on the fly in existing meshes to ease input file maintenance see example On the fly names will also be written to Exodus XDA XDR files 55 313 SIN sy a WL Idaho National Laboratory Parallel Mesh e Useful when the mesh data structure dominates memory usage e Only the pieces of the mesh owned by processor N are actually stored by processor N e f the mesh is too large to even read in on a single processor it can be split prior to the simulation Copy the mesh to a large memory machine Eos at the INL Use a tool to split the mesh into n pieces SEACAS loadbal Copy the pieces to your working directory on the cluster Use the Nemesis reader to read the mesh using n processors e See nemesis_test iinthe moose_test directory for a working example 56 313 iu Idaho National Laboratory Displaced Mesh e Calculations
77. nce from a Slave node to a Master side and the contact point on the Master side Masten Nodes Slave Nodes The distance returned is negative if penetration hasn t yet occurred and positive if it has Penetration ce e TogetaNearestNodeLocator 2 2 2 2 Ap T include PenetrationLocator h and call E Contact Point getPenetrationLocator master i slave_id to create the object The algorithm in PenetrationLocator utilizes a NearestNodeLocator so patch size Is still important 280 313 Dampers Advanced Topic lad www inl gov Idaho National Laboratory pe TT NL Idaho National Laboratory Dampers e Dampers allow computation of the Newton damping or scaling parameter alpha Regular Newton Damped Newton J un1 R un J un R un Un 1 Un Un Unit Un AdUn 1 e Where a is a number between 0 and 1 Essentially taking some fraction of the step you just solved for e Damper is created by inheriting from Damper and overriding computeQpDamping e computeQpDamping computes a damping parameter at each quadrature point throughout the mesh The smallest damping parameter computed is then actually used e Dampers have access to variable values gradients material properties and functions just like a kernel In addition they have access to the Newton Increment 282 313 Com NEM cto National Laboratory Initial guess here may not converge In
78. ne their value Common expressions like sin and pi are IBES A active built in all l type FunctionDirichletBC e After you have declared your functions variable u p boundary 1 2 you can use them in objects like ue Gene FunctionDirichletBC 186 313 WNL Idaho National Laborat Look at Example 13 p 187 313 Postprocessors and Code Verification lad www inl gov Idaho National aboratory o WL Idaho National Laboratory Postprocessors e APostprocessor is an explicit calculation based on the values of your simulation variables e They are computed when needed using the execute_on option in the input file execute_on timestep execute_on initial execute_on jacobian execute on residual execute on timestep begin e They can be restricted to specific blocks sidesets and nodesets in your domain e The output from a Postprocessor is one scalar number e Think of Postprocessors as Reductions or Aggregations 189 313 e WL Idaho National Laboratory Types of Postprocessors e Element Operate on each element Can be restricted to subdomains by specifying one or more block ids Inherit from ElementPostprocessor e Nodal Operate on each node Can be restricted to nodesets by specifying one or more boundary ids Inherit from NodalPostprocessor e Side Operate on boundarie
79. ng active SMP_jfnk SMP_j nk Eype SMB forced iss rused off_diag_row off_diag_column CC peltypel Tas petsc_options_iname petsc_options_value e Single Matrix Preconditioner Fill in the forced diffused block Preconditioned JFNK Full inverse with LU 176 313 WNL Idaho National Laborat Look at Example 11 pac 177 313 NN i Idaho National Laboratory Physics Based Preconditioning Physics based preconditioning is an advanced concept used to more efficiently solve using JFNK The idea is to create a preconditioning process that targets each physics individually In this way you can create a more effective preconditioner while also maintaining efficiency In MOOSE there is a PhysicsBasedPreconditioner object This object allows you to dial up a preconditioning matrix and the operations to be done on the different blocks of that matrix on the fly from the input file 178 313 T JA NW NAMI o National Laboratory d What the PBP Does e The PBP works by partially inverting a preconditioning matrix usually an approximation of the true Jacobian by partially inverting each block row in a Block Gauss Seidel way R u v H a esa Pal mR Pu Mq p Ru ug P Rv uq Rv vqy 179 313 e WL Idaho National Laboratory Using the PBP Set up a PBP object for a two variable system consisting of variables u and v
80. nsfers Advanced 303 Debugging Advanced 308 3 313 MOOSE Overview lad www inl gov Idaho National Laboratory o NL Idaho National Laboratory Core MOOSE Team e Derek Gaston derek gaston inl gov friedmud e John Peterson jJw peterson inl gov peterson512 e Cody Permann cody permann inl gov permcody e Andrew Slaughter andrew slaughter inl gov aeslaughter98 e David Andrs david andrs inl gov andrsdave e Jason Miller jason miller inl gov mjmiller96 5 313 on Idaho National Laboratory MOOSE Multiphysics Object Oriented Simulation Environment e A framework for solving computational engineering problems in a well planned managed and coordinated way Leveraged across multiple programs e Designed to significantly reduce the expense and time required to develop new applications e Designed to develop analysis tools Uses very robust solution methods Designed to be easily extended and maintained Efficient on both a few and many processors 6 313 NL Idaho National Laboratory Capabilities 1D 2D and 3D User code agnostic of dimension Finite Element Based Continuous and Discontinuous Galerkin and Petrov Galerkin Fully Coupled Fully Implicit Unstructured Mesh All shapes Quads Tris Hexes Tets Pyramids Wedges Higher order geometry
81. nsional coupled simulation of thermomechanics heat and oxygen diffusion in UO2 nuclear fuel rods Journal of Nuclear Materials 392 6 15 2009 7 D Gaston C Newman G Hansen and D Lebrun Grandie MOOSE A parallel computational framework for coupled systems of nonlinear equations Nucl Engrg Design 239 1768 1778 2009 8 G Hansen C Newman D Gaston and C Permann An implicit solution framework for reactor fuel performance simulation In 20th International Conference on Structural Mechanics in Reactor Technology SMiRT 20 paper 2045 Espoo Helsinki Finland August 9 14 2009 9 G Hansen R Martineau C Newman and D Gaston Framework for simulation of pellet cladding thermal interaction PCTI for fuel performance calculations In American Nuclear Society 2009 International Conference on Advances in Mathematics Computational Methods and Reactor Physics Saratoga Springs NY May 3 7 2009 10 C Newman D Gaston and G Hansen Computational foundations for reactor fuel performance modeling In American Nuclear Society 2009 International Conference on Advances in Mathematics Computational Methods and Reactor Physics Saratoga Springs NY May 3 7 2009 11 D Gaston C Newman and G Hansen MOOSE a parallel computational framework for coupled systems of nonlinear equations In American Nuclear Society 2009 International Conference on Advances in Mathematics Computational Methods and Reactor Physics Saratoga Springs
82. of specifying preconditioning parameters The best place to learn about all of the preconditioning options with PETSc is the user manual We use the command line syntax but provide places to enter it into the input file http www mcs anl gov petsc petsc current docs manual pdf 170 313 S W NL Idaho National Laboratory PETSc Specific Options for Executioner petsc options Description snes ksp ew Variable linear solve tolerance useful for transient solves help Show PETSc options during the solve petsc options iname petsc options value Description pc type ilu Default for serial bjacobi Default for parallel with sub_pc_type ilu asm Additive Schwartz with sub_pc_type ilu lu Full LU serial only gamg PETSc Geometric AMG Preconditioner hypre Hypre usually used with boomeramg sub_pc_type ilu lu hypre Can be used with bjacobi or asm pc hypre type boomeramg Algebraic multigrid pc_hypre_boomeramg cont Information Threshold for AMG process _strong_threshold 0 0 1 0 Use 0 7 for 3D ksp_gmres_restart Number of Krylov vectors to store 171 313 i INT isto Notional Laboratory Default Preconditioning Matrix e Consider the fully coupled system of equations V k s T VT 0 V D s T Vs 0 e Fully coupled Jacobian approximation Re D mr R O R e For our example k s DVo Vvi 0 SD M o D s een HAS e This simple style of throwing away th
83. oint Source Often in engineering applications you will want to apply a load or source function at a single point in the domain This happens when the load needs to be applied over a much smaller area than the domain of interest e g an injection well in a geothermal reservoir or a tiny defect in a mesoscale simulation For MOOSE this is just another term in your PDE V Vu f 0 where f is some forcing function that you want to apply at a point Unfortunately f f 0 since f only has a value at a single point To deal with that we re going to use a Dirac Delta Distribution 264 313 k i o CC TE NL Idaho National Laboratory Dirac Deltas To The Rescue A Dirac Delta Distribution commonly referred to as a Dirac Delta Function and denoted by 6 is a generalized function that is zero except at one point usually zero and for which 7 5 1 From Wikipedia Dirac Deltas also have another unique property under integration when multiplied by another function r x J x Xo r x dx r xo The delta function picks out the value of r at the point xo The idea is that instead of just using f we re going to use f with the delta function non zero at the point where f is applied Now we can form the weak form of that piece of the PDE toe x0 bi 35 f 18 xo t That is if the point at which 6 is nonzero is within an element we get a contribution to each DOF with a shape function active o
84. om parameters InputParameters is used to construct every MOOSE object e Every MOOSE derived object must specify a validParams function e In this function you must start with the parameters from your parent class like Kernel and then specify additional parameters e This function must return a set of parameters that the corresponding object requires in order to be constructed e This design allows users to control any and all parameters they need for constructing objects while leaving all C constructors uniform and unchanged 67 313 Defining Valid Parameters In the h file class Convection template lt gt InputParameters validParams lt Convection gt class Convection public Kernel In the C file template lt gt InputParameters validParams lt Convection gt InputParameters params validParams lt Kernel gt Must get from parent params addRequiredParam lt RealVectorValue gt velocity Velocity Vector params addParam lt Real gt coefficient Diffusion coefficient return params WNL Idaho National Laboratory 68 313 o ci Idaho National Laboratory i On the Fly Documentation e The parser object is capable of generating documentation from the validParams functions for each class that specializes that function e Option 1 Generate a complete tree of registered objects CLI option dump optional search string
85. on of up the are sometimes called trial functions Analogous to the x we used earlier e The gradient of u can be expanded similarly N Vu x Vu gt UV q j 1 e In the Galerkin finite element method the same shape functions are used for both the trial and test functions w L 22 313 e NL Idaho National Laboratory More Depth e Substituting these expansions back into our weak form we get Vwi KV un Wi KV Up hn vi B Vun Yi f 0 i 1 N e The left hand side of the equation above is what we generally refer to as the i component of our Residual Vector and write as R un 23 313 eee Sin Idaho National Laboratory i Shape Functions e Shape Functions are the functions that get multiplied by coefficients and added up to form our solution e They are akin to the x functions from polynomial fitting in fact you can use those as shape functions e Typical shape function families Lagrange Hermite Hierarchic Monomial Clough Toucher MOOSE has support for all of these e Lagrange are the most common They are interpolary at the nodes This means the coefficients correspond to the values of the functions at the nodes Linear Lagrange Shape Functions Quadratic Lagrange Shape Functions Cubic Hermite Shape Functions 1 1 1 0 8 me Re 0 8 Vo Wy 0 8 Wo Wy 06 0 6 0 6 0 4 0 4 y 0 4 0 2 0 2 0 0 2 0
86. oned matrix free version R u eM v R u R udM v 167 313 l IN gt Idaho National Laboratory i Preconditioning Matrix vs Process e On the previous slide M represented the Preconditioning Matrix The action of M on a vector represents the Preconditioner or Preconditioning Process e In MOOSE the matrix to build and the process to apply with that matrix are separated There are four different ways to build preconditioning matrices Default Block Diagonal Preconditioning Single Matrix Preconditioner SMP Finite Difference Preconditioner FDP Physics Based Preconditioner PBP After selecting how to build a preconditioning matrix you can then use solver options to select how to apply the Preconditioner 168 313 e NL Idaho National Laboratory Solve Type e The default solve type for MOOSE is Preconditioned JFNK e An alternative solve_type can be set through either the Executioner or Preconditioner block e Valid options include PJFNK default JFNK NEWTON FD Finite Difference 169 313 NN i Idaho National Laboratory PETSc Preconditioning Options For specifying the preconditioning process we use solver options directly i e PETSc options Currently the options for preconditioning with PETSc are exposed to the applications This will change in the future there will be more generic ways
87. passing in the same name as you did with declareProperty lt TYPE gt This will use more memory 150 313 Stateful ExampleMateria ifndef EXAMPLEMATERIAL_H define EXAMPLEMATERIAL_H include Material h Forward Declarations class ExampleMaterial template lt gt InputParameters validParams lt ExampleMaterial gt xx Example material class that defines a few properties class ExampleMaterial public Material public ExampleMaterial const std string amp name InputParameters parameters protected virtual void computeQpProperties virtual void initQpStatefulProperties private Real initial diffusivity xx x Create two MooseArray Refs to hold the current and previous material properties respectively MaterialProperty lt Real gt amp _diffusivity MaterialProperty lt Real gt amp _diffusivity_old endif EXAMPLEMATERIAL_H eo Idaho National Laboratory finclude ExampleMaterial h template lt gt InputParameters validParams lt ExampleMaterial gt InputParameters params validParams lt Material gt params raddParam Rea Pe Vaoiieienl chimneys iO Were 9 return params ExampleMaterial ExampleMaterial const std string amp name InputParameters parameters Material name parameters Get a parameter value for the diffusivity _initial_diffusivity getParam lt Real gt initial_diffusivity Declare that this
88. port and tools for users of MOOSE e Getting Starting http mooseframework e Documentation http mooseframework e Wiki http mooseframework e Blog http mooseframework org getting started org documentation org wiki org blog o NL Idaho National Laboratory am D EB Desen maes Die Seek Oreiom E Documents Heip P Pandora MOOSE Fi Search co Home Gating Stare Creata an App Documentaton Blog vol Kiia Build Status Gening Started Branches napi Documer ia Open Pull Requests Blog vu seat Recent Blog Tem Posts uo Output System contact 2 days 14 hours ago Test 1 week 2 days ago ted applications ioga or Y Toa moosetrmmewo Recent Tweets Andrew 228 313 NH 7 NEM cto National Laboratory Off site SVN Access e Apply for an account https secure inl gov caims e Set up Port Forwarding Linux OS X e Setupa ssh config profile Windows Really e Configure forwarding in PuTTY or some other SSH tool e Create an ssh connection to hpclogin inl gov and leave it open e Translate internal links as follows https hpcsc moose gt https localhost 4443 moose https hpcsc svn herd trunk gt https localhost 4443 svn herd trunk 229 313 Sample SSH config fc Host x ControlMaster auto ControlPath ssh master Sr h Sp General Purpose HPC Machines Host floginl flogin2 eos quark hpcsc hpcweb User lt Username gt Prox
89. processor values and sampling a field ata single point When transferring to a MultiApp the value can either be put into a Postprocessor value or can be put into a constant AuxVariable field When transferring from a Mult iApp to the master the value can be interpolated from all the sub apps into an auxiliary field 307 313 Debugging Advanced Topic lad www inl gov Idaho National Laboratory 1 O Em Debugging e During development you will reach points where your code is not running correctly e Sometimes simple print statements will inform you of what is going wrong e In cases where your program is actually crashing a debugger can help pinpoint the problem e Many debuggers exist GDB Totalview ddd Intel Debugger etc e We are going to focus on GDB because of its ubiquity and simplicity e A Segmentation fault or Segfault or Signal 11 is a common error and denotes a memory bug often array access out of range e In your terminal you will see a message like Segmentation fault 11 e A segfault is a good error to have because a debugger can easily pinpoint the problem 309 313 o cm Idaho National Laboratory Example 21 page E155 e Example 21 is exactly like Example 8 except a common error has been introduced e InExampleDiffusion h aMaterialProperty that should be declared as a reference is not MaterialProperty lt Real gt _
90. ration PRNG e Most MOOSE objects include an interface for generating pseudo random numbers consistently during serial parallel and threaded runs This consistency enables more robust development and debugging without sacrificing PRNG quality e Users have control over the reset frequency of the PRNG Helps avoid convergence issues due to excessive PRNG noise during linear or non linear iterations e The PRNG system avoids the repetition of patterns in subsequent executions of an application 202 313 e NM NAMI o National Laboratory Using Random Numbers e Make acall to setRandomResetFrequency in your object s constructor Options include EXEC_RESIDUAL EXEC_JACOBIAN EXEC_TIMESTEP EXEC_INITIAL Note EXEC_TIMESTEP EXEC_TIMESTEP_BEGIN for the purpose of reset setRandomResetFrequency EXEC_RESIDUAL e Obtain Random Numbers Real or Long anywhere inside your object except the constructor unsigned long random long getRandomLong Real random real getRandomReal 203 313 S IN gt Idaho National Laboratory i More Details e Each MooseObject has its own seed value e The seed is used to generate different random sequences from run to run The reset frequency specifies how often the random number generators should be reset If you reset on EXEC RESIDUAL you will get the same random number sequence each residual evaluation for a given timest
91. ratory Example 1 Output diffused eFC 0 00 0 25 0 50 0 75 1 00 49 313 The Mesh Block and Types lad www inl gov Idaho National Laboratory e WL Idaho National Laboratory Creating a Mesh For complicated geometries we generally use CUBIT from Sandia National Laboratories CUBIT can be licensed from CSimSoft for a fee depending on the type of organization you work for Other mesh generators can work as long as they output a file format that libMesh reads next slide If you have a specific mesh format that you like we can take a look at adding support for it to libMesh 51 313 CUBIT Interface Cubit 12 1 Users permc meshes StackedDished StackedDished cub DRA NSSuPr SOVIJVADIUEA gt D gt o gt dh A gt EB Command Panel 0 Mode Geometry SSB Entity o ad Power Tools 9 Rx Ss a 2 w ew Full Tree emblies ndary Cond O Materials gt amp Groups Volumes Volume 1 O Volume 2 gt Surface 6 gt Surface 7 gt Surface 8 gt Surface 9 gt Surface 10 eu moon Command Line oo lt gt Journaled Command undo on Bl cusrm open Preserving Properties Page 5 o Geometry en te 33 file Users permcj meshes StackedDished StackDish3 Journaled Command open Users permc meshes StackedDished StackDish3 cub Geometry en Rea file Usera permcj meshes StackedDished Sta
92. riodic BCs Output 5 u 796332 007333 1 6 0 006 1 2 0 8 0 004 o 0 002 5 57e 13 0 000831 109 313 h Adaptivity lad www inl gov Idaho National Laboratory ci i T i Idaho National Laboratory h Adaptivity e h Adaptivity attempts to cluster mesh in areas of relatively high error in an effort to better capture the solution e The idea is to put more DOFs where the error is highest not wasting effort anywhere the solution is already well captured This is achieved through refinement splitting cells into smaller cells and coarsening undoing refinement to create larger elements In order to know where to refine an Indicator must be employed These attempt to report the relative error in each cell e Next a Marker is utilized to decide which cells to refine and which to coarsen This process can be repeated for steady state solves or done every time step during a transient simulation 111 313 Refinement Patterns MOOSE employs self similar isotropic refinement patterns When an element is marked for refinement it is split into elements of the same type For example when using Quad4 elements four children elements are created when the element is refined Coarsening happens in reverse removing children to get back to the parent element The original mesh starts at refinement level 0 Every time an element is split its children gain a refinement
93. rnel Diffusion 81 313 e NL Idaho National Laboratory Convection Diffusion e In Example 2 we will register and add a new Convection Kernel e Strong Form V Vu v Vu 0 BCs e Multiply by test function and integrate over the domain V Vu Yi v Vu yj 0 e Integrate the first term by parts to get our final weak form Vu Vwi Vu pi V Vu yi 0 82 313 WL Idaho National Laborat 83 313 A E oe NL Idaho National Laboratory Example 2 Output convected 0 00 0 25 0 50 0 75 1 00 84 313 Multiphysics Coupling lad www inl gov Idaho National Laboratory e NL Idaho National Laboratory Multiphysics Coupling Nonlinear Transient Heat Conduction e Strong form pC V kVT q 0 Dirichlet BCs e Weak form a 10 57 vs KUT Vw qui 0 86 313 0 WNL Idaho National Laboratory Multiphysics Boy Nonlinear Transient Oxygen Non Stoichiometry e Strong form 2 _v D vs s4VT 0 Dirichlet BCs e Weak form Os sQ o Fm 0 vs VT vu 0 87 313 e WNL Idaho National Laboratory e Coupled steady heat conduction steady oxygen diffusion e Fully coupled nonlinear residual k T s VT Vivi q 4i D T s Vs f T s VT Vi Ri T s e Apply JFNK to this residual 88 313 Com NL Idaho National Laboratory Simplified Coupling Exa e Weak forms
94. roxy returns proxy based on max scalar e LibMesh convenience functions from parallel h communicator max communicator sum communicator min _communicator gather _communicator send communicator receive _communicator set_union e LibMesh functions work with a wide variety of types scalars vectors sets maps 192 313 a im Idaho National Laboratory i ThreadJoin Advanced e You do not need to implement this function initially to run in parallel Start with finalize and use MPI only e You generally need to cast the base class reference to the current type so that you can access the data structures within e Finally you can perform your custom aggregation operation void PPSum threadJoin const UserObject amp y Cast UserObject into a PPSum object so that we can access member variables const PPSum amp pps static_cast lt const PPSum amp gt y _total_value pps _total_value 193 313 NS a will SNL Idaho National Laboratory Postprocessors e A few types of built in Postprocessors Elementintegral ElementAverageValue SideIntegral SideAverageValue ElementL2Error ElementHlError And others e In all of these cases you can inherit ffom these objects and extend them For instance if you want the average flux on one side you can inherit from SideAverageValue and o
95. s Requires specification of one or more boundary ids Inherit from SidePostprocessor e General Does whatever it wants Inherit from GeneralPostprocessor 190 313 JN tony S WL Idaho National Laboratory 7 EE Postprocessor Anatomy Postprocessor virtual functions for implementing your aggregation operation e void initialize Clear or initialize your data structures before execution e void execute Called on each geometric entity for the type of this Postprocessor e void threadJoin const UserObject amp uo Aggregation across threads Called to join the passed in Postprocessor with this Postprocessor You have local access to the data structures in both Postprocessors e void finalize Aggregation across MPI One of the only places in MOOSE where you might need to use MPI Several Aggregation routines are available in libMesh s parallel h file e Real getValue Retrieve the final scalar value 191 313 NN Idaho National Laboratory i T a Helpful Aggregation routines We provide several utility routines to perform common aggregation operations e MOOSE convenience functions gatherSum scalar returns the sum of scalar across all processors gatherMin scalar returns the min of scalar from all processors gatherMax scalar returns the max of scalar from all processors gatherProxyValueMax scalar p
96. s are organized so that your application can link against only those which it requires 220 313 o NL Idaho National Laboratory MOOSE Modules Anatomy ls moose modules chemical_reactions combined contact fluid_mass_energy_balance heat_conduction linear_elasticity navier_stokes phase_field richards solid_mechanics tensor_mechanics water steam eos e All applications are set up to use the MOOSE modules e f you need assistance adding or removing unneeded modules from your application please contact us and we ll be happy to help 221 313 o NS NL Idaho National Laboratory MOOSE Modules Anatomy e The contents of each module are the same as any MOOSE application S Is moose modules solid mechanics Makefile doc include lib plugins run_tests sre tests e Application codes specify the modules they want to use in their Makefiles with the following syntax HHFHHHEPEEEEEEEEEEPEEEEEEEEEEEEEEH MODULES HERRERA E SOLID_MECHANICS yes LINEAR ELASTICITY yes 222 313 e in s Idaho National Laboratory MOOSE modules Solid Mechanics Example Tar TAS disp Magnitude e 0 004 0 008 0 01 0 02 0 0 0184 nO Vy A Wh ea 1 a r K x M N Sage Oa tee W pi E diso_ Magnitude x 0 004 0 008 0 01 0 02 h 0 0 0184 von_mises x le 5 2e 5 8926 06 246072 e Available in modules solid mechanics e Stats 1
97. sh 250 313 The Actions System Advanced Topic lad www inl gov Idaho National Laboratory The Actions System o S N NEM cto National Laboratory d Responsible for performing work to set up a MOOSE problem or problems MOOSE has a large set of common tasks that are performed for every problem Supports complete dependency resolution Customizable and extendable 252 313 N cu Idaho National Laboratory Actions System Model tasks The setup of a problem in MOOSE is very order sensitive The required order for these steps has already been defined for all MOOSE based applications and can be viewed in Moose c Each step of the setup phase is labeled as a task MOOSE looks for Actions that will satisfy the current task Some of these steps are optional but they still have to be acted on in the correct order The list of steps can be augmented by registering and injecting a new task into the setup order registerTask task is required addTaskDependency task depends on 253 313 in Idaho National Laboratory Actions System Model Action Object e An Action is another MOOSE object type e When building a new Action inherit from Action and override act Typically you will set up other MOOSE objects with your Action Set up and add a group of Kernels Set up a group of Variables each with their own Kernel Inspect other Actions in the
98. t if option enum first doSomething Use in an integer context switch option enum case 1 break case 2 break case 4 break default 255 73 313 ae Sn Idaho National Laboratory Using MooseEnum with InputParameters e Objecis that have a specific set of named options should use a MooseEnum so that parsing and error checking code can be omitted template lt gt InputParameters validParams lt MyObject gt InputParameters params validParams lt ParentObject gt MooseEnum component X Y Z No default supplied params addRequiredParam lt MooseEnum gt component component Lie Xy X Or A CoOumjoxomeime p return params component ensume ve vel savcd onr Our OOS SHUI i MEO a imes rance yanriab llen Real value 0 0 if _component isValid value _some_vector _component e Peacock will automatically create a drop box when using MooseEnum e If the user supplies an invalid option the parser will automatically catch it and throw an informative message 74 313 Kernels lad www inl gov Idaho National Laboratory s NL Idaho National Labora Kernel e A Kernel is a piece of physics It can represent one or more operators terms in a PDE e A Kernel MUST override comput eQpResidual e A Kernel can optionally override computeQpJacobian computeQpOffDiagJacobian
99. t commits gir log 241 313 GitHub Issues e Issues are bug reports or feature requests for MOOSE e If you run into a bug or think of a feature you would like just click on New Issue and fill out the form e When submitting bug reports try to be as thorough as possible Attach relevant input files Reference a specific test or example in the repository 800 New Issue idaholab moc x irei nas o W NL Idaho National Laboratory eoc E GitHub Inc US https Igithub com idaholab moose issues new apps Email 4 Moose GitHub Doxygen nucleus HPC Stack Overflow J Documents vB Ml Help P Pandora e This repository O Explore Gist Blog Help idaholab moose Browse Issues Milestones B Title No one is assigned No milestone Write Previe w ts are parsed with GitHub Flavored Markdown a ing selecting them or ing fr GB aesiaughter X E amp Unwatch 8 yw Unstar 5 Fork 22 New Issue Add Labels fc Documentation n I C MOOSE C MOOSE Scripts I C MOOSEUnit 1 C MooseBuild UC Peacock hl I C TestHarness I C dmake E C pyAction Modules P critical P minor P normal 1 R duplicate UR fixed I R invalid OT defect T task 242 313 o WL Idaho National Laboratory Build Status e Any time a change is made to MOOSE or its modules our regression test suite runs
100. te risk level e We maintain a regression test code coverage level of 80 or better at all times We follow strict code style and formatting guidelines available on our wiki e We monitor code comments with third party tools for better readability 12 313 ce MR E NL Idaho National Laboratory MOOSE produces results 1 M Tonks D Gaston P Millett D Andrs and P Talbot An object oriented finite element framework for multiphysics phase field simulations Comp Mat Sci 51 1 20 29 2012 2 R Williamson J Hales S Novascone M Tonks D Gaston C Permann D Andrs and R Martineau Multidimensional Multiphysics Simulation of Nuclear Fuel Behavior Submitted J Nuclear Materials 2011 3 M Tonks D Gaston C Permann P Millett G Hansen C Newman and D Wolf A coupling methodology for mesoscale informed nuclear fuel performance codes Nucl Engrg Design 240 2877 2883 2010 4 D Gaston G Hansen S Kadioglu D Knoll C Newman H Park C Permann and W Taitano Parallel multiphysics algorithms and software for computational nuclear engineering Journal of Physics Conference Series 180 1 012012 2009 5 M Tonks G Hansen D Gaston C Permann P Millett and D Wolf Fully coupled engineering and mesoscale simulations of thermal conductivity in UO2 fuel using an implicit multiscale approach Journal of Physics Conference Series 180 1 012078 2009 6 C Newman G Hansen and D Gaston Three dime
101. terialProperty lt Real gt diffusivity Real ExampleDiffusion computeQpResidual return _diffusivity _qp Diffusion computeQpResidual Real ExampleDiffusion computeQpJacobian return _diffusivity _qp Diffusion computeQpJacobian 145 313 Convection h C with Material Property ifndef CONV ION H define CONV TON JE finclude Kernel h class Convection template lt gt InputParameters validParams lt Convection gt class Convection public Kernel public Convection const std string amp name InputParameters parameters protected virtual Real computeQpResidual virtual Real computeQpJacobian private MaterialProperty lt RealGradient gt amp _velocity hi endif CONVECTION_H Idaho National Laboratory include Convection h template lt gt InputParameters validParams lt Convection gt InputParameters params validParams lt Kernel gt return params Convection Convection const std string amp name InputParameters parameters Kernel name parameters Retrieve a gradient material property to use for the convection velocity _velocity getMaterialProperty lt RealGradient gt convection velocity Real Convection computeQpResidual return _test _i _qp _velocity _qp _grad_u _qp Real Convection computeQpJacobian return _test _i
102. terials postprocessors utils tests same stuff as src 35 313 s WNL Idaho National Laborator Looking at MOOSE e All classes are separated out into directories associated with that set of classes kernels bcs ics auxkernels dgkernels functions actions etc 36 313 The Input File lad www inl gov Idaho National Laboratory s The Input File e By default MOOSE uses a hierarchical block structured input file e Within each block any number of name value pairs can be listed e The syntax is completely customizable or replaceable e To specify a simple problem you will need to populate five or six top level blocks e We will briefly cover a few of these blocks in this section and will illustrate the usage of the remaining blocks throughout this manual WL Idaho National Laboratory 38 313 Main Input File Blocks e MOOSE expects the following basic blocks for a simple problem Mesh Variables Kernels BCs Executioner Outputs 39 313 0 NL Idaho National Laboratory Hierarchical Block Stru Variables active u v a7 order FIRST family LAGRANGE Ea v order FIRST family LAGRANGE as Kernels 40 313 ANS Secu SNL Idaho National Laboratory The Mesh Block Mesh Optional Type type lt FileMesh GeneratedMesh
103. that you don t have any code bugs For example PDE V Vu 0 Assumed solution u sin arx Forcing function f ofn sin arx Need to solve V Vu f 0 197 313 POUL ions ll s q RI Idaho National Laboratory Error Analysis e To compare two solutions or a solution and an analytical solution A and b the following expressions are frequently used If blo h h dO Q ae f IV h b P do Q e From finite element theory we know the convergence rates of these quantities on successively refined grids e They can be computed in a MOOSE based application by utilizing the EFlementL2Error Of ElementH1lSemiError Postprocessors respectively and specifying the analytical solution with Functions 198 313 WNL Idaho National Laborat Look at Example 14 page 199 313 Example 14 Output Error Postprocessor Values time dofs integral 0 000000e 00 1 210000e 02 7 071068e 01 1 000000e 00 1 210000e 02 2 359249e 00 2 000000e 00 4 410000e 02 3 093980e 01 3 000000e 00 1 681000e 03 8 861951e 02 4 000000e 00 6 561000e 03 2 297902e 02 5 000000e 00 2 592100e 04 5 797875e 03 6 000000e 00 030410e 05 1 452813e 03 F Dofs o NNL Idaho National Laboratory 200 313 Parallel Agnostic Random Number Generation lad www inl gov Idaho National aboratory a Idaho National Laboratory i Pseudo Random Number Gene
104. tional e This is the go to place to see all of the applications and objects that this application depends on 207 313 pe TT NL Idaho National Laboratory i Object Registration e The Application object is responsible for calling the static function registerOb jects where you have registered all of the objects created in your application Strong coupling to other applications is handling by calling registerObjects in those applications making those objects available in your application By default your application will register all MOOSE and MOOSE module objects but can made to link to any other application When creating a new application with Stork your application object will be completely setup and should not require any editing for normal use 208 313 o main C e This is your program entry point e By default it only does a couple of very specific things Initializes MPI through an object Wrapper MooseTnit Calls registerApps which makes your application objects available for construction in the AppFactory Builds your application object Runs your application object Clean up and exit e See main C in Example 1 page E5 e While it is possible to add additional code here it s not recommended WL Idaho National Laboratory 209 313 Testing lad www inl gov Idaho National Laboratory o WL Idaho National Laboratory Test Harness e MOOSE prov
105. tory Building e Build libMesh by running projects trunk moose scripts update_and_rebuild_libmesh sh e After libMesh is compiled compile MOOSE by typing e The 8 after j should be replaced with the number of processors in your machine This enables parallel compilation e To build a debug version of the code type METHOD dbg make j8 e Another option is just to go into your application and do make j8 this will automatically recompile your application MOOSE and MOOSE modules if necessary 233 313 ANS lll SNL Idaho National Laboratory Running Tests e After building your application it can be a good idea to make sure everything is working by running the tests e If you would like to run the MOOSE test suite you can type cd projects trunk moose test make j8 of ew ceste e Remember to add tests to your test suite whenever possible This will help you to Know when something is broken and will help the MOOSE developers know when they ve broken your application 234 313 Ee CC TEN AL Idaho National Laboratory Basic Subversion Usage Atany time you can see what you have modified in the current directory by doing SVN SERE This will generally print a lot of extra files with next to them These are usually just generated files like o and d To get them out of the way do Svid Site Some of those files might be new files you need to tell subversion
106. tric Search Sometimes information needs to be exchanged between disconnected pieces of mesh Examples include Mechanical Contact Gap Heat Conduction Radiation Constraints Mesh Tying The Geometric Search system allows an application to track evolving geometric relationships Currently this entails two main capabilities NearestNodeLocator and PenetrationLocator Both of the capabilities work in parallel and with both Parallel and Serial Mesh 278 313 NearestNodeLocator NearestNodeLocator provides the nearest node on a Master boundary for each node on a Slave boundary and the other way around The distance between the two nodes is also provided It works by generating a Neighborhood of nodes on the Master side that are close to the Slave node The size of the Neighborhood can be controlled in the input file by setting the patch_size parameter in the Mesh section To get a NearestNodeLocator include NearestNodeLocator h and call getNearestNodeLocator master_id slave id to create the object The functions distance and nearestNode both take a node ID and return either the distance to the nearest node or a Node pointer for the nearest node respectively o WNL Idaho National Laboratory Masten Nodes Slave Nodes ood 279 313 e WNL Idaho National Laboratory PenetrationLocator e A PenetrationLocator provides the perpendicular dista
107. uler default if you do not specify the scheme bdf 2 128 313 Convergence Rates e Test problem where f is chosen so the exact solution is given by u t x y L2 error Ou ar Y Vu F oind time step 1 0 1 0 01 0 001 1 00E 00 amp Crank Nicolson 1 00E 01 EB Backward Euler 1 8146x 9926 1 00E 02 y BFD2 Power Crank Nicolson 1 00E 03 Power Backward Euler 1 00E 04 Power BFD2 y 0 2592x2 1 00E 05 y 0 0646x 9993 1 00E 06 129 313 k DN eS SNL Idaho National Laboratory Adaptive Time Step e Set TimeStepper type to DT2 e Algorithm Takes a time step of size dt to get Un 1 from un Takes two time steps of length dt 2 to get Un 1 from un Calculate local relative time discretization error estimate a Mun Unale o max Un 1 l2 Un l gt Obtain global relative time dicretization error estimate en n Adaptivity is based on target error tolerance ero and a maximum acceptable error tolerance emax e If we achieve e lt yax then we continue with a new time step size 1 p e dt Ath lt n where p is the global convergence rate of the time stepping scheme e f we do not achieve e lt emax or if the nonlinear solver fails we reject the time step and shrink af e Parameters 7o and emax can be specified in the input file as e_tol and e max in the Executioner block 130 313
108. ump in the integral of quantities along element boundaries e MOOSE has full support for DG e You can use DG with MOOSE by utilizing a discontinuous set of shape functions like the MONOMIALS and creating specifying DGKernels to run along with regular Kernels DGKernels are responsible for residual and Jacobian contributions coming from the integral of jump terms along inter element edges DG is beyond the scope of this training class if you want to utilize this capability just ask 287 313 UserObjects Advanced Topic lad www inl gov Idaho National Laboratory i N Sn Idaho National Laboratory UserObjects The UserObject system provides data and calculation results to other MOOSE objects All Postprocessors are UserObjects that compute a single scalar value Therefore a User0bject can often be thought of as a more generic Postprocessor With more functionality UserObjects define their own interface which other MOOSE objects can call to retrieve data Just like Postprocessors there are 4 types of UserObjects ElementUserObject NodalUserObject SideUserObject GeneralUserObject The first three perform a calculation on the associated geometric entity and then provide an interface to the result The GeneralUserObject can do anything and then provide an interface to the result For example a GeneralUserObject might read in a large data set hold it in memory and provide
109. variable _qp _grad_u _qp Real Convection computeQpJacobian N Idaho National Laboratory return _test _i _qp _grad_some_variable _qp _grad_phi _j _qp 93 313 WL Idaho National Laborat 94 313 0 CC TE NR AL Idaho National Laboratory Example 3 Output 00 02 05 08 1 0 00 05 10 15 20 95 313 e NUL Idaho National Laboratory e The exact solution to this problem is _ exp 1 exp z 1 96 313 N Idaho National Laboratory Kernel Inheritance MooseObject BlockRestrictable Coupleable AnisotropicDiffusion SetupInterface ScalarCoupleable CoupleableMooseVariableDependency IntermediateInterface MooseVariableInterface CoupledForce FunctionInterface l ZeroInterface 97 313 Boundary Conditions lad www inl gov Idaho National Laboratory e Boundary Condition e BoundaryCondition provides a residual and optionally a Jacobian on a side of a domain e The structure is very similar to kernels computeQpResidual Jacobian Parameters Coupling The only difference is that some BCs are NOT integrated over the boundary and instead specify values on boundaries Dirichlet e IntegratedBCs inherit from IntegratedBC e Non integrated BCs inherit from NodalBc WL Idaho National Laboratory 99 313 N SNL Idaho National Laboratory Some Values Availab
110. verride computeQpIntegral to compute the flux at every quadrature point e For the Element and Side Postprocessors you can use material properties and functions e By default Postprocessors will output to a formatted table on the screen but they can also write to a CSV or Tecplot file e They are also written to Exodus format when using that as an output option 194 313 a im Idaho National Laboratory Default Postprocessor Values e It is possible to set default values for Postprocessors This allows a MooseObject e g Kernel to operate without creating or specifying a Postprocessor Within the validParams function for your object declare a Postprocessor parameter with a default value params addParam lt PostprocessorName gt postprocessor 1 2345 My optional postprocessor docume When you use the getPostprocessorValue interface MOOSE provides the user defined value or the default if no PostProcessor has been specified const PostprocessorValue amp value getPostprocessorValue postprocessor e Additionally users may supply a real value in the input file in lieu of a postprocessor name 195 313 1 iu Idaho National Laboratory Input File Syntax and Output e Postprocessors are declared in the Postprocessors block Da e i type NumDOF s The name of the sub block like side_average is and integral is the name of the Postprocessor and will be the name of the p n
111. vide a Jacobian u g9g on OQ Becomes u g 0 on OQ e In the following example u av on Q2 And therefore u av 0 on AQ 102 313 ifndef COUPLEDDIRICH define COUPLEDDIRICH include NodalBC h Forward Declarations class CoupledDirichletBC template lt gt InputParameters validParams lt CoupledDirichletBC gt class CoupledDirichletBC public NodalBC public CoupledDirichletBC const std string amp name InputParameters parameters protected virtual Real computeQpResidual private Real alpha VariableValue amp some var val hi endif COUPLEDDIRICHLE Idaho National Laboratory include CoupledDirichletBC h template lt gt InputParameters validParams lt CoupledDirichletBC gt InputParameters params validParams lt NodalBC gt params addParam lt Real gt alpha 0 0 Doc params addRequiredCoupledVar some var Doc return params CoupledDirichletBC CoupledDirichletBC const std string amp name InputParameters parameters NodalBC name parameters _alpha getParam lt Real gt alpha _some_var_val coupledValue some var Real CoupledDirichletBC computeQpResidual return _u _qp _alphax_some_var_val _qp 103 313 e WL Idaho National Laboratory Integrated BCs e Integrated BCs including Neumann BCs are actually integrated over the external face of an
112. warehouse and add objects appropriately e Asingle Action class can be registered with more than one task e Asingle Action instance can only satisfy one task however the system may create several instances of any one Action to satisfy multiple tasks 254 313 setup_mesh add variable add aux variable add kernel fada bel add postprocessor setup executioner setup mesh complete init problem check integrity o NL Idaho National Laboratory SetupMeshAction AddVariableAction AddVariableAction AddKernelAction AddBCAction AddPostprocessorAction SetupExecutionerAction InitProblemAction CheckIntegrityAction 255 313 Co T i daho Notional Laboratory The Parser briefly e MOOSE comes with an input file parser that will automatically create Actions for you based on the syntax it sees e Using the MOOSE Parser or any parser is not required MOOSE operates on Actions which can be built in any way the developer chooses e To use the Parser Actions must first be associated with syntax blocks this works much like object registration e The Parser 1 2 3 4 Encounters a new syntax block in the input file Checks to see if there is an Action associated with that block Gets the InputParameters for your object using the appropriate validParams function Parses and fills in the InputParameters object with options from the input file Builds and stores the appropriate
113. yCommand ssh lt username gt hpclogin inl gov netcat th p Forwarding Host hpelogin hp login inL gov User lt username gt HostName hpclogin inl gov LocalForward 8080 hpcweb 80 LocalForward 4443 hpcsc 443 NL Idaho National Laboratory 230 313 e SNL so National Laboratory i Getting Started On Your Own Machine e On the internal Trac Wiki there are Getting Started links on the front page to directions for getting your environment set up for use with MOOSE e In general the steps are Download and install redistributable package Check out MOOSE Build libmesh Build your application Run tests ORUN e We currently have redistributable packages for Linux Ubuntu and others and Mac OSX e Under Getting Started there are also advanced directions for special situations like compiling MOOSE on a cluster e No matter what directions you follow make sure to read every step carefully 231 313 Basic Subversion workflow _ e The INL internal MOOSE applications are currently kept in a Subversion repository e Subversion or SVN allows multiple people to work on source code simultaneously e The basic workflow is 1 Make changes Add files DNAN Check out source from server Update TEST Commit changes back to server e Create an SVN checkout by typing sva co httpss hpesc sun herd Erumk 232 313 NS E ull SNL Idaho National Labora

Download Pdf Manuals

image

Related Search

Related Contents

  WAGO-I/O  LACES LiteracyPro Reporting User Manual  WOL 利用説明書  XFaceMaker/UIMS Reference Manual  Visualizar - Marcopolo  Hardware Service Manual - ps-2.kev009.com, an archive of old  APC VT Power Supply User Manual  notice of function change (pdf:442 kb)  

Copyright © All rights reserved.
Failed to retrieve file