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

Extract member force #16

Closed bhavin26570 closed 5 years ago

bhavin26570 commented 5 years ago

Hi,

let me first congratulate you for such fantastic program.

on trial base i did analysis of steel tower using BEF.

The model is being analysed very quickly,

However, the extraction of forces and support reaction take too much time.

Pl. note that normally in transmission tower we have 200-300 nodes, 500-600 elements and 100 odd load cases and it takes too much time extract element force for all members for all load case.

Is there any way to extract forces of all elements in the model for all load cases in one stroke????

Regards, Bhavin shah

epsi1on commented 5 years ago

Hello,

Thanks

bhavin26570 commented 5 years ago

Yes, elements are barelements (some of them are with truss behavior balance beam). For this tower, Nos of load cases are 60, elements @450 and nodes are @170 This is normal in tower. Sometimes more than this. Thanks Bhavin shah

bhavin26570 commented 5 years ago

nodel loads are 60*25=150

bhavin26570 commented 5 years ago

sorry 1500

epsi1on commented 5 years ago

For analyzing the model for each load case there need some calculations.

Can you please check this solution and let me know if it increases the speed:

i think Model.Solve() combined with TrussElement2Node should have good speed...

Thanks

epsi1on commented 5 years ago

Also did you ever had validated value of the internal forces?

bhavin26570 commented 5 years ago

- try to solve model for all load cases first, then start to retrieve results from elements I am doing that way only. Should i try case wise??

switch between Model.Solve() and Model.SolveMpc() methods and see if any speedup Both takes almost same time consuming

switch between TrussElement2Node and BarElement and see if any speedup I can not model all members as truss element because i feel it is becoming unstable. should i try???

Also did you ever had validated value of the internal forces? Yes, i started with small structure with one load case and it was perfectly matching. However for big structure i haven't checked. I will let you know once i finish.

bhavin26570 commented 5 years ago

i tried case wise but as expected it is more time consuming.

epsi1on commented 5 years ago

What i do not understand is that which one of these tasks takes longer than expected:

bhavin26570 commented 5 years ago

model is being solved very fast calculating the internal force is slower. My elements are bar element.

I tried all elements as TrussElement2Node but it is not being solved...may be it becames unstable.

epsi1on commented 5 years ago

Have changed some parts of code. Can you please retry with new code? There should be speedup, as shape function are cached now instead of each time being created.

Thanks

bhavin26570 commented 5 years ago

Yes sir.... time reduced from 60 sec to @30 sec per tower....grrrrrreat......

But i am human...want more...if possible...

as i have experienced with other software which takes about @15sec....

epsi1on commented 5 years ago

I think you should do a performance profile to see the bottlenecks.

What solver do you use? Have a look at here: Performance Solving a 2700 free DOF structure for 60 times by direct method Cholesky takes about 0.83 sec+ 59 * 0.03 sec =2.6 sec.

Thanks

bhavin26570 commented 5 years ago

i am simply looping through members and load case. Below is my code

Parallel.For(0, y, Function(i) For j = 0 To x mem_no(i, j) = all_mem_memb_no(j) memb_force(i, j) = TryCast(twr_model.Elements(all_mem_memb_no(j)), BarElement).GetInternalForceAt(0, load_case_collection(Array.IndexOf(TWR_NAMES, itm))(i)).Fx / 9.807 load_case_no(i, j) = i + 1 load_case_desc(i, j) = load_case_collection(Array.IndexOf(TWR_NAMES, itm))(i).CaseName Next End Function)

To reduce time i have used parallel.for which uses CPU >90%. What else can be done??

The performance profile is as under. The usage of BEF is 58+27 i.e @85%.

image

bhavin26570 commented 5 years ago

Its vb.net...i forget to mention

bhavin26570 commented 5 years ago

Further to above, can you advice how to add the self weight of the structure so that it can consider in element forces for various load cases.

bhavin26570 commented 5 years ago

Hello,

Awaiting your reply.....

epsi1on commented 5 years ago

for applying self weight I think best way is using Loads.UniformLoad class. pls have a look at this example: https://bfenet.readthedocs.io/en/latest/example/UniformLoadCoordSystem/index.html

bhavin26570 commented 5 years ago

thanks for the reply. with above i could add the self weight. But, in load combination, the "value" has no impact while extracting the force. it seems that it always remains 1. Am i making any mistake. Can you check pl.

For better understanding, below two process gives the same force in element (Member_Force) even though the "value" is different.

load_combination(load_case) = 1 load_combination(self_wt) = 1 Member_force = TryCast(twr_model.Elements(all_mem_memb_no(j)), BarElement).GetInternalForceAt(0, load_combination)

and

load_combination(load_case) = 2 load_combination(self_wt) = 2 Member_force = TryCast(twr_model.Elements(all_mem_memb_no(j)), BarElement).GetInternalForceAt(0, load_combination)

epsi1on commented 5 years ago

You are right. Can you please check again? Should work as expected now.

bhavin26570 commented 5 years ago

Thanks.... it is working now.

Further, any possibility on improvement in time for extracting / calculating element force???

Hope i am not disturbing you by asking queries....if so you may tell frankly....

epsi1on commented 5 years ago

please consider using TrussElement2Node and FrameElement2Node. maybe better performance can be achieved

bhavin26570 commented 5 years ago

Hi, In support reaction, it seems that the self weight is being subtracted instead of addition for compression. Similarly, in tension it is being added instead of subtraction. Can you pl. check....

epsi1on commented 5 years ago

Are you using Model.Solve() or Model.SolveMpc() method? In a test structure, with SolveMpc() i'm getting correct values same as another software named OpenSees. Can you please give more information and code to reproduce the error?

bhavin26570 commented 5 years ago

I have checked, Sorry, it was my mistake. I have corrected and now support reactions are matching.