KratosMultiphysics / GiDInterface

The graphical user interface of Kratos for GiD. Featuring CFD, CSM, DEM, PFEM, etc
Other
32 stars 16 forks source link

[MPM] example not working #846

Closed jginternational closed 2 years ago

jginternational commented 2 years ago

As pointed in #551 We need to update modelpart names & paths

jginternational commented 2 years ago
Traceback (most recent call last):
  File "C:\Users\garat\AppData\Local\Temp\mpm_2d_fallingsandball_calculategid.gid\MainKratos.py", line 39, in <module>
    simulation.Run()
  File "E:\Deploy_Kratos\KratosMultiphysics\analysis_stage.py", line 47, in Run
    self.Initialize()
  File "C:\Users\garat\AppData\Local\Temp\mpm_2d_fallingsandball_calculategid.gid\MainKratos.py", line 20, in Initialize
    super().Initialize()
  File "E:\Deploy_Kratos\KratosMultiphysics\analysis_stage.py", line 82, in Initialize
    self._GetSolver().PrepareModelPart()
  File "E:\Deploy_Kratos\KratosMultiphysics\ParticleMechanicsApplication\mpm_solver.py", line 114, in PrepareModelPart
    self.__ExecuteCheckAndPrepare()
  File "E:\Deploy_Kratos\KratosMultiphysics\ParticleMechanicsApplication\mpm_solver.py", line 458, in __ExecuteCheckAndPrepare
    materials_imported = self.__ImportConstitutiveLaws()
  File "E:\Deploy_Kratos\KratosMultiphysics\ParticleMechanicsApplication\mpm_solver.py", line 473, in __ImportConstitutiveLaws
    KratosMultiphysics.ReadMaterialsUtility(material_settings, self.model)
RuntimeError: Error: The ModelPart named : "Parts_Grid_Grid" was not found as SubModelPart of : "Initial_MPM_Material". The total input string was "Initial_MPM_Material.Parts_Grid_Grid"

in kratos/containers/model.cpp:149:Model::GetModelPart
   kratos/containers/model.cpp:165:Model::GetModelPart
   kratos/utilities/read_materials_utility.cpp:147:ReadMaterialsUtility::GetPropertyBlock
   kratos/utilities/read_materials_utility.cpp:82:ReadMaterialsUtility::ReadMaterialsUtility
VeronikaSinger commented 2 years ago

Hi @jginternational

there is a problem in the ParticleMaterials.json. The constitutive variables should be written only for the Initial_MPM_Material (Body Mesh) and not for both - the blue marked text should be deleted: image

jginternational commented 2 years ago

Hi @VeronikaSinger

I fixed that, but now I'm experiencing this issue:

::[Particle Mechanics Analysis]:: : STEP:  146 
::[Particle Mechanics Analysis]:: : TIME:  0.7300000000000005 
::[Particle GiD Output Process]:: : [Spent time for output =  0.05539870262145996 sec] 
::[Particle Mechanics Analysis]:: : STEP:  147 
::[Particle Mechanics Analysis]:: : TIME:  0.7350000000000005 
::[Particle Mechanics Analysis]:: : STEP:  148 
::[Particle Mechanics Analysis]:: : TIME:  0.7400000000000005 
UpdatedLagrangian:  Element: 4899
UpdatedLagrangian:  Element position: [3](1.48692,0.0544129,0)
UpdatedLagrangian:  Element velocity: [3](-11.0101,-5.60785,0)
UpdatedLagrangian:  Shape functions: [1,3]((0.0720337,0.128113,0.799853))
UpdatedLagrangian:  Quadrature points: 1
UpdatedLagrangian:  Parent geometry ID: 4611686018461428544
UpdatedLagrangian:  Parent geometry number of points: 3
UpdatedLagrangian:  NODE [751]: (Current position: [3](1.40909,0.0788095,0)) 
UpdatedLagrangian:  ---Current Disp: [3](-0.00915925,-0.0549346,0) (Previour Disp: [3](0,0,0))
UpdatedLagrangian:  NODE [728]: (Current position: [3](1.45455,0,0)) 
UpdatedLagrangian:  ---Current Disp: [3](0,0,0) (Previour Disp: [3](0,0,0))
UpdatedLagrangian:  NODE [703]: (Current position: [3](1.49912,0.0609311,0)) 
UpdatedLagrangian:  ---Current Disp: [3](-0.00505197,-0.0283005,0) (Previour Disp: [3](-0.0509013,-0.0251841,0))
UpdatedLagrangian:  ---Contact_Force: NULL 
UpdatedLagrangian:  ---Contact_Force: NULL 
UpdatedLagrangian:  ---Contact_Force: NULL 
terminate called after throwing an instance of 'Kratos::Exception'
  what():  Error: MPM UPDATED LAGRANGIAN DISPLACEMENT ELEMENT INVERTED: |F|<0  detF = -0.291496

in kratos/Kratos/applications/ParticleMechanicsApplication/custom_elements/updated_lagrangian.cpp:245:virtual void UpdatedLagrangian::SetGeneralVariables(UpdatedLagrangian::GeneralVariables&, ConstitutiveLaw::Parameters&, const Vector&)
   kratos/Kratos/applications/ParticleMechanicsApplication/custom_elements/updated_lagrangian.cpp:336:virtual void UpdatedLagrangian::CalculateElementalSystem(Element::MatrixType&, Element::VectorType&, const ProcessInfo&, bool, bool)
   kratos/Kratos/applications/ParticleMechanicsApplication/custom_strategies/schemes/mpm_residual_based_bossak_scheme.hpp:448:void MPMResidualBasedBossakScheme<TSparseSpace, TDenseSpace>::CalculateRHSContribution(Element&, MPMResidualBasedBossakScheme<TSparseSpace, TDenseSpace>::LocalSystemVectorType&, Element::EquationIdVectorType&, const ProcessInfo&) [with TSparseSpace = UblasSpace<double, boost::numeric::ublas::compressed_matrix<...>, boost::numeric::ublas::vector<double> >; TDenseSpace = UblasSpace<double, boost::numeric::ublas::matrix<double>, boost::numeric::ublas::vector<double> >; MPMResidualBasedBossakScheme<TSparseSpace, TDenseSpace>::LocalSystemVectorType = boost::numeric::ublas::vector<double>; Element::EquationIdVectorType = vector<long unsigned int>]

Aborted (core dumped)
VeronikaSinger commented 2 years ago

Hi this problem occurs if the defomation is too large within one time step and hardly depends on the discretization. How did you chooose the mesh size for this example? If I generate the mesh as proposed by GiD I don't receive this error. However, if triangles are used, the number of material points (PARTICLES_PER_ELEMENT) should be changed to 3 or 6 instead of 10 to avoid the warnings.