ERP calculation using dpf-core

KristianHansen
KristianHansen Member Posts: 8
Name Dropper First Comment
**

Hi,
I am trying to calculate the Equivalent Radiated Power of a given surface, based on a named selection. I have performed a harmonic analysis using MSUP, and have created a named selection called "LARGE".

The code has a number of blocks:
1) Time
Here the time scoping is obtained

2) NS
Here a mesh scoping is obtained from a named selection called “LARGE”

3) Skin mesh
Here a “skin mesh region” is extracted from the full mesh, based on the NS mesh scoping

4) Disp
Here the displacements at the skin nodes are extracted as a field container, for all tfreq (frequency values)

5) ERP
Here the ERP should be calculated, but I continue to get an error:
DPFServerException: erp_accumulate_results:31<-ERP input parameters are missing or badly defined.

CODE:
path = r"C:\ERPTool_files\dp0\SYS-1\MECH\file.rst"

model = dpf.Model(path)

=============================================================================

Time

=============================================================================

tfreq = model.metadata.time_freq_support.time_frequencies
freqVal = np.array(tfreq.data)

=============================================================================

NS

=============================================================================

opNamedSel = dpf.operators.scoping.on_named_selection()
opNamedSel.inputs.named_selection_name.connect("LARGE")
opNamedSel.inputs.data_sources.connect(model)
NSmeshscope = opNamedSel.outputs.mesh_scoping

=============================================================================

Skin mesh

=============================================================================

fullMesh = model.metadata.meshed_region
op = dpf.operators.mesh.skin() # operator instantiation
op.inputs.mesh.connect(fullMesh)
op.inputs.mesh_scoping.connect(NSmeshscope)# optional
skinMesh = op.outputs.mesh()

=============================================================================

Disp

=============================================================================

op = dpf.operators.result.displacement() # operator instantiation
op.inputs.time_scoping.connect(tfreq)# optional
op.inputs.data_sources.connect(model)
op.inputs.mesh.connect(skinMesh)# optional
disp_fc = op.outputs.fields_container()

=============================================================================

ERP

=============================================================================

op = dpf.operators.result.erp_accumulate_results() # operator instantiation
op.inputs.fields_container.connect(disp_fc)
op.inputs.mesh.connect(skinMesh)
my_field = op.outputs.field()

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭

    Hi @KristianHansen , could you try providing all 7 input pins?

    (Image taken from the PyDPF help)

  • KristianHansen
    KristianHansen Member Posts: 8
    Name Dropper First Comment
    **

    Hi!

    I have read through the api reference, and updated the erp_accumulate_results() operator to the following:

    =============================================================================

    ERP

    =============================================================================

    op = dpf.operators.result.erp_accumulate_results() # operator instantiation
    op.inputs.fields_container.connect(disp_fc)
    op.inputs.mesh.connect(skinMesh)
    op.inputs.time_scoping.connect(0)
    op.inputs.mass_density.connect(1.293)
    op.inputs.speed_of_sound.connect(346.0)
    op.inputs.erp_type.connect(0)
    op.inputs.boolean.connect(False)
    op.inputs.factor.connect(1E-12)
    my_field = op.outputs.field()

    It does however still result in the error:
    DPFServerException: erp_accumulate_results:95<-ERP input parameters are missing or badly defined.

    I suspect either the displacement field container not being defined properly, or the mesh container not being in the correct format.

    I am currently in contact with EDRMedeso, a consultancy firm, to get the operator to work. They have escalated the issue to ANSYS.

    Please let me know if you are able to get the operator to work - i will be sure to post here if/when i get it to work.

    Br,
    Kristian

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 871
    100 Answers 500 Comments 250 Likes First Anniversary
    ✭✭✭✭

    Hi @KristianHansen I had a look at your code, tweaked it a little bit, but get the same error message as you do. This looks like a bug, either of the documentation, or of the operator itself. I've reported this to the PyDPF developers here: https://github.com/ansys/pydpf-core/issues/1285

    @Ayush Kumar @Paul Profizi FYI

  • KristianHansen
    KristianHansen Member Posts: 8
    Name Dropper First Comment
    **

    Thank you, Pernelle!
    I will keep an eye on the github thread.

    Br, Kristian