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

Implementation of an expression with reference to an earlier timestep

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 2, 2011, 05:45
Default Implementation of an expression with reference to an earlier timestep
  #1
New Member
 
Join Date: Jun 2011
Posts: 5
Rep Power: 15
MichaelN is on a distinguished road
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!
MichaelN is offline   Reply With Quote

Old   November 2, 2011, 21:54
Default
  #2
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
But i don't know how to refer to an expression from an earlier time step.
You cannot.

If you know the mass flows then why not just apply a mass flow boundary?
ghorrocks is offline   Reply With Quote

Old   November 8, 2011, 04:07
Default
  #3
New Member
 
Join Date: Jun 2011
Posts: 5
Rep Power: 15
MichaelN is on a distinguished road
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.
MichaelN is offline   Reply With Quote

Old   November 8, 2011, 05:20
Default
  #4
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
Quote:
I don't think I can apply a mass flow boundary condition to an opening
You can't. You make it an inlet or outlet.

I have no idea what your final sentence means.
ghorrocks is offline   Reply With Quote

Old   November 8, 2011, 05:44
Default
  #5
New Member
 
Join Date: Jun 2011
Posts: 5
Rep Power: 15
MichaelN is on a distinguished road
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.
MichaelN is offline   Reply With Quote

Old   November 8, 2011, 17:37
Default
  #6
Super Moderator
 
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,852
Rep Power: 144
ghorrocks is just really niceghorrocks is just really niceghorrocks is just really niceghorrocks is just really nice
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.
ghorrocks 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
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


All times are GMT -4. The time now is 21:45.