sikvelsigma / ANSYS-APDL-Welding-Script

A simple script for welding in ANSYS APDL with Goldak heat source
MIT License
10 stars 2 forks source link

Multipass welding #1

Closed Weldworld1 closed 11 months ago

Weldworld1 commented 1 year ago

Is this code runs for multipass welding

sikvelsigma commented 1 year ago

@Weldworld1 can you elaborate?

Weldworld1 commented 1 year ago

There is a line where you have mentioned select element as weld_1, weld2 as per your choice. And in the code you have put weld%kk%, again there is another two heated_elements and selected_elements. I want to is the complete set of you code runs for multipass welding or for only a single pass

sikvelsigma commented 1 year ago

Theoretically, you can just put the same pass several times and it should work

Weldworld1 commented 1 year ago

So the as per the code this is a single pass welding? I just want to clarify. After the last *enddo if I copy pase the code and do the necessary change for weld_2 for next pass, will it work

Weldworld1 commented 1 year ago

The weld_2 will be upper layer of weld_1 of same thickness and dimension.

Weldworld1 commented 1 year ago

And the selection heated_elements and selected_elements, this two selection was not mentioned in the code uploaded by you

sikvelsigma commented 1 year ago

Why do you need to copy anything? You put weld path params, nobody's stopping you from putting the same path twice, it should work since there're no hardcoded limitations of where welding paths are supposed to be.

for heated_elements just select all elements near your welding paths (also on the bed since it will receive heat if it's in the vicinity of the heat source)

you don't need to create selected_elements - it's an internal selection used by the code and is created automatically

sikvelsigma commented 1 year ago

Try to run it without element birth and death first to see if it works at all

Weldworld1 commented 1 year ago

Ok. But there is a catch. Lets assume total weld thickness is 6 mm and there will be 3 layers. So 3 paths are required. By putting only coordinates without elem birth and death will actual scenario of welding appear?

Weldworld1 commented 1 year ago

The heated_elements are the deposition elements, right ? Not HAZ elements.

Weldworld1 commented 1 year ago

You have already killed the elem from processing step, then how could you not resurrect them.

sikvelsigma commented 1 year ago

Ye, that might be a problem, so i guess you'll have to use EBD after all, just be prepared for mechanical simulation to be a pain in the ass. You can treat heated_elements as a HAZ zone, the intended use is this: usually you create a fine mesh near the welding area and extremely coarse one outside of it, so this selection is used to apply heat only to those fine elements, technically speaking, HAZ can be bigger than heated_elements zone but they should be pretty close, otherwise you'll get bad results

Anyway, this code is just a prototype to give you a starting point for your own script, it lacks a lot of features like variable heat source params for each path, cooling time after each path, different heat source shapes, etc

sikvelsigma commented 1 year ago

EBD part should work for you, just un-comment those parts and define weld_ selections, it should alive only elements of those selections when solving for each path (so you won't alive elems from weld_2 when solving weld_1)

sikvelsigma commented 1 year ago

and define killed_elems selection to specify what elements are dead at the start of the sim

Weldworld1 commented 1 year ago

Then for weld_2 again I need to copy the codes right with different weld time.

Weldworld1 commented 1 year ago

The killed_elem are for weld_1 only, right

sikvelsigma commented 1 year ago

What are you talking about, what copying? just specify 3 paths like this for example:

path_num = 3
...
steps(1) = 100, 100, 100        
!starting coordinates
x_start(1) = 0, 0, 0                    
y_start(1) = 0, 0, 0                    
z_start(1) = 0, 0, 0        
!finish coordinates         
x_finish(1) = 10, 10, 10                
y_finish(1) = 0, 0, 0                   
z_finish(1) = 0, 0, 0   
z_angle(1) = 0, 0, 0
sikvelsigma commented 1 year ago

if you need a cooling time after each path, you'll have to impl that yourself

Weldworld1 commented 1 year ago

Ok. But there is a catch. Lets assume total weld thickness is 6 mm and there will be 3 layers. So 3 paths are required. By putting only coordinates without elem birth and death will actual scenario of welding appear?

See here after first path the value of z should change, right but the code you just put there is no change in z. I am only talking about multipass welding with layer 1 to 3

Weldworld1 commented 1 year ago

The entire script you put is for only one layer. Not one path over another. That what I am talking

sikvelsigma commented 1 year ago

then change the z_start and z_finish, what's the problem?

sikvelsigma commented 1 year ago

you can use the script however you want and do the necessary modifications, i won't be updating it myself anytime soon so you can go ahead and code what you think you'll need, it's not a ready product to use, as i've said, just a prototype to give you a starting point. i've written it because all other welding examples for ansys on the web are garbage at best

Weldworld1 commented 1 year ago

Yes. No offence, if I make you angry, then I am sorry. Now just tell me one thing, suppose I want to simulate one multipass welding with starting point of every pass will be exactly at same x and Y position but z value will be different then there will be 3 loops right. First for paths, then for the elements and finally for the moving heat source. Just want to know am I wrong.

sikvelsigma commented 1 year ago

*do,kk,1,path_num handles the loop over paths, *do,ii,1,steps(kk)+1 handles the loop over steps you specified for each path

sikvelsigma commented 1 year ago

*dowhile,curr_el applies heat for each element near the current heat source position

Weldworld1 commented 1 year ago

Yes, but inside this loop there will be only one weld bead, for the next upper bead same code starting from path loop to be added.

Weldworld1 commented 1 year ago

As per your script heat source will move along xy plane,

sikvelsigma commented 1 year ago

heat source will move from starting coordinates to the finishing coordinates, it's not limited to xy global plane, the script aligns the local cs used by the heat source such that local X is pointed from start to finish, the rotation about this local X is handled by z_angle

sikvelsigma commented 1 year ago

anyway, just try to do stuff and see if it works, i don't think you can get anything useful out of this conversation without trying to sim

Weldworld1 commented 1 year ago

Alright, I will do this, and once I get what I want I will post the script in this thread

sikvelsigma commented 1 year ago

you can just fork the repo and push your code there