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

journal file and user function in CFX

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 20, 2020, 05:08
Default journal file and user function in CFX
  #1
Member
 
Join Date: Oct 2017
Posts: 35
Rep Power: 8
Safasml is on a distinguished road
Hi all,
I create a user function in CFX-Pre to read the temperature data from a text file and I applied it into the inlet boundary condition. Now I want to write a journal file in WB to import this text file into my user function panel. When I record a journal, the data in the text file are written in the journal file (.wbjn). I don’t want this. I want the journal file to read the text file. Because the temperature in the text file may be changed (the text file is exported from a MATLAB code). So, I need that the previous data in the user function panel be removed and the new data be imported, as we usually do it when there is no journal file. Now can anyone tell me how to write the journal file?
Attached Images
File Type: png 1.png (18.9 KB, 13 views)
Safasml is offline   Reply With Quote

Old   March 20, 2020, 07:43
Default
  #2
Senior Member
 
Join Date: Jun 2009
Posts: 1,852
Rep Power: 33
Opaque will become famous soon enough
You are taking the difficult approach here.

Use the profile data approach, where the software looks for the text file at the location of your like.

Here are the steps:
- create an ANSYS CFX Profile Data file (see the documentation for format requirements)
- load the file in CFX-Pre using Tools/Initialize Data Editor
- the software will create an interpolation function with a reference to the file, it is never loaded until the solver starts to run
- the function refers to the file by path only. You can change the path directly in the CCL, or swaps file before the runs starts, and the setup remains the same.

Your MATLAB code can overwrite the file before every run, or rename the old one, and create a new one on the fixed location.

Keep in mind the file is static once the simulation starts, it only reads it once.
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum.
Opaque is offline   Reply With Quote

Old   March 21, 2020, 04:00
Default
  #3
Member
 
Join Date: Oct 2017
Posts: 35
Rep Power: 8
Safasml is on a distinguished road
Thank you very much dear Opaque. It works!
You suggested to me before using the profile data approach, but I thought maybe there is an easier way to apply a function to the BCs. So, I defined a user function and then I stuck…
I just made your suggestion and it really worked…
Thanks a lot
Safasml 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
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 ordinary OpenFOAM Installation 19 September 3, 2019 18:13
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc ofslcm OpenFOAM Community Contributions 25 March 6, 2017 10:03
[blockMesh] Errors during blockMesh meshing Madeleine P. Vincent OpenFOAM Meshing & Mesh Conversion 51 May 30, 2016 10:51
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error FerdiFuchs OpenFOAM Community Contributions 27 April 16, 2014 15:14
centOS 5.6 : paraFoam not working yossi OpenFOAM Installation 2 October 9, 2013 01:41


All times are GMT -4. The time now is 20:34.