CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > FloEFD, FloWorks & FloTHERM

API for FloEFD 15 (Pre-processing, Solving, Post-processing)

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 2, 2018, 00:08
Default API for FloEFD 15 (Pre-processing, Solving, Post-processing)
  #1
New Member
 
fung
Join Date: May 2018
Posts: 8
Rep Power: 8
fung is on a distinguished road
Hi. I am trying to us API to run FloEFD 15, including pre-processing, solving, post-processing. I found that there is only one API sample under the link “C:\Program Files\MentorGraphics\FloEFD API SDK 15\vb_sample”. Could anyone please give me advises on the follow issues? Thanks
1. Where can I find more samples/tutorials to use API to run FloEFD (including pre-processing, solving, post-processing)?
2. Is it possible to finished whole simulation procedures (including pre-processing, solving, post-processing) of FloEFD by using API?
3. Is there a record functions to record the setup procedures in FloEFD?
4. How to creat/change materials properties by using API?
5. I can use API to modify boundary conditions such as mass flow rate. Is it possible to creat a new boudnary condition by using API?
fung is offline   Reply With Quote

Old   May 7, 2018, 04:32
Default
  #2
Disabled
 
Join Date: Jul 2009
Posts: 616
Rep Power: 24
Boris_M will become famous soon enough
Hi fung,

1. No, there are currently not more examples of the API. This should only give a rough idea of how it works, especially the whole initiation of starting FloEFD etc.

2. In V15 this is not possible. In V17 it is possible to define also some boundary conditions but not all boundary conditions are available and especially if you want to select specific surfaces, the interaction with the CAD system by selecting the faces is necessary. Here it is then possible to run from pre- to post-processing with the given boundary condition limitations.

3. You mean like recording a Macro? No.
There is, however, a possibility to save a template with all settings in V17, this is not possible in older versions. The older templates only saved the General Settings definitions, not boundary conditions etc.

4. This is possible in V17.

5. This is only possible in V17. Older versions were only able to change boundary condition values. In V17 the following boundary conditions can be created:
- Boundary Condition
- Electrical Boundary Condition
- Rotating Region
- Solid Material
- Surface Source
- Tracer Study
- Volume Source

Hope this helps,
Boris
Boris_M is offline   Reply With Quote

Old   May 7, 2018, 05:37
Default
  #3
New Member
 
fung
Join Date: May 2018
Posts: 8
Rep Power: 8
fung is on a distinguished road
Hi Boris,

Thank you very much for the reply.

I have tested API with FloEFD 15 standalone version. The API functions were working. I have installed the same API setup file “FloEFD API SDK 16 x64.exe” for FloEFD 16 Solid Edge version. The library “NIKCommonApiLIb” was appeared in Excel VB. However, All API functions such as “OpenDocument()” were not working for FloEFD 16 Solid Edge version. Was there anything wrong?
Sub OpenDocument()
Dim NCA As New NIKCommonApiLib.BaseApiObject
Dim MD As NIKCommonApiLib.ModelDoc
Dim retval As Boolean
retval = NCA.LoadProductAPI2("FloEFD FE", "16")
Set MD = NCA.Attach2RunningObject.OpenDocument("D:\fung\A1_ Ball_Valve\ball valve.asm", "Project1")
End Sub

Is it possible to create/modify Velocity contour plots, flow streamline plots, velocity vector plots by using API in FloEFD?
fung is offline   Reply With Quote

Old   May 7, 2018, 08:12
Default
  #4
Disabled
 
Join Date: Jul 2009
Posts: 616
Rep Power: 24
Boris_M will become famous soon enough
You cannot use the V16 API SDK for a V15 software as the V15 software doesn't have the interface to the V16 API SDK. This has nothing to do with the CAD version, it needs the right version of the software and the API SDK.

No, the post processing is also limited. You can get some basic things such as values at a specific coordinate or the min and max parameter value in the computational domain and its location but you cannot create a cut plot and tell FloEFD to generate an image of it etc. This is something you will have to specify in advanced as in defining the cut plot and its settings and specify it in the batch results process so that after the solver has run, you can from the API run the batch result process which will then extract the plot images.

Regards,
Boris
Boris_M is offline   Reply With Quote

Old   May 8, 2018, 03:30
Default
  #5
New Member
 
fung
Join Date: May 2018
Posts: 8
Rep Power: 8
fung is on a distinguished road
Dear Boris

I see. Thank you very much.
fung is offline   Reply With Quote

Old   May 9, 2018, 04:35
Default
  #6
New Member
 
fung
Join Date: May 2018
Posts: 8
Rep Power: 8
fung is on a distinguished road
Dear Boris,

I have also tested SolidEdge ST10 integrated with FloEFD FES16.3.0 Build 3898. (not standalone version) The API setup file which I installed is "FloEFD API SDK 16 x64.exe". I found that all API samples copied from FloEFD API help are not working. I don't know what is wrong.

A error message "Run-time error '91': Object variable or With block variable not set" was appeared for the line "Set MD = IA.ActiveDocument" when I executed the following API.

Sub Solve()
Dim NCA As New NIKCommonApiLib.BaseApiObject
Dim IA As NIKCommonApiLib.InteractiveApplication
Dim MD As NIKCommonApiLib.ModelDoc
Dim MC As NIKCommonApiLib.ModelConfiguration
Dim FDA As NIKCommonApiLib.FDAProject
Dim retval As Boolean
retval = NCA.LoadProductAPI2("FloEFD FE", "16")
Set IA = NCA.Attach2RunningObject
Set MD = IA.ActiveDocument
Set MC = MD.ActiveConfiguration
Set FDA = MC.GetFluidDynamicAnalysisProject
retval = False
retval = FDA.Solve(True, True, True)
NCA.UnloadProductAPI
End Sub

Thanks
fung is offline   Reply With Quote

Old   May 9, 2018, 06:04
Default
  #7
Disabled
 
Join Date: Jul 2009
Posts: 616
Rep Power: 24
Boris_M will become famous soon enough
I think your issue might be a different one. If you go two rows up you are using the API for the standalone version for a Solid Edge version. The "FloEFD FE" needs to be "FloEFD FES".

I cannot tell if the rest is working with this correction, it might need some other fine-tuning. I recently worked on an example for V17 which I could send you but this is about creating boundary conditions which you cannot in older versions.

Regards,
Boris
Boris_M is offline   Reply With Quote

Old   May 9, 2018, 23:55
Default
  #8
New Member
 
fung
Join Date: May 2018
Posts: 8
Rep Power: 8
fung is on a distinguished road
Dear Boris,

Thanks for the comments.

I executed the "solver()" API with "FloEFD FES". The error message disappeared. However, there was nothing happened.

Yes. I want to have an example for V17.

You mentioned that in the previous reply I can get cut plot results by using API to run the batch result process if I defined the cut plot in advanced. Could you give me some examples for FloEFD 15?
fung is offline   Reply With Quote

Old   May 10, 2018, 09:01
Default
  #9
Disabled
 
Join Date: Jul 2009
Posts: 616
Rep Power: 24
Boris_M will become famous soon enough
Hi Fung,

I put the API example for V17 at the link below. This link won't work forever. I think 5 days or so.
http://www.floefd.com/download/API_E...loEFDV5_17.zip

It is an Excel spreadsheet with the first sheet being able to run simulations. So here you can find all the required VBA information on running a model. You need to know that you have to start and load the model with the API and then start it. The API is just controlling FloEFD in terms of starting FloEFD, load the model you want and then if a project exists and is selected, run the project. If there is no FloEFD started, then you cannot run the project.

I don't have an example on the batch result process. But again, if FloEFD is started and the model opened, the project active and a batch result is specified, the command for that can simply run the batch result processing.
You will need to create the plot you want to have and define the batch result process settings. This means you need to specify which plots shall be created.
It doesn't allow to fully automate FloEFD, it helps to simplify processes by some automation but not fully.

Boris
Boris_M is offline   Reply With Quote

Old   May 10, 2018, 21:46
Default
  #10
New Member
 
fung
Join Date: May 2018
Posts: 8
Rep Power: 8
fung is on a distinguished road
Dear Boris,

I see. The API sample has been downloaded. Thank you very much.

Best regards,
Fung
fung is offline   Reply With Quote

Old   June 4, 2018, 02:29
Default
  #11
New Member
 
fung
Join Date: May 2018
Posts: 8
Rep Power: 8
fung is on a distinguished road
Hi Boris,

I am working for temperature uniformity optimization by changing of geometry design. Is it possible to modify/replace simulation geometry (partially or whole geometry) by using API?

Thanks
fung is offline   Reply With Quote

Old   June 27, 2018, 10:24
Default
  #12
Disabled
 
Join Date: Jul 2009
Posts: 616
Rep Power: 24
Boris_M will become famous soon enough
This is a CAD option not a FloEFD option. You will need to use the CAD API.
It gets difficult if the geometry you are changing has boundary conditions applied to it, then you might need to reapply the boundary condition if the geometry is replaced as the related reference geometry names will be different and FloEFD loses the reference if the name cannot be found anymore.

Regards,
Boris
Boris_M is offline   Reply With Quote

Old   March 10, 2022, 09:49
Default floEFD API study
  #13
New Member
 
TsengChihYung
Join Date: Mar 2022
Posts: 1
Rep Power: 0
kinosinos is on a distinguished road
Hi Boris sir ,

I has study floEFD API recently, but still stuck in the beginning ..
May I have your API example for study ?
thanks!


Quote:
Originally Posted by Boris_M View Post
Hi Fung,

I put the API example for V17 at the link below. This link won't work forever. I think 5 days or so.
http://www.floefd.com/download/API_E...loEFDV5_17.zip

It is an Excel spreadsheet with the first sheet being able to run simulations. So here you can find all the required VBA information on running a model. You need to know that you have to start and load the model with the API and then start it. The API is just controlling FloEFD in terms of starting FloEFD, load the model you want and then if a project exists and is selected, run the project. If there is no FloEFD started, then you cannot run the project.

I don't have an example on the batch result process. But again, if FloEFD is started and the model opened, the project active and a batch result is specified, the command for that can simply run the batch result processing.
You will need to create the plot you want to have and define the batch result process settings. This means you need to specify which plots shall be created.
It doesn't allow to fully automate FloEFD, it helps to simplify processes by some automation but not fully.

Boris
kinosinos is offline   Reply With Quote

Old   September 2, 2023, 02:00
Default
  #14
New Member
 
Isabella Miller
Join Date: Sep 2023
Posts: 1
Rep Power: 0
Isabella256 is on a distinguished road
Hi Guys,
There wasn't a publicly available API for FloEFD 15 that allowed direct pre-processing, solving, and post-processing operations. FloEFD is a computational fluid dynamics (CFD) software package primarily used for simulating fluid flow and heat transfer in various industries.
However, software capabilities and APIs can change over time, so I recommend checking the official website or contacting the software provider (Mentor Graphics, now a part of Siemens Digital Industries Software) for the most up-to-date information regarding any APIs or custom scripting capabilities they might have introduced since then.
Isabella256 is offline   Reply With Quote

Reply

Tags
api, floefd


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with Min/max rho tH3f0rC3 OpenFOAM 8 July 31, 2019 09:48
High Courant Number @ icoFoam Artex85 OpenFOAM Running, Solving & CFD 11 February 16, 2017 13:40
Floating point exception error lpz_michele OpenFOAM Running, Solving & CFD 53 October 19, 2015 02:50
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20
calculation stops after few time steps sivakumar OpenFOAM Running, Solving & CFD 7 March 17, 2013 06:37


All times are GMT -4. The time now is 02:00.