KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.01k stars 244 forks source link

Structural springs in the GiD Kratos Version #7629

Open KlausBSautter opened 3 years ago

KlausBSautter commented 3 years ago

Hi all,

General information: @JoanTsiper wants to use Kratos for a course at the Technical University in Athens. I like that idea very much. We discussed the general workflow of creating the geometry, elements, and bcs. in GiD this morning. To simplify the process it would be nice if students could just use the Kratos Version which is provided by GiD's Problemtype download option.

Problem: The aforementioned version of Kratos (or at least the corresponding GiD interface) does not provide the 1-node spring element which is important for the models to be studied in his course.

Question: Is there a possibility to somehow still use this element? Using a truss instead is not a good idea as the user would have to create also the end nodes of the "spring" and so on.

If you can't add the spring to this version, as I see it, the students would have to compile the current dev version of Kratos and use the appropriate GiD interface. I think that would probably be too much to ask in this case.

@JoanTsiper, please correct me if I've got something wrong here.

Klaus

philbucher commented 3 years ago

The spring is in Kratos, but not in the interface => they can use python to add them, the AnalysisStage provides the necessary interfaces

KlausBSautter commented 3 years ago

like creating a submodelpart in GiD with all the nodes which will have a spring and then looping over these nodes to create the springs?

philbucher commented 3 years ago

for example

rubenzorrilla commented 3 years ago

I'd like to add that it should be more or less straightforward to add it to the GUI.

jginternational commented 3 years ago

@escolano

escolano commented 3 years ago

Hi Klaus, I am Enrique Escolano, developer of GiD, not Kratos.

I completely agree with you, I had a class of a master two days ago, and it's much easier if kratos is get with a simple "Internet retrieve". In my case it was enough with the kratos-interface 7.0.2 (using the "Solid" application instead the "Structural" one) but this version is of March 2019.

I have noticed that there is a more recent kratos-interface 7.1.5 version (January 2020), for Linux and Windows. If do you want we can upload this version to our 'Internet retrieve' repository, to facilitate its use (if the Kratos team is interested)

But it seems that this version (ant the current develop master branch), doesn't has in its "Structural -3D" application any boundary condition of a spring. Is this condition what you want, an 'elastic constraint'? e.g. It is simply a boundary condition attached to a single node like the current "Displacement", but with extra fields for the k elastic stiffness of the spring. Then it seems easy to be added for future versions of the kratos-interface

or it is something more special? e.g. a link between two nodes, Then it is necessary some special trick to be codified and handled in GiD and its customLib tree interface (instead a single ov="points" ara necessary two ov1="points" ov2="points" that will use two GiD groups)

KlausBSautter commented 3 years ago

Hi, I think @JoanTsiper should be able to answer this more in detail. But as far as I understand it, they would like to use a simple single-node spring element. It is already in the current master of Kratos.

escolano commented 3 years ago

Is it in the 'current master of Kratos' solver or also in the 'current master of 'Kratos GiD-Interface? I had a look to the GUI of the current master branch and didn't see any 'spring' boundary condition kratos_GUI_structural_3D-developer (Structural Application, 2D or 3D, also with preference mode==developer)

KlausBSautter commented 3 years ago

It is definitely in the Kratos master but I don't think in the interface

rubenzorrilla commented 3 years ago

It's in the StructuralMechanicsApplication of the Kratos master branch repository (I'm not sure if this was included before or after the latest release the internet retrieve points to, in any case it shouldn't be a problem to create a new one).

The addition should be as simple as adding a new element with <item GeometryType="Point" nodes="1" KratosName="SpringElementKratosRegisterName"/>.

loumalouomega commented 3 years ago

It's in the StructuralMechanicsApplication of the Kratos master branch repository (I'm not sure if this was included before or after the latest release the internet retrieve points to, in any case it shouldn't be a problem to create a new one).

The addition should be as simple as adding a new element with <item GeometryType="Point" nodes="1" KratosName="SpringElementKratosRegisterName"/>.

The name is NodalConcentratedElement2D/3D respectively

escolano commented 3 years ago

@jginternational

jginternational commented 3 years ago

Si si, la que me has liado @escolano . Como te dije, es un elemento no una condición.

escolano commented 3 years ago

No se si para kratos-calculo lo tratan o no por dentro con algún objeto derivado de un 'elemento' suyo, pero eso te da igual.

Yo diría que externamente es simplemente una condición sobre un nodo, completamente igual a un apoyo simple (deplazamiento==0 o a un valor dado) con un entry más para la constante de rigidez (una por dirección si no es isótropo)

O sea que no necesitan generar ningún elemento de GiD y creo que es trivial de implementar en la interfaz gráfica.

Falta saber si está claro como se he de escribir en en fichero de input de kratos, con un ejemplito (si nadie lo sabe como se escribe es que no se puede hacer)

Yo sé lo que es un apoyo elástico internamente en programa de estructuras, y es solo en un nodo f=k*d en la matriz del sistema no aparecen incógnitas nuevas y solo hay que sumar a la matriz de rigidez del sistema el aporte de esta k. No es nada de un elemento, es a nivel de nodo.

El usuario de un programa que no tiene esto implementado, como ahora kratos, suele hacer como truco añadir un falso elemento de barra muy corto, con un nuevo nodo 'dummy' que se empotra, y con rigidez de barra 'equivalente' a la constante del muelle (esto si añade una nueva ecuación al sistema por el nuevo nodo, y no va muy fino porque da una matriz del sistema de ecuaciones mal condicionada)

escolano commented 3 years ago

Could somebody attach an (small) example of kratos input file with an 'elastic constraint'? (to study how to be implemented in the GUI)

KlausBSautter commented 3 years ago

like that?

https://github.com/KratosMultiphysics/Kratos/blob/19ea1a0770c799cc69650f9aef8499a7dace8f0e/applications/StructuralMechanicsApplication/tests/test_spring_damper_element.py#L117-L121

rubenzorrilla commented 3 years ago

For the GiD guys would be better if you can provide a complete working case (Json settings, Json materials, .mdpa and MainKratos.py). In that way they can figure out what the interface should write.

jginternational commented 3 years ago

From my point of view: Do you need those elements inside a 'Begin elements' block, following the element numeration?

rubenzorrilla commented 3 years ago

From my point of view: Do you need those elements inside a 'Begin elements' block, following the element numeration?

I think so.

philbucher commented 3 years ago

From my point of view: Do you need those elements inside a 'Begin elements' block, following the element numeration?

I think this holds for any element

philbucher commented 3 years ago

also you need to set the Elemental Variable NODAL_DISPLACEMENT_STIFFNESS to consider the nodal stiffness https://github.com/KratosMultiphysics/Kratos/blob/267d9974391902f571596b9d47f3b7426bf8d074/applications/StructuralMechanicsApplication/custom_elements/nodal_concentrated_element.cpp#L298

escolano commented 3 years ago

Hi Klaus, I have asked just what Ruben pointed: the 'standard' input files, not a python scripting to do it programatically This is the information required to be handled by the GUI, It doen's matter the kratos solver internals. e.g. I attach an example of what I asked, for the case of a constraint to set displacement zero on two nodes: with-vs-without_constraint.zip

in this case these are the blocks that the GUI must print for a constraint on two nodes kratos_changes_mdpa kratos_changes_projectparameters_json MainKratos.py is equal in both cases

This is what Javi Gárate needs to know to implement it in the GUI. I think that in GiD can be handled as a normal condition assigned to a group of points/mesh nodes. Depending on how is expected to be represented in your input files maybe is necessary to print for each node with elastic displacement a 'phantom element' (panthom from te GiD viewpoint were doesn't exists, not for kratos solver)

jginternational commented 3 years ago

Ok @KlausBSautter , I'll just need an example mdpa

KlausBSautter commented 3 years ago

hey sry for my late reply.

I set the following example up as I expected it to work. test_nodal_concentrated.zip

When I run it it tells me that the RHS is zero. Maybe @loumalouomega @philbucher could briefly check the files for some obvious mistakes. Especially @loumalouomega as you wrote the element code I guess. Do I have to fix some dofs?

In the appended file I just want to model one spring with a point load as a single node, that's how I imagined it.

I won't be available for the next 1.5 weeks. Cheers

loumalouomega commented 3 years ago

There's a pr with an update of the element, I don't remember what does the current one

philbucher commented 3 years ago

hey sry for my late reply.

I set the following example up as I expected it to work. test_nodal_concentrated.zip

When I run it it tells me that the RHS is zero. Maybe @loumalouomega @philbucher could briefly check the files for some obvious mistakes. Especially @loumalouomega as you wrote the element code I guess. Do I have to fix some dofs?

In the appended file I just want to model one spring with a point load as a single node, that's how I imagined it.

I won't be available for the next 1.5 weeks. Cheers

see my comment to make it work: https://github.com/KratosMultiphysics/Kratos/issues/7629#issuecomment-717795712

rubenzorrilla commented 1 year ago

What is the status of this?