CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > CFX

Compiling User Fortran with CFX 14.0 on Win64

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 12, 2016, 12:34
Default
  #21
Senior Member
 
Join Date: Jun 2009
Posts: 1,873
Rep Power: 33
Opaque will become famous soon enough
Quote:
Originally Posted by CFXNewbie View Post
Thanks for your answer!

I understand, that the solution given by PeMo would prevent the solver from calling the subroutine in most cases, which would probably cause abortion of the run, as the result-value from the subroutine is required.

But is there no way to store the result after the first run of the subroutine and use the stored value again always when needed inside current Iteration Loop?
If you use the utility functions for the CFX memory management system, you can store anything you want in your private area, and reuse at will. However, since we do not have the details of what you are doing, I can only warn you that every call to the subroutine is not necessarily for the same mesh faces (assuming is called for faces). Therefore, if your calculation produces a single value for all the faces in the boundary condition, you are safe; otherwise, you must be careful how you store, and retrieve previous data to match the corresponding faces.

My 2 cents, and hope it helps
Opaque is offline   Reply With Quote

Old   February 24, 2016, 05:02
Default
  #22
New Member
 
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 10
CFXNewbie is on a distinguished road
Okay, Thanks!

Last edited by CFXNewbie; March 8, 2016 at 09:29.
CFXNewbie is offline   Reply With Quote

Old   February 24, 2016, 06:06
Default
  #23
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
I haven't read through your entire code but the fact that your routine is called several times within a single iteration isn't bad necessarily. Even if you run a serial computation some domains and boundaries are split in locales. I've had a similar experience and started outputting the amount of 'successful' actions of my subroutine and noticed it was never the same amount. In other words, as far as I understand, the entire domain is always split some form or another (irrespective of serial/parallel), so you'll always see multiple calls of your subroutine in a single iteration.
honcho62 is offline   Reply With Quote

Old   February 25, 2016, 10:42
Default
  #24
New Member
 
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 10
CFXNewbie is on a distinguished road
Quote:
Originally Posted by honcho62 View Post
I haven't read through your entire code but the fact that your routine is called several times within a single iteration isn't bad necessarily. Even if you run a serial computation some domains and boundaries are split in locales. I've had a similar experience and started outputting the amount of 'successful' actions of my subroutine and noticed it was never the same amount. In other words, as far as I understand, the entire domain is always split some form or another (irrespective of serial/parallel), so you'll always see multiple calls of your subroutine in a single iteration.
Thank you for your answer.

The problem is: In the new model I'm using the subroutine instead of the cfx-pre-expressions (old model). Nothing else has changed. The new model needs more computing time compared with the old model. As my task is, to replace the expressions by a subroutine, i cannot go back and use expressions. Thats why I'm desperately looking for a possibility to save computing time....
CFXNewbie is offline   Reply With Quote

Old   February 26, 2016, 02:51
Default
  #25
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
I'm far from an expert on this stuff. But my gut feeling says that Fortran should be as fast if not faster than CEL for simple equations. Have you considered checking things other than the subroutine, like your source coefficient. I've used a different source option (general momentum) and tweaking that coefficient can significantly speed up your simulation.
honcho62 is offline   Reply With Quote

Old   March 8, 2016, 13:46
Default
  #26
New Member
 
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 10
CFXNewbie is on a distinguished road
thanks again for your answers so far!

i think im very close to a solution now

my idea is, to find out the actual partition number and calculate the scalar only if Partition number is 1 in each Iteration loop. after having calculated it, i want to save it via Memory Manegement System (MMS) and read it from there, when partition number is different from 1.

how can i save a value with MMS and read it from there? i've read chapter 18.6. from the solver modelling guide, but still have no idea how i can save and read values. Ive tried

RZ(1)=P ...if Partition number is 1...
...
...
P=RZ(1) ...else: Partition number not equal 1...

but this didn't work.


Thanks for your help!!!
CFXNewbie is offline   Reply With Quote

Old   March 8, 2016, 14:57
Default
  #27
Member
 
Join Date: Jan 2016
Posts: 34
Rep Power: 10
honcho62 is on a distinguished road
The only experience I have with that is passing data to CFX via a junction box sub routine. I'm guessing you'd have to save this data in a pointer probably. I'm not sure how much work this might be, otherwise you could consider making a multi-body mesh and only apply it on the relevant body. It's the same thing, just much easier to accomplish.
honcho62 is offline   Reply With Quote

Old   March 8, 2016, 17:01
Default
  #28
Senior Member
 
Join Date: Jun 2009
Posts: 1,873
Rep Power: 33
Opaque will become famous soon enough
Quote:
Originally Posted by CFXNewbie View Post
thanks again for your answers so far!

i think im very close to a solution now

my idea is, to find out the actual partition number and calculate the scalar only if Partition number is 1 in each Iteration loop. after having calculated it, i want to save it via Memory Manegement System (MMS) and read it from there, when partition number is different from 1.

how can i save a value with MMS and read it from there? i've read chapter 18.6. from the solver modelling guide, but still have no idea how i can save and read values. Ive tried

RZ(1)=P ...if Partition number is 1...
...
...
P=RZ(1) ...else: Partition number not equal 1...

but this didn't work.


Thanks for your help!!!
Have you read the examples in the documentation ? For example, 18.8.1. Junction Box Example 1: Profile Boundary Conditions

It shows how to create a memory data area, store the value of interest, and later how to read it from another routine/function.

Hope the above helps,
Opaque is offline   Reply With Quote

Old   March 9, 2016, 10:22
Default
  #29
New Member
 
Emil Günther
Join Date: Nov 2015
Posts: 18
Rep Power: 10
CFXNewbie is on a distinguished road
Thank you for your answer!

I've read through example 18.8.1, I'think it's close to my Problem. My idea is now: First calculate and store my value once in each Iteration Loop, using a Junction Box Routine with Location

"Start of Coefficient Loop: Called at the start of each iteration loop. For a transient run, this relates to the inner Loop."

And then read it from stack with a CEL Routine, which is called as often as needed. My Problem now is: The junction box Routine is never executed and therefore the value the CEL Routine is reading from stack is allways Zero.

Any ideas how i can get my Junction Box Routine working?

Thank you!
CFXNewbie is offline   Reply With Quote

Old   March 9, 2016, 12:45
Default
  #30
Senior Member
 
Join Date: Jun 2009
Posts: 1,873
Rep Power: 33
Opaque will become famous soon enough
Did you activate the usage of the Junction Box Routine as outlined in the documentation ?

Quote:
18.2.2. Calling Junction Box Routines

Many junction box routines may be defined, but only those selected on the Solver Control tab will be called during execution of the CFX-Solver. For details, see Basic Settings Tab in the CFX-Pre User's Guide.
Hope the above helps,
Opaque is offline   Reply With Quote

Reply


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
Importing external DLL to Ansys CFX using user Fortran snpradeep CFX 2 May 16, 2014 04:52
How to set environmental variables of Intel Fortran +CFX? Christine MO CFX 0 September 23, 2011 12:11
CFX User Fortran: Multiple Outputs pingub CFX 1 October 26, 2010 15:49
error msg when compiling user fortran Ollimarc CFX 0 March 13, 2008 19:16
how to use USER FORTRAN with CFX cfd_99 Main CFD Forum 1 June 4, 1999 06:42


All times are GMT -4. The time now is 21:54.