Skip to content

Commit

Permalink
parameterized Djordjevic Sarkar model in AEDT (#3827)
Browse files Browse the repository at this point in the history
* fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: ring630 <@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
hui-zhou-a and pre-commit-ci[bot] authored Oct 31, 2023
1 parent 1b770ed commit 95f50e4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
6 changes: 6 additions & 0 deletions _unittest/test_03_Materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,3 +237,9 @@ def test_11_material_case(self):
assert self.aedtapp.materials["Aluminum"] == self.aedtapp.materials["aluminum"]
assert self.aedtapp.materials["Aluminum"].name == "aluminum"
assert self.aedtapp.materials.add_material("AluMinum") == self.aedtapp.materials["aluminum"]

def test_12_material_model(self):
mat = self.aedtapp.materials.add_material("ds_material")
self.aedtapp["$dk"] = 3
self.aedtapp["$df"] = 0.01
assert mat.set_djordjevic_sarkar_model(dk="$dk", df="$df")
46 changes: 46 additions & 0 deletions pyaedt/modules/Material.py
Original file line number Diff line number Diff line change
Expand Up @@ -2278,6 +2278,52 @@ def is_dielectric(self, threshold=100000):
"""
return not self.is_conductor(threshold)

@pyaedt_function_handler
def set_djordjevic_sarkar_model(
self,
dk=4,
df=0.02,
i_freq=1e9,
sigma_dc=1e-12,
freq_hi=159.15494e9,
):
"""Set Djordjevic-Sarkar model.
Parameters
----------
dk : int, float, str, optional
Dielectric constant at input frequency.
df : int, float, str, optional
Loss tangent at input frequency.
i_freq : int, float, optional.
Input frequency in Hz.
sigma_dc : int, float, optional
Conductivity at DC.
freq_hi : int, float, optional
High Frequency corner in Hz.
Returns
-------
bool
``True`` if successful, ``False`` otherwise.
"""

# K = f"({dk} * {df} - {sigma_dc} / (2 * pi * {i_freq} * e0)) / atan({freq_hi} / {i_freq})"
K = "({} * {} - {} / (2 * pi * {} * e0)) / atan({} / {})".format(dk, df, sigma_dc, i_freq, freq_hi, i_freq)
epsilon_inf = "({} - {} / 2 * ln({}**2 / {}**2 + 1))".format(dk, K, freq_hi, i_freq)
freq_low = "({} / exp(10 * {} * {} / ({})))".format(freq_hi, df, epsilon_inf, K)

ds_er = "{} + {} / 2 * ln(({}**2 + Freq**2) / ({}**2 + Freq**2))".format(epsilon_inf, K, freq_hi, freq_low)
cond = "{} + 2 * pi * Freq * e0 * ({}) * (atan(Freq / ({})) - atan(Freq / {}))".format(
sigma_dc, K, freq_low, freq_hi
)
# ds_tande = "{} / (e0 * {} * 2 * pi * Freq)".format(cond, ds_er)

self.conductivity = cond
self.permittivity = ds_er

return self.update()

@pyaedt_function_handler()
def update(self):
"""Update the material in AEDT.
Expand Down

0 comments on commit 95f50e4

Please sign in to comment.