|
[Sponsors] |
April 18, 2011, 12:10 |
Read values from previous timesteps
|
#1 |
Senior Member
Ugly Kid Joe
Join Date: Aug 2010
Posts: 193
Rep Power: 16 |
I wrote a FORTRAN subroutine for a RK-4 order scheme and want to know how do I have access to the values at previous timesteps ?????????
Can anyone help me out ???? Thank you very much. |
|
April 18, 2011, 16:34 |
|
#2 |
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17 |
CFX is economic. It stores only what it requires. More than two time steps are never required.
It will be very challaging to overcome this. Contact ANSYS service. May be they can help.
__________________
- - - - - ------------------------------------------------------------------------ Please do not forget: I am not paid for answering your questions. Thousands of issues can cause a division by zero. Please do not capture a thread, with the argument: "I have the same issue ...." |
|
April 18, 2011, 17:39 |
@ joey2007
|
#3 |
Senior Member
Ugly Kid Joe
Join Date: Aug 2010
Posts: 193
Rep Power: 16 |
Can you please explain " It stores only what it requires. More than two time steps are never required" ???
Can CFX STORE values from previous timesteps ??? What I figured out was to use the write and read command in FORTRAN to write/read a value to/from an externally created txt file The following link gives examples on how to READ/WRITE to an external file. http://www.livephysics.com/computati...-handling.html Hope this thread helps other people having similar problems. Regards. |
|
April 18, 2011, 19:27 |
|
#4 | |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Quote:
If you wish to store a small number of values then writing to a file is OK. But if you want the whole solution field then writing to a file will slow the simulation down. This is not a very elegant solution, better to access the variables that are already stored in CFX than write them to a file. Or do you need access to variables further back then the last time step? |
||
April 18, 2011, 19:47 |
@ Ghorrocks
|
#5 |
Senior Member
Ugly Kid Joe
Join Date: Aug 2010
Posts: 193
Rep Power: 16 |
I only need access to a small number of variables like displacement and velocity at every timestep. So I guess writing a subroutine is the best way.
BTW whats a second order time differencing ???????? |
|
April 18, 2011, 21:14 |
@ghorrocks
|
#6 |
Senior Member
Ugly Kid Joe
Join Date: Aug 2010
Posts: 193
Rep Power: 16 |
Can I have access to velocity and displacement values at previous time steps using 2nd order time differencing ????? I just need the values of velocity and displacement from previous time step.
According to you what would be the best way ??? |
|
April 19, 2011, 05:07 |
|
#7 |
New Member
Matjaz Fleisinger
Join Date: Mar 2011
Posts: 17
Rep Power: 15 |
Hi, does this fortran writing to and reading from file in your simulation work OK?
I have the same problem, but when i try to write to file i find that my fortran routine executes many times during the first time step, and then an error occurs. In a file created by fortran routine there are about 3000 entries then. The cfx fortran manual on the third page says that: "Note that, in general, your user CEL function will be called several times during each iteration and the value of NLOC will be different for each call. This is because the CFX-Solver will split the specified region (for example, a boundary condition region) into a number of smaller ‘pieces’ and call your function for each piece. Your user subroutine should be coded to deal with this." It is interesting, that if my routine doesn't write to a file, the values of velocity comes back to cfx solver right, but these are delta_values. What i would like to do is to memorize the total value like: v = v + dv , but i stil haven't figured out how to do it. Regards, Matjaz |
|
April 19, 2011, 07:40 |
|
#8 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,854
Rep Power: 144 |
Prof Chaos, I suggest you look 2nd order time differencing up - it is pretty basic CFD stuff so you had better understand it.
I suspect with 2nd order time differencing you will be able to access previous timesteps through fortran. I have never done it, but I suspect it can be done. |
|
April 22, 2011, 17:07 |
|
#9 |
Senior Member
Join Date: Mar 2009
Location: Europe
Posts: 169
Rep Power: 17 |
@vmlxb6: It is quite challenging to know more than Glenn. However it is even more challenging to access field variable values from previous time steps. I discussed it already here:
http://www.cfd-online.com/Forums/cfx...-timestep.html If you just want to store single values at the actual time step and read again later on, you may use MMS as it is explained in the modeling manual chapter 17.6.
__________________
- - - - - ------------------------------------------------------------------------ Please do not forget: I am not paid for answering your questions. Thousands of issues can cause a division by zero. Please do not capture a thread, with the argument: "I have the same issue ...." |
|
April 22, 2011, 19:56 |
@ Matjaz
|
#10 |
Senior Member
Ugly Kid Joe
Join Date: Aug 2010
Posts: 193
Rep Power: 16 |
My subroutine takes in 4 arguments and returns just 1 argument back i.e the displacement. my code had the statement RET(1,1) = displacement but that wrote thousands of values for RET
Then I changed it to DO ILOC = 1,NLOC RET(ILOC,1)=displacement END DO This set all my RET values at all the locations to the same value as that of displacement. Now my code works fine. Hope this helps !!!!!!!!!!! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
It would be wonderful if a tool for FoamToTecplot is available | luckyluke | OpenFOAM Post-Processing | 165 | November 27, 2012 07:54 |
Velocity gradients from previous timesteps | Ed Kay | FLUENT | 0 | March 4, 2010 09:04 |
max node values exceed max element values in contour plot | jason_t | FLUENT | 0 | August 19, 2009 12:32 |
exact face values | RubenG | Main CFD Forum | 0 | June 22, 2009 12:09 |
Plotting raw data values | Wilesco | Siemens | 0 | January 5, 2006 06:34 |