|
[Sponsors] |
March 20, 2020, 06:08 |
journal file and user function in CFX
|
#1 |
Member
Join Date: Oct 2017
Posts: 35
Rep Power: 9 |
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? |
|
March 20, 2020, 08:43 |
|
#2 |
Senior Member
Join Date: Jun 2009
Posts: 1,880
Rep Power: 33 |
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. |
|
March 21, 2020, 05:00 |
|
#3 |
Member
Join Date: Oct 2017
Posts: 35
Rep Power: 9 |
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 |
|
|
|
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 19:13 |
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc | ofslcm | OpenFOAM Community Contributions | 25 | March 6, 2017 11:03 |
[blockMesh] Errors during blockMesh meshing | Madeleine P. Vincent | OpenFOAM Meshing & Mesh Conversion | 51 | May 30, 2016 11:51 |
[swak4Foam] Swak4FOAM 0.2.3 / OF2.2.x installation error | FerdiFuchs | OpenFOAM Community Contributions | 27 | April 16, 2014 16:14 |
centOS 5.6 : paraFoam not working | yossi | OpenFOAM Installation | 2 | October 9, 2013 02:41 |