CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   Reading results fields from res file using Userfortran/Junction Box (https://www.cfd-online.com/Forums/cfx/73427-reading-results-fields-res-file-using-userfortran-junction-box.html)

vivekcfd March 8, 2010 10:59

Reading results fields from res file using Userfortran/Junction Box
 
Hi All
I want to read e.g. velocity components, pressure, etc. from an existing steady-state solution file (.res file) to compute source terms for another simulation (another means with different boundary conditions) on the same grid. Could anyone tell me what is the best way to achieve this? Ot in other world, how can I hack a CFX res file using a userfortran.

Writing a source term is not difficult using CEL functions, however, my problem is that the source term of momentum equations is a function of an older/existing solution (u,v,w etc.) field.

Any help or hint in this regards would deeply be appriciated.

PS: I tried to use CFX-Pre to load certain variables from the existing solution. However this approach is too slow and for practical reasons not viable.

Thanks

stumpy March 8, 2010 13:30

In your first simulation create AV's equal to velocity components, pressure etc. In your second simulation write the source term in terms of the AV's, then don't solve the AV's, so they don't get updated (expert parameter, perhaps: solve scalars = f).

vivekcfd March 9, 2010 05:07

Hi Stumpy
thanks for this practical idea. I assume if I make a restart (with -ini and -interp options) from the initial run, the values of AVs from the old simulation will be available in the new run.

In fact my source term is a mixture of fields from existing or older and the current solution.

For instance for u component of velocity S_u = rho w_old (du/dz)_actual
This approach does not allow me to define new AV in the second run.

I shall soon try it.
thanks


All times are GMT -4. The time now is 13:48.