Skip to main content
Solved

Source parallelogram


Forum|alt.badge.img

Hi all,

Is there a simple way to define a 2D parallelogram source?

edit:

succeed usuing DAT file, and then import as source file:

file1 = open("paraleloid.DAT","w")
Nx = 20


A = 4
B = 12
H = 9
theta = 30
a = A/Nx
h = H/(6*Nx)
dx = h / np.tan(np.pi*theta/180)

Ny = H/h
Ny = round(Ny)

N = Ny*Nx

L0 = str(N) +" "+str(4)+"\n"
file1.writelines(L0)

for j in range(Ny):
    for i in range(Nx):
        
        L1 = str(round(i*a+j*dx,2))+" "+str(round(h*j,2))+" "+str(0) +" "+str(0) +" "+str(0) +" "+str(1)+" "+str(1)+"\n"

        file1.writelines(L1)

file1.close() #to change file access modes

Thanks,

Nadav

 

Best answer by MichaelH

Hi Nadav,

Thanks for the post.  I also want to point out you can create any geometry in a CAD software, import this geometry via CAD Part: STEP/IGES/SAT, and then use Source Object to turn the CAD object into a source; this way you can define your source geometry with common practices rather than having to script out a specific shape.  Depending on the software you have and your ability to use CAD, this might be a useful alternative.  

View original
Did this topic help you find an answer to your question?

2 replies

MichaelH
Ansys Staff
Forum|alt.badge.img+2
  • Ansys Staff
  • 366 replies
  • Answer
  • August 31, 2022

Hi Nadav,

Thanks for the post.  I also want to point out you can create any geometry in a CAD software, import this geometry via CAD Part: STEP/IGES/SAT, and then use Source Object to turn the CAD object into a source; this way you can define your source geometry with common practices rather than having to script out a specific shape.  Depending on the software you have and your ability to use CAD, this might be a useful alternative.  


Forum|alt.badge.img
  • Author
  • Fully Spectral
  • 89 replies
  • September 1, 2022

Hi Michael,

 

Thanks for the answer.

 

Best regards,

Nadav


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings