From 79b928f919154749567c450f26ce1700183a951e Mon Sep 17 00:00:00 2001 From: Sudipta Biswas Date: Mon, 5 Oct 2020 15:42:43 -0700 Subject: [PATCH] Change output options #99 --- include/constraints/RebarBondSlipConstraint.h | 3 - src/constraints/RebarBondSlipConstraint.C | 37 +---- test/tests/rebar_bondslip/RCBeam_constraint.i | 153 ++++++++---------- 3 files changed, 70 insertions(+), 123 deletions(-) diff --git a/include/constraints/RebarBondSlipConstraint.h b/include/constraints/RebarBondSlipConstraint.h index 2cf43ff87..06a2c0d9c 100644 --- a/include/constraints/RebarBondSlipConstraint.h +++ b/include/constraints/RebarBondSlipConstraint.h @@ -99,9 +99,6 @@ class RebarBondSlipConstraint : public EqualValueEmbeddedConstraint std::vector _var_nums; std::vector _vars; - /// flag to turn on printing values for debugging - const bool _debug; - /// maximum bond stress const Real _max_bondstress; diff --git a/src/constraints/RebarBondSlipConstraint.C b/src/constraints/RebarBondSlipConstraint.C index d85416cd7..54b9ddea2 100644 --- a/src/constraints/RebarBondSlipConstraint.C +++ b/src/constraints/RebarBondSlipConstraint.C @@ -33,7 +33,6 @@ RebarBondSlipConstraint::validParams() params.addCoupledVar( "displacements", "The displacements appropriate for the simulation geometry and coordinate system"); - params.addParam("debug", false, "whether to print out debug messages"); params.addParam("max_bondstress", 0.0, "Maximum bond stress"); params.addParam("frictional_bondstress", 0.0, "Bond stress due to friction"); @@ -53,7 +52,6 @@ RebarBondSlipConstraint::RebarBondSlipConstraint(const InputParameters & paramet _mesh_dimension(_mesh.dimension()), _var_nums(_mesh_dimension, libMesh::invalid_uint), _vars(_mesh_dimension, nullptr), - _debug(getParam("debug")), _max_bondstress(getParam("max_bondstress")), _frictional_bondstress(getParam("frictional_bondstress")), _ultimate_slip(getParam("ultimate_slip")), @@ -99,14 +97,7 @@ RebarBondSlipConstraint::timestepSetup() bool RebarBondSlipConstraint::shouldApply() { - if (_debug) - { - std::cout << "===========================================\n"; - std::cout << "node id: " << _current_node->id() << std::endl; - std::cout << "at coord: " << (Point)*_current_node << std::endl; - } auto it = _secondary_to_primary_map.find(_current_node->id()); - if (it != _secondary_to_primary_map.end()) { const Elem * primary_elem = _mesh.elemPtr(it->second); @@ -127,9 +118,7 @@ void RebarBondSlipConstraint::computeTangent() { _secondary_tangent = 0.0; - - // get normals - // get connected elements of the current node + // get normals and connected elements of the current node const std::map> & node_to_elem_map = _mesh.nodeToElemMap(); auto node_to_elem_pair = node_to_elem_map.find(_current_node->id()); mooseAssert(node_to_elem_pair != node_to_elem_map.end(), "Missing entry in node to elem map"); @@ -154,9 +143,6 @@ RebarBondSlipConstraint::computeTangent() _secondary_tangent /= _secondary_tangent.norm(); _current_elem_volume /= elems.size(); - - if (_debug) - std::cout << "tangent: " << _secondary_tangent << std::endl; } void @@ -174,9 +160,6 @@ RebarBondSlipConstraint::reinitConstraint() RealVectorValue slip_normal = relative_disp - slip_axial; Real slip_ratio = std::abs(slip) / _transitional_slip[0]; - if (_debug) - std::cout << "Slip = " << slip << ".\n"; - const Node * node = _current_node; auto it = _bondslip.find(node->id()); mooseAssert(it != _bondslip.end(), "Node not found in bond-slip map"); @@ -185,18 +168,6 @@ RebarBondSlipConstraint::reinitConstraint() bond_slip.slip_min = std::min(bond_slip.slip_min_old, slip); bond_slip.slip_max = std::max(bond_slip.slip_max_old, slip); - if (_debug) - { - std::cout << "Slip_min = " << bond_slip.slip_min << ".\n"; - std::cout << "Slip_min_old = " << bond_slip.slip_min_old << ".\n"; - std::cout << "Slip_max = " << bond_slip.slip_max << ".\n"; - std::cout << "Slip_max_old = " << bond_slip.slip_max_old << ".\n"; - std::cout << "Bondstress_min = " << bond_slip.bondstress_min << ".\n"; - std::cout << "Bondstress_min_old = " << bond_slip.bondstress_min_old << ".\n"; - std::cout << "Bondstress_max = " << bond_slip.bondstress_max << ".\n"; - std::cout << "Bondstress_max_old = " << bond_slip.bondstress_max_old << ".\n"; - } - Real slope = 5.0 * _max_bondstress / _transitional_slip[0]; Real plastic_slip_max = bond_slip.slip_max - bond_slip.bondstress_max / slope; Real plastic_slip_min = bond_slip.slip_min - bond_slip.bondstress_min / slope; @@ -238,12 +209,6 @@ RebarBondSlipConstraint::reinitConstraint() else _bond_stress = _frictional_bondstress; - if (_debug) - { - std::cout << "Bondstress = " << _bond_stress << "\n"; - std::cout << "Bondstress Derivative = " << _bond_stress_deriv << "\n"; - } - Real bond_force = 2.0 * libMesh::pi * _bar_radius * _current_elem_volume * _bond_stress; Real bond_force_deriv = 2.0 * libMesh::pi * _bar_radius * _current_elem_volume * _bond_stress_deriv; diff --git a/test/tests/rebar_bondslip/RCBeam_constraint.i b/test/tests/rebar_bondslip/RCBeam_constraint.i index efe874e3e..2250af4e5 100644 --- a/test/tests/rebar_bondslip/RCBeam_constraint.i +++ b/test/tests/rebar_bondslip/RCBeam_constraint.i @@ -4,71 +4,68 @@ [GlobalParams] displacements = 'disp_x disp_y' - # volumetric_locking_correction = true [] [Modules/TensorMechanics/Master] - [./Concrete_block] + [Concrete_block] block = 1 strain = finite incremental = true generate_output = 'stress_xx stress_xy stress_yy strain_xx strain_xy strain_yy - max_principal_stress mid_principal_stress min_principal_stress - secondinv_stress thirdinv_stress vonmises_stress - secondinv_strain thirdinv_strain - elastic_strain_xx elastic_strain_xy elastic_strain_yy' -# plastic_strain_xx plastic_strain_xy plas tic_strain_xz plastic_strain_yy plastic_strain_yz plastic_strain_zz' + max_principal_stress mid_principal_stress min_principal_stress + secondinv_stress thirdinv_stress vonmises_stress + secondinv_strain thirdinv_strain + elastic_strain_xx elastic_strain_xy elastic_strain_yy' save_in = 'resid_x resid_y' - [../] + [] [] [Modules/TensorMechanics/LineElementMaster] - [./Reinforcement_block] + [Reinforcement_block] block = '2' truss = true area = area displacements = 'disp_x disp_y' save_in = 'resid_x resid_y' - # add_variables = true - [../] + [] [] [Variables] - [./disp_x] - [../] - [./disp_y] - [../] + [disp_x] + [] + [disp_y] + [] [] [AuxVariables] - [./resid_x] - [../] - [./resid_y] - [../] - [./area] + [resid_x] + [] + [resid_y] + [] + [area] order = CONSTANT family = MONOMIAL - [../] - [./axial_stress] + [] + [axial_stress] order = CONSTANT family = MONOMIAL - [../] + [] [] [AuxKernels] - [./area] + [area] type = ConstantAux block = '2' variable = area value = 2.00e-4 # 509 mm2 execute_on = 'initial timestep_begin' - [../] - [./axial_stress] + [] + [axial_stress] type = MaterialRealAux block = '2' variable = axial_stress property = axial_stress - [../] + [] [] [Constraints] @@ -84,7 +81,6 @@ transitional_slip_values = 0.0005 ultimate_slip = 0.1 rebar_radius = 7.98e-3 - # debug = true [] [rebar_y] type = RebarBondSlipConstraint @@ -98,114 +94,111 @@ transitional_slip_values = 0.0005 ultimate_slip = 0.1 rebar_radius = 7.98e-3 - # debug = true [] [] [Functions] - [./loading] + [loading] type = PiecewiseLinear x = '0 10 20 30 ' y = '0 -0.008 0.003 0.0' - [../] + [] [] [BCs] - [./loading] + [loading] type = FunctionDirichletBC - # type = DirichletBC variable = disp_x boundary = '102' function = loading - # value = 0.00004 preset = true - [../] - [./left_support_x] + [] + [left_support_x] type = DirichletBC variable = disp_x boundary = '100' value = 0 - [../] - [./left_support_y] + [] + [left_support_y] type = DirichletBC variable = disp_y boundary = '100' value = 0 - [../] + [] [] [Postprocessors] - [./deformation_x] + [deformation_x] type = AverageNodalVariableValue variable = disp_x boundary = '101' - [../] - [./deformation_y] + [] + [deformation_y] type = AverageNodalVariableValue variable = disp_y boundary = '101' - [../] - [./react_x] + [] + [react_x] type = AverageNodalVariableValue variable = resid_x boundary = '100' - [../] - [./react_y] + [] + [react_y] type = AverageNodalVariableValue variable = resid_y boundary = '100' - [../] - [./react_x2] + [] + [react_x2] type = AverageNodalVariableValue variable = resid_x boundary = '101' - [../] - [./react_y2] + [] + [react_y2] type = AverageNodalVariableValue variable = resid_y boundary = '100' - [../] - [./node1_fx] + [] + [node1_fx] type = NodalVariableValue variable = resid_x nodeid = 138 - [../] - [./node1_fy] + [] + [node1_fy] type = NodalVariableValue variable = resid_y nodeid = 138 - [../] - [./node1_dx] + [] + [node1_dx] type = NodalVariableValue variable = disp_x nodeid = 138 - [../] - [./node1_dy] + [] + [node1_dy] type = NodalVariableValue variable = disp_y nodeid = 138 - [../] - [./node1_fx2] + [] + [node1_fx2] type = AverageNodalVariableValue variable = resid_x boundary = '102' - [../] + [] - [./stress_xx] + [stress_xx] type = ElementAverageValue variable = stress_xx block = '1' - [../] - [./strain_xx] + [] + [strain_xx] type = ElementAverageValue variable = strain_xx block = '1' - [../] - [./axial_stress] + [] + [axial_stress] type = ElementAverageValue variable = axial_stress block = '2' - [../] + [] [] [Materials] @@ -215,18 +208,18 @@ poissons_ratio = 0.2 block = 1 [] - [./isotropic_plasticity] + [isotropic_plasticity] type = IsotropicPlasticityStressUpdate yield_stress = 285788383.2488647 # = sqrt(3)*165e6 = sqrt(3) * yield in shear hardening_constant = 0.0 block = '1' - [../] - [./radial_return_stress] + [] + [radial_return_stress] type = ComputeMultipleInelasticStress tangent_operator = elastic inelastic_models = 'isotropic_plasticity' block = '1' - [../] + [] [truss] type = LinearElasticTruss block = '2' @@ -235,37 +228,29 @@ [] [Preconditioning] - [./SMP] + [SMP] type = SMP full = true - [../] + [] [] [Executioner] type = Transient solve_type = 'PJFNK' - nl_max_its = 100 - nl_abs_tol = 1.E-5 - nl_rel_tol = 1E-3 - line_search = none - petsc_options_iname = '-pc_type' petsc_options_value = 'lu' - petsc_options = '-snes_converged_reason' - + nl_max_its = 100 + nl_abs_tol = 1.E-5 + nl_rel_tol = 1E-3 end_time = 30 dtmin = 0.00001 - # num_steps = 5 - dt = 0.1 [] [Outputs] - # print_linear_residuals = false exodus = true csv = true - # file_base = RCBeam_bondslip_test []