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

Add single surface DistributedAnalysis.get_Qsurface #123

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions pyEPR/core_distributed_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -883,10 +883,10 @@ def get_Qdielectric(self, dielectric, mode, variation, U_E=None):
str(mode)+' = ' + str(p_dielectric))
return pd.Series(Qdielectric)

def get_Qsurface_all(self, mode, variation, U_E=None):
def get_Qsurface(self, mode, variation, name, U_E=None):
'''
calculate the contribution to Q of a dielectric layer of dirt on all surfaces
set the dirt thickness and loss tangent in the config file
Calculate the contribution to Q of a dielectric layer of dirt on a given surface.
Set the dirt thickness and loss tangent in the config file
ref: http://arxiv.org/pdf/1509.01854.pdf
'''
if U_E is None:
Expand All @@ -895,16 +895,13 @@ def get_Qsurface_all(self, mode, variation, U_E=None):
Qsurf = OrderedDict()
print('Calculating Qsurface for mode ' + str(mode) +
' (' + str(mode) + '/' + str(self.n_modes-1) + ')')
# A = self.fields.Mag_E**2
# A = A.integrate_vol(name='AllObjects')
# U_surf = A.evaluate(lv=lv)
calcobject = CalcObject([], self.setup)
vecE = calcobject.getQty("E")
A = vecE
B = vecE.conj()
A = A.dot(B)
A = A.real()
A = A.integrate_surf(name='AllObjects')
A = A.integrate_surf(name=name)
U_surf = A.evaluate(lv=lv)
U_surf *= config.dissipation.th*epsilon_0*config.dissipation.eps_r
p_surf = U_surf/U_E
Expand All @@ -913,6 +910,14 @@ def get_Qsurface_all(self, mode, variation, U_E=None):
print('p_surf'+'_'+str(mode)+' = ' + str(p_surf))
return pd.Series(Qsurf)

def get_Qsurface_all(self, mode, variation, U_E=None):
'''
Calculate the contribution to Q of a dielectric layer of dirt on all surfaces.
Set the dirt thickness and loss tangent in the config file
ref: http://arxiv.org/pdf/1509.01854.pdf
'''
return self.get_Qsurface(mode, variation, name='AllObjects', U_E=U_E)

def calc_Q_external(self, variation, freq_GHz, U_E = None):
'''
Calculate the coupling Q of mode m with each port p
Expand Down