|
[Sponsors] |
Implementation of an expression with reference to an earlier timestep |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 2, 2011, 05:45 |
Implementation of an expression with reference to an earlier timestep
|
#1 |
New Member
Join Date: Jun 2011
Posts: 5
Rep Power: 15 |
Hi,
i've got a problem I cannot solve with the cfx tutorials. In my simulation i have got several openings with loss coefficients. These loss coefficients depend on the mass flow and should change to achieve a certain mass flow. My idea ist to have a time dependent loss coefficient. so L(t=1)=L(t=0)+delta(L) and L(t=2)=L(t=1)+delta(L) every timestep the delta(L) is calculated with the actual mass flow which isn't a problem at all. But i don't know how to refer to an expression from an earlier time step. thank you for you help! |
|
November 2, 2011, 21:54 |
|
#2 | |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144 |
Quote:
If you know the mass flows then why not just apply a mass flow boundary? |
||
November 8, 2011, 04:07 |
|
#3 |
New Member
Join Date: Jun 2011
Posts: 5
Rep Power: 15 |
Thank you for your answer.
I don't think I can apply a mass flow boundary condition to an opening. Even if it was possible, the idea is to simulate the dynamic behaviour of a system which tries to achieve a certain condition. |
|
November 8, 2011, 05:20 |
|
#4 | |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144 |
Quote:
I have no idea what your final sentence means. |
||
November 8, 2011, 05:44 |
|
#5 |
New Member
Join Date: Jun 2011
Posts: 5
Rep Power: 15 |
Sorry for my bad english.
What I tried to say is the following: I want to have model with loss coefficients set for the openings. These loss coefficients can should be calculated at every timestep during my transient simulation. To do so I always need the loss coefficient from en earlier timestep. My idea was to export the value of the loss coefficient L(t=0) to an external data file. Then doing the calculation and having L(t=1) as an input for the next timestep. Is there an easy way to do so? thanks Last edited by MichaelN; November 8, 2011 at 08:44. |
|
November 8, 2011, 17:37 |
|
#6 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144 |
You will have to use fortran to read and write to the file, and if you are using fortran then you can simply store the old value so no need to write to a file.
You have two options available: 1) User fortran 2) Use the trick which allows you to access scalars from previous time steps (do a search on the forum to find this) I think option 1 is best for your application based on what you have described. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Second Derivative Zero - Boundary Condition | fu-ki-pa | OpenFOAM | 11 | March 27, 2021 05:28 |
Error with Wmake | skabilan | OpenFOAM Installation | 3 | July 28, 2009 01:35 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
G95 + CGNS | Bruno | Main CFD Forum | 1 | January 30, 2007 01:34 |
Building OpenFoAm on SGI Altix 64bits | anne | OpenFOAM Installation | 8 | June 15, 2006 10:27 |