BriefFiniteElementNet / BriefFiniteElement.Net

BriefFiniteElementDotNET (BFE.NET) is a library for linear-static Finite Element Method (FEM) analysis of solids and structures in .NET
https://www.bfe-framework.net
GNU Lesser General Public License v3.0
153 stars 58 forks source link

Adding new Elements #43

Closed thaletob closed 3 years ago

thaletob commented 4 years ago

Hello there, first of all I need to thank you for this great work. I actually need to implement a four-noded rectangular element to your library. Have you got any special hints or things I need to consider because I'm a relatively new BFE.Net-user but familiar with FEM. Thank you!

epsi1on commented 4 years ago

Hi, You are welcome... What behaviors do you need for new rectangular element? Example behaviors are membrane, plate bending (thin or thick) etc. There should be a QuadrilaturalElement class, also several ElementHelpers, once you tell me which behavior do you need, I'll add the classes. Also take a look at TriangleElement's documentation for example. Thanks

thaletob commented 4 years ago

Hi there, thanks for the quick response. I already had a look at the Triangle-Element class and I'm planning to keep it as similar as possible. Well in this special case I want to create a 2D-model of quadratic elements with a 3d-loadcase. So it's more behaving like a thin plate then a membrane (because of the 3d loads). I appreciate any feedback/ hints you might have!

epsi1on commented 4 years ago

Hi, I think adding new element is not hard. The current design pattern and in BFE.NET is like this: Element class is just a holder of state and common properties of elements and math calculations (like integrating BtDB or integrating the body loads) are implemented in helper classes. Also keep in mind that BFE is only linear analysis yet. So first thing is to create empty classes:

BriefFiniteElementNet.Elements.QuadrilaturalElement inherits from Element

BriefFiniteElementNet.ElementHelpers.DkqHelper (for plate bending) inherits from ElementHelper class.

epsi1on commented 4 years ago

I've added related project to the projects section

https://github.com/BriefFiniteElementNet/BriefFiniteElement.Net/projects/1

Also i did some implementations earlier, i should do so checks.

epsi1on commented 4 years ago

This is also a good reference: Development of Membrane, Plate and Flat Shell Elements in Java by Kaushalkumar Kansara:

https://pdfs.semanticscholar.org/581b/ea64790f0162cee58977edc747f489592a90.pdf

thaletob commented 4 years ago

Hey, I will try this the following weeks. Linear analysis is all I need so far. And thank you for the document, at the first view it seems to be very helpful!

You said you did some implementations earlier, what do you mean? Greetings!

thaletob commented 4 years ago

I actually created the blank classes, what can I do with the project (QuadrilaturalElement) you added in the projects section?

epsi1on commented 4 years ago

Hi, If you plan to add this quad element into this library then definitely I will help. I did code quad element (membrane and plate bending) maybe a year ago for someone, but that is not consistent with this current ElementHelper and Element pattern, so i would like to upgrade it...

thaletob commented 4 years ago

Hey, yes I'm planning to add it. I really need it for a still running project of topology optimizing structures in aero engines. Thank you very much for this offer! I think we should keep in touch here. Greetings!

epsi1on commented 4 years ago

OK, i did also add them into BriefFiniteElementNet.CustomElements/Elements/ project, Next step is to implement IElementHelper mehtods, There are three helper classes:

DkqHelper Q4MembraneHelper Q4BasicDrillingDofHelper

Each one a .cs file (source code) amd a .md file (for documentation).

image

Q4MembraneHelper is like CstHelper.cs class. DkqHelperis like DktHelper.cs and TriangleBasicDrillingDofHelper is like QuadBasicDrillingDofHelper.cs. Also methods are somehow nicely commented in IElementHelper.cs file and Element.cs file.

epsi1on commented 4 years ago

I think you should use pull request to main github repository in order to both of us work on same code and can keep each other updated with code.

thaletob commented 4 years ago

Thank you for adding the first files to the project. Unfortunately I have not found any time to continue the work this week. I will try to continue next week. Somehow I cannot create a new pull request so far.

thaletob commented 4 years ago

I think adding a pull request is not possible because of missing rights. Maybe you could create a pull request where we could share our code.

epsi1on commented 4 years ago

I think for creating pull request there is no special permission to the GitHub repository. For merging there is need for permission.

Thanks

thaletob commented 4 years ago

Good morning, I think I found out how to work with pull requests on Github. I forked the project and keep you updated with pull requests. I'm now beginning to edit the blank Helper-Classes you added to BFENet.CustomElements. You simply copied the TriangleElement-Class into QuadrilateralElement-Class at the beginning, right?

epsi1on commented 4 years ago

Hi,

You simply copied the TriangleElement-Class into QuadrilateralElement-Class at the beginning, right?

No i just copied the common part of those elements. Maybe some renaming are required...

thaletob commented 4 years ago

Thank you! I'll keep you updated.

epsi1on commented 4 years ago

Hi, I've merged your pullrequest into repository in commit bd4bb0ae851cf01

thaletob commented 4 years ago

Thank you! I hope the bahaviour-classes were correct.

thaletob commented 4 years ago

If I understood correctly, I only have to add the tree classes (DkqHelper, QUadBasicDrillingDofHelper and Q4MembraneHelper) now to get the Element finished, right?

epsi1on commented 4 years ago

yes, then should do tests and on successful test, yes finish

thaletob commented 4 years ago

Great! Can you name your source for the matrix-calculations in the Helper-Methods? This could save some time actually.

epsi1on commented 4 years ago

Great! Can you name your source for the matrix-calculations in the Helper-Methods? This could save some time actually.

You can have a look at similar helpers, for example Cst (constant stress/strain triangle) is similar to QuadMembrane etc. What you mean by matrix calculations?

thaletob commented 4 years ago

With Matric-Calculations I mean functions like: CalcLocalStiffnessMatrix, GetBMatrixAt, CalcLocalKMatrix_Triangle, etc.

epsi1on commented 4 years ago

this could be good resource (for DKQ and Q4 membrane) http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.619.9320&rep=rep1&type=pdf

also DktHelper.md file have some links for implementations of DKT, maybe implementations of DKQ or Q4 would be found there

thaletob commented 4 years ago

Thank you, yes I already checked out these links in DKtHelper.md but without finding good results.

epsi1on commented 4 years ago

These two are good too:

https://github.com/DBorello/OpenSees/blob/master/SRC/element/shell/ShellDKGQ.cpp http://what-when-how.com/the-finite-element-method/fem-for-two-dimensional-solids-finite-element-method-part-2/

thaletob commented 4 years ago

Cool! I also found the right formulas in the PDF file that you've sent.

epsi1on commented 4 years ago

these two are good too

http://opensees.berkeley.edu/WebSVN/filedetails.php?repname=OpenSees&path=%2Ftrunk%2FSRC%2Felement%2Fshell%2FShellNLDKGQ.cpp&rev=5995 http://www.luxinzheng.net/publication7/2017-JEE-DKGQ_OpenSees.htm

DkqHelper.zip Not sure if works fine, it should be checked.

this one also maybe help

epsi1on commented 4 years ago

Also please note that put the references in each helper file (for example documentation file for 'DkqHelper.cs' is 'DkqHelper.md'

thanks

thaletob commented 4 years ago

I will do that. Fortunately I'm using the same refs as you did before (e.g. "Development of Membrane, Plate and Flat Shell Elements in Java").

thaletob commented 4 years ago

these two are good too

http://opensees.berkeley.edu/WebSVN/filedetails.php?repname=OpenSees&path=%2Ftrunk%2FSRC%2Felement%2Fshell%2FShellNLDKGQ.cpp&rev=5995 http://www.luxinzheng.net/publication7/2017-JEE-DKGQ_OpenSees.htm

DkqHelper.zip Not sure if works fine, it should be checked.

this one also maybe help

Well that file in the .zip is exactly what I was working on the last hours... I think I don't need to continue working on this...

epsi1on commented 4 years ago

Do you have any reference for shape function of dkq element? i mean DkqHelper.GetNMatrixAt() method.

shape function is used in calculating equivalent nodal loads and internal displacements both of these should takes the nodal rotations into account. as DKQ have 12 DoF, shape function matrix should be 12 column matrix, but currently it is 4 columned matrix

epsi1on commented 4 years ago

I stuck with this shape function sometime ago

thaletob commented 4 years ago

It needs to be verified, because at this point I took your suggested DQT-file. I just did some little changes, but no changes in the calcluation. It might be a mistake in this code.

thaletob commented 4 years ago

I just checked one of the functions there which was okay. I did not check all of them because of missing time.

epsi1on commented 4 years ago

DkqHelper still need to implement GetEquivalentNodalLoads() for PartialNonuniformLoad. Not so important, so can be done later.

thaletob commented 4 years ago

Okay, and it is also refering to a DistributedNonUniformLoad (line 551) which is not existing yet. Actually I did start with adding the calculations for Q4MembraneHelper.

thaletob commented 4 years ago

Okay we are talking about the same thing, I see you already changed the names

epsi1on commented 4 years ago

@thaletob I think there is a problem with Q4MembraneHelper.GetBMatrixAt() which returns zero. I've updated the QuadElementTester with three different method for each behavior Please just note that there should not be any "non positive" elements on main diagonal of stiffness matrix returned from `IElementHelper.CalcLocalStiffnessMatrix()' otherwise there will be an error. Any "non positive" (for example zero or negative value) member on main diagonal, if do not constrained correctly, will cause stiffness matrix to be NOT positive definite and that is not correct, at least i did not see any non positive definite stiffness matrix in linear analysis that be result of a correct calculation.

thaletob commented 4 years ago

Thank you for your effort. I think I found at least one mistake. Matrix B consists of Matrix A and Matrix G. Matrix A seems to be correct, but Matrix G returned 0. I found out, that one factor within GetGMatrix, which I declared as q = (1 / 4) was interpreted as 0, that is why each member of the Matrix was multiplied by 0. I changed it to q = 0.25 . Now Matrix G is not empty which results in Matrix B beeing not empty too. There is no error left now. I just need to compare the result of the calculation for now :)

thaletob commented 4 years ago

59

thaletob commented 4 years ago

Which units are you using within the calculations? (for E-Modulus, Forces, etc.) Just to be consitent to that.

rubsy92 commented 4 years ago

@thaletob It's unit-less - so you can SI (N, m, Pa,...)

thaletob commented 4 years ago

@rubsy92 Thanks

epsi1on commented 4 years ago

@thaletob Can you please see the pull request #61 , a little code is changed in Q4MembraneHelper.cs, can you please do a review? Thanks

thaletob commented 4 years ago

Seems to be okay! He found one mistake in my code and then he added a second digit after the decimal in most cases.

rubsy92 commented 4 years ago

@thaletob could you double-check the GetBMatrixAt-method in DKQ helper? At a first glance it looks a bit funny. Thanks!

thaletob commented 4 years ago

You are right, it really looks a bit funny. I checked the function, is is directly refering to the "Development of [...] Elements in Java"-PDF that you've sent before. Just some letters are changed compared to the given formulas. So in my opinion it is okay, I just did some little cosmetical changes within #62 .

rubsy92 commented 4 years ago

@thaletob I checked it and it seems to be okay indeed. However my bending-validation indicates that the element is not stiff enough. It's about 10% off in some cases...