Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added ansys calculator functions #76

Merged
merged 4 commits into from
May 9, 2021
Merged

Added ansys calculator functions #76

merged 4 commits into from
May 9, 2021

Conversation

bguttel
Copy link
Contributor

@bguttel bguttel commented Apr 8, 2021

Two functions that return vectors tangent and normal to a surface.
I used it to calculate surface participation ratios:

#SA participation ratio
vecE_normal = vecE.normal2surface('chip_holder1').__div__(epsilon_r) #Complex Vector
vecE_tangent = vecE.tangent2surface('chip_holder1').__mul__(epsilon_r) #Complex Vector
vec_E_total = vecE_normal.__add__(vecE_tangent)
E_squared = vec_E_total.dot(vecE).__abs__().real().__pow__(2)
E_surface = E_squared.integrate_surf(name='chip_holder1').evaluate()
E_surface -= E_surface_metal

p_SA = t* (E_surface / UE)

bguttel and others added 4 commits April 8, 2021 13:59
Two functions that return vectors tangent and normal to a surface.
I used it to calculate surface participation ratios, e.g.:
    p_metal = t* (E_surface_metal / UE)
    print(f'Metal-Air/Metal-Substrate participation ratio, p_MA = p_MS = {p_metal:.3}')

    #SA participation ratio
    vecE_normal = vecE.normal2surface('chip_holder1').__div__(epsilon_r) #Complex Vector
    vecE_tangent = vecE.tangent2surface('chip_holder1').__mul__(epsilon_r) #Complex Vector
    vec_E_total = vecE_normal.__add__(vecE_tangent)
    E_squared = vec_E_total.dot(vecE).__abs__().real().__pow__(2)
    E_surface = E_squared.integrate_surf(name='chip_holder1').evaluate()
    E_surface -= E_surface_metal

    p_SA = t* (E_surface / UE)
    print(f'Air-Substrate participation ratio, p_SA = {p_SA:.3}')
Also one change where an error is raised when `pint` is not properly imported.
Copy link
Owner

@zlatko-minev zlatko-minev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Great job!

pyEPR/ansys.py Outdated
@@ -41,21 +41,22 @@
try:
import pythoncom
except (ImportError, ModuleNotFoundError):
pass
raise NameError ("pythoncom module not installed. Please install.")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to make sure this can load on mac and other platforms without a warning, so we don't want it to crash in Metal and other dependencies :)

@@ -2936,6 +2937,30 @@ def getQty(self, name):
def integrate_line(self, name):
return self._integrate(name, "EnterLine")

def normal2surface(self, name):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@@ -445,7 +445,7 @@ def analyze_all_variations(self,

Specific params:
--------------------
variations : None returns all_variations otherwis this is a list with number
variations : None returns all_variations otherwise this is a list with number
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!!

@zlatko-minev zlatko-minev merged commit 9c619b7 into zlatko-minev:master May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants