site map | contact | login | Protection des données personnelles | Powered by FluxBB | réalisation artaban

You are not logged in.

- Topics: Active | Unanswered

Pages: **1**

Hi all,

While I did not find a way to solve my problem using code aster I solved it within ParaVis.

I explained my solution in the following post:

code-aster.org/forum2/viewtopic.php?id=23835

Hi All,

After quite some struggling I was able to solve my problem!

I changed my macro script to the part shown below. I added some comments to explain what I did. If you copy this into your own macro then don't forget to add the numpy module as np.

I also added my entire macro code in the attachment in case you are interested in the entire thing.

# create a new 'Probe Location'

probeLocation1 = ProbeLocation(Input=eLNOfieldToSurface1,

ProbeType='Fixed Radius Point Source')

N=5 #Specify number of points on which to find values

Stress2 = []

for i in range(N):

x=i #Select x-coordinate

y=i+1 #Select y-coordinate

# Properties modified on probeLocation1.ProbeType

probeLocation1.ProbeType.Center = [x, y, 0.0] #interpolates all data to a specific point

polyData = servermanager.Fetch(probeLocation1) #Get data from the server side to the client side

pointData = polyData.GetPointData()

StressArray = pointData.GetArray('resnonl_SIGM_ELNO') #Select which data you want to extract

Stress = StressArray.GetTuple(0)

Coordinates = [x, y, 0]

Stress1 = np.r_[Coordinates, Stress]#Combines the coordinates and stress values in one variable

Stress2.append(Stress1)#Adds the next point to the array

#print(Stress2)

#print(pointData) ##Print this (into the python shell) to see which data can be extracted into "StressArray"

np.savetxt(r"C:\Users\Matthijs\Documents\StressExtract2.txt" ,Stress2)#Save array to the desired file

Kind regards,

Matthijs

keywords: Paraview, Paravis, Data Extraction from coordinates, Data Extraction from analytical curve, probe location, interpolation

**MatthijsNL**- Replies: 1

Hi everyone,

I'm trying to create a macro which outputs my stresses at a large number of locations and then saves this to a csv file.

I have been able to probe locations with my macro and write it to a csv file, however it only works for one location at a time.

The relevant part of my script is the following:

# create a new 'Probe Location'

probeLocation1 = ProbeLocation(Input=eLNOfieldToSurface1,

ProbeType='Fixed Radius Point Source')

# Properties modified on probeLocation1.ProbeType

probeLocation1.ProbeType.NumberOfPoints = 3

for i in range(3):

x=2.2*np.cos(i)

y=2.5*np.sin(i)

probeLocation1.ProbeType.Center = [x, y, 0.0]

The problem is that the 3 points that show up in the output table are all the exact same point, namely the last point of the range when i=2. Is there a way.

My question is: How can I change my code such that all locations are saved?

I put my full code in the attachment if you want to check it.

Help would be really appreciated!

Kind regards,

Matthijs

EDIT: If anyone knows a different/better way to extract data at these locations this would also be great!

**MatthijsNL**- Replies: 1

Hi All,

I wasn't sure whether to put this in the Code Aster or Salome Meca part but as I am hoping to solve this using code aster I chose to put it here. Sorry if this was wrong.

I am looking for an easy way to extract data (stresses SIXX, SIYY and SIXY) along the path of an analytically defined curve.

I have a curve defined by

x=(5+3*cos(theta))*cos(theta)

y=(5+3*cos(theta))*sin(theta)

z=0

for theta from 0 to pi.

This curve is placed randomly over the mesh so does not necessarily coincide with any nodes.

I know I can extract data from a group of nodes using POST_RELEVE_T but as nodes are not placed on the curve this does not work.

I was also able to force nodes to be on this curve by adding an analytical curve into my structure in the geometry module of salome meca. This however leads to meshing being very difficult and forcing me to have a weird mesh. This would not be a dealbreaker except for that I want to alter the dimensions of my structure automatically and having this curve in my mesh creates al lot of errors when generating the mesh.

In the ParaVis module I found "Probe location" which can get the data from any location (even in between nodes) by interpolation. However, as doing this by hand for very many points would take forever this is not practical.

TLDR: So in short. Is there a way to extract stresses from either an analytically defined curve (or a list of coordinates lying on this curve)?

Hi All,

I thought I'd post a small update just in case anyone is interested. I have done some more experimenting and found the following.

Lowering the stiffness further and further indeed results in a stable value. When setting the stiffness to 1e-20 there is hardly any difference compared to 1e-10 or even 1e-5. So the error that remains has a different (yet to be determined) source.

The error stabilized to approx. 5 to 10% depending on the exact case. I find this pretty decent but not perfect yet. I could lower this error slightly by using a much more refined mesh (150000 nodes instead of ~20000) but the increased computing time is hardly worth the accuracy gain.

Some of the error might be explained by the lack of detail in the paper. For example, it was not explicitly stated that the pin is modelled as frictionless and rigid, which I did assume. My best guess would be that they did include some friction, which would correct my results in the right direction.

Thank you. This actually makes a lot of sense.

I am trying to find the "characteristic length for compression" which is related to the failure of a composite plate with a pin-loaded hole. The validation data comes from a paper called "A new method to determine the characteristic lengths of composite joints without testing" by Jin-Hwe Kweon, Hyon-Su Ahn and Jin-Ho Choi.

Maybe I should have started with a simpler validation case, but my model for the "characteristic length for tension" (which does not include contact and is simply an orthotropic plate with a hole loaded in tension) gave nearly perfect results so I was hopeful this one would as well. As it does not I will have to keep searching for the reason

Hi Konyaro and others,

Thanks again for your help. I have studied what you did and I believe I understand all the steps you performed. I still have a few questions though so if you (or anyone else) could help me that would be great.

1. I am not sure how to choose the stiffness values of the K_T_D_N element. I believe that the stiffness that is applied is applied to each node, so when using a finer mesh I should lower the stiffness. I did find that the stresses lower when giving a higher stiffness which seems logical as the springs take up part of the force. I would think that I should keep the stiffness as low as possible, just high enough for the problem to converge, as a higher value would have a big influence on the results. However, when I check my results with a validation case I move further away from my results when I lower the stiffness too much and an ideal value lies around 0.05 depending on my geometry. The problem is, I want to use this model for a different geometry for which I do not have validation results.

2. I get some strange deformations as results of which I have put images in the attachment. The plate shows large out of plane deflections at the elements that make contact with the pin. This is strange because it should be a 2D problem. Even when I switch from C_PLAN plane stress elements to D_PLAN plane strain elements (which should have 0 out of plane displacements) I still have the same problem. Also when I use a more refined mesh I still have the same problem.

I have already tried the following:

- changing the CARA_ELEM to DISCRET_2D instead of the normal 3D

- Changing the out-of-plane Poisson ratios of my plate to 0 (as these should not affect the results anyway)

- Changing the contact definition from CONTINUE to DISCRETE, switching master and slave, changing REAC_GEOM from CONTROLE to AUTOMATIQUE and changing ALGO_RESO_GEOM from POINT_FIXE to NEWTON

The images in the attachment have a scale factor of 0.001, so the displacements really are gigantic.

Any tips and advice would be greatly appreciated.

Hi Konyaro

Thank you so much for your time and effort. I have tested it and it indeed seems to converge now!

I will take a closer look tomorrow to find out exactly what you did and try to learn from it.

Thank you!

**MatthijsNL**- Replies: 6

Hi All

I am quite new to Code Aster and Salome Meca and I have some trouble getting my model of a pin-loaded hole to converge.

I am trying to model a rigid pin (fastener/bolt) which presses into a plate and makes contact. I have included an image in the attachment. When I place a displacement on the edge of the pin the model runs great and gives some nice results. However, I'm trying to model a uniform distributed load. When I change the displacement into a load by FORCE_CONTOUR I get the following error message:

<EXCEPTION> <FACTOR_10>

Problme : la matrice est singulire ou presque singulire: Lors de la factorisation de la matrice, on a rencontr un problme (pivot nul ou presque nul) la ligne 26691 qui correspond au degr de libert donn ci-dessus. Le nombre de dcimales "perdues" pour cette ligne est :14. Ce nombre de dcimales perdues est li au degr de singularit de la matrice. Plus il est grand, plus le systme est singulier. Quand on a perdu plus de 8 dcimales, on estime que l'on a perdu 50% de la prcision des nombres rels (qui ont 15 dcimales environ). Risques et conseils:

* Si la ligne correspond a un degr de libert physique, il s'agit probablement d'un mouvement de corps rigide mal bloqu. Vrifiez les conditions aux limites. Si vous faites du contact, il ne faut pas que la structure ne "tienne" que par le contact. Vrifiez galement les caractristiques matriaux (module d'Young, ...).

* Si la ligne correspond a un degr de libert de Lagrange, il s'agit sans doute d'une condition limite redondante. En particulier, il se peut que la relation linaire surabondante provienne des conditions de contact. Peut-tre devriez vous exclure certains noeuds des conditions de contact (mots cls SANS_NOEUD et SANS_GROUP_NO).

* Si le solveur utilis est LDLT ou MULT_FRONT, vous pouvez utiliser le solveur MUMPS car celui-ci est le seul pouvoir factoriser les matrices qui ne sont pas dfinies positives.

* Parfois, en parallle, le critre de dtection de singularit de MUMPS est trop pessimiste ! Il reste nanmoins souvent possible de faire passer le calcul complet en relaxant ce critre (augmenter de 1 ou 2 la valeur du mot-cl NPREC) ou en le dbranchant (valeur du mot-cl NPREC=-1) ou en relanant le calcul sur moins de processeurs.

I tried using google translate but it hasn't gotten me much further. I think the problem is that before contact is established the parts do not apply a force to each other and therefore no equilibrium point can be established, but I'm not sure.

So far I have tried using an initial gap between the two objects and not having this gap.

I have also tried using a mesh where the nodes of the objects coincide or one where the rigid pin has a slightly coarser mesh such that the nodes of the objects have different positions. This all does not help.

I have already looked at quite some (old) forum posts such as the following one where they suggest applying a 'soft' spring with low stiffness between the parts to ensure equilibrium without disturbing the result. However, I cannot figure out how to apply a soft spring between two nodes (or elements) of the two objects.

forum2/viewtopic.php?id=13707

Something else I found was to first apply the displacements and then from the displaced position do a second analysis with the applied forces. This however still seems very complicated to me. I am not sure how to extract the nodal forces and then put them into the second analysis. And when I am able to do this should I slowly reduce the nodal forces and replace them with the forces I actually want using a ramp function?

forum2/viewtopic.php?id=13549

I hope I am clear and am sorry if these are super basic questions. Any help (with these or other solutions) would be greatly appreciated!

My Salome Meca and Code Aster files are in the attachment.

**MatthijsNL**- Replies: 0

Hi Everyone.

My name is Matthijs and I am an aerospace engineering student from the Netherlands. I am new to Salome Meca and Code Aster and have been making my first few models these past two weeks. These forums have already been a lot of help to me as I find the programs have quite a steep learning curve and my french is not great.

I am curious about what I will be able to do with this program and am looking forward to reading more of everyone's posts!

Greetings,

Matthijs

Pages: **1**