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

derivative in CEL expressions

Register Blogs Community New Posts Updated Threads Search

Like Tree20Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 6, 2011, 09:37
Default
  #21
New Member
 
Matjaz Fleisinger
Join Date: Mar 2011
Posts: 17
Rep Power: 15
Matjaz is on a distinguished road
While cfx solver is running, every time step.
Matjaz is offline   Reply With Quote

Old   April 6, 2011, 09:38
Default
  #22
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
singer1812 is on a distinguished road
If you are using User Fortran anyway, why are you bothering with using AV to accumulate the velocity? Do it all within Fortran.
singer1812 is offline   Reply With Quote

Old   April 6, 2011, 09:42
Default
  #23
New Member
 
Matjaz Fleisinger
Join Date: Mar 2011
Posts: 17
Rep Power: 15
Matjaz is on a distinguished road
Probably i should, till now i haven't found suitable way to accumulate my past values, if i write them to a file, there are about 3000 entries written just for the first time step, then an error occurs, floating point: overflow or so....
Probably i should use MMS, but don't know how.
Matjaz is offline   Reply With Quote

Old   April 6, 2011, 09:44
Default
  #24
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
singer1812 is on a distinguished road
Well, to test out the AV way of doing it, put in a fixed value for delta_velocity (on the order of your expected velocity) and see if velocity rises as it should.
singer1812 is offline   Reply With Quote

Old   April 6, 2011, 09:46
Default
  #25
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
singer1812 is on a distinguished road
Since you are using average velocity anyway, when writing it to a file, do the areaAve of velocity first, assign that to a variable, and write that value out.

From what you describe, it seems, there is no reason to keep the invidual velocities.
singer1812 is offline   Reply With Quote

Old   April 6, 2011, 09:53
Default
  #26
New Member
 
Matjaz Fleisinger
Join Date: Mar 2011
Posts: 17
Rep Power: 15
Matjaz is on a distinguished road
I will, thank you, it would be also interesting to see how much the fortran routine is sloving the simulation....
Matjaz is offline   Reply With Quote

Old   June 12, 2011, 05:23
Default second time drivative
  #27
New Member
 
Join Date: Jun 2011
Posts: 6
Rep Power: 14
marjan is on a distinguished road
Dear edmund
Hi,I`ll be grateful if u help me.
How can I create second time derivative in CEL expressions?
I need to use second derivative of temperature with respect to time in heat equation as a source term.
Can i create additional variable of the before additional varible as u described?
Regards
marjan is offline   Reply With Quote

Old   June 13, 2011, 07:18
Default
  #28
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
singer1812 is on a distinguished road
On the surface I don't think this is possible, but really haven't given it much thought. Using 2nd order difference for the derivative, you need to store the 2 previous values. If it is possible you need to get pretty tricky with the oldest value needed.
singer1812 is offline   Reply With Quote

Old   June 17, 2011, 05:48
Default
  #29
Senior Member
 
Join Date: Jan 2010
Location: Germany
Posts: 268
Rep Power: 17
Zaktatir is on a distinguished road
Hello i just tried to use that option of TRANS_LOOP because i want to use and compare old Values of Mean Diameter with the new Ones but at the first Iteration it leads to failre : ERROR #001100279 has occurred in subroutine ErrAction. |
| Message: |
| Stopped in routine MEMERR
Zaktatir is offline   Reply With Quote

Old   June 17, 2011, 07:14
Default
  #30
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
singer1812 is on a distinguished road
Run a single iteration run with the AV set at a fixed number. Use that results file to initialize your new run, with the AV set back to what you want it to. I think that will fix your problem.

I think what is happening is your AV has no old value at the first iteration loop. Doing the above will allow it to have one and be called upon.
singer1812 is offline   Reply With Quote

Old   June 17, 2011, 09:23
Default
  #31
Senior Member
 
Join Date: Jan 2010
Location: Germany
Posts: 268
Rep Power: 17
Zaktatir is on a distinguished road
i made that but still the same problem (i initialize the run with single step run). I am wondering if through the initialization with a finished run the add. variable would be automatically updated?
Zaktatir is offline   Reply With Quote

Old   August 17, 2011, 05:28
Default Second time derivative
  #32
New Member
 
Join Date: Jun 2011
Posts: 6
Rep Power: 14
marjan is on a distinguished road
Dear Edmund,
I will be thankful if u help me,
In continue of previous post for making second time derivative I faced a problem: To use previous value of first time derivative, I created a new variable with value of first time derivative(dT) and add update loop term to library of this new variable, but value of dTold is not value of previous step and it has a little difference with dT. It means added term to library of dT doesn't work, yes?
But I could find previous value of temperature & account dT(first time derivative), with this method easily.
How is solve order?& when this term will lose previous value?

Last edited by marjan; August 30, 2011 at 08:33. Reason: find the solution
marjan is offline   Reply With Quote

Old   September 13, 2011, 17:49
Default Temporal pressure gradient
  #33
New Member
 
Join Date: Sep 2011
Posts: 8
Rep Power: 14
Hemo is on a distinguished road
Hi Edmund,

I am trying to use the AV approach you have described to get a temporal pressure gradient term at the outlet of my system. I have created an additional variable and applied the "Update Loop= TRANS_LOOP" in the command editor, however, my problem is how to link the AV ('Pprevious') to the Pressure field?

In the default domain tab I selected my 'Pprevious' variable, and set an algebraic expression equal to the Pressure. Is this correct or am I missing something obvious?

The simulation converges fine, but in post-processor when I view the results, my AV has the same values as the pressure, i.e. there is no time delay. I tried the same approach with velocity and got the same result.

Thanks in advance for your assistance
Hemo is offline   Reply With Quote

Old   September 14, 2011, 09:05
Default
  #34
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
singer1812 is on a distinguished road
You cant post process these. You need to monitor them.
singer1812 is offline   Reply With Quote

Old   September 14, 2011, 10:11
Default
  #35
New Member
 
Join Date: Sep 2011
Posts: 8
Rep Power: 14
Hemo is on a distinguished road
Hi Edmund, thanks for your reply.
Am I defining the AV correctly then?
I am unclear about what you mean in terms of monitoring the AV.
I'm sorry if this is a bit basic, but I am new to CFX

Thanks
Hemo is offline   Reply With Quote

Old   September 14, 2011, 10:14
Default
  #36
Senior Member
 
Edmund Singer P.E.
Join Date: Aug 2010
Location: Minneapolis, MN
Posts: 511
Rep Power: 20
singer1812 is on a distinguished road
I assume you are defining it correct.

You can only monitor while the solution is running using the output monitor. Once the solution completes the additional variable will lose its delay and take on the current value.
singer1812 is offline   Reply With Quote

Old   September 14, 2011, 17:20
Default
  #37
New Member
 
Join Date: Sep 2011
Posts: 8
Rep Power: 14
Hemo is on a distinguished road
Edmund, you are a legend! Thanks for your help
Hemo is offline   Reply With Quote

Old   September 28, 2011, 05:27
Default
  #38
New Member
 
Join Date: Jun 2011
Posts: 6
Rep Power: 14
marjan is on a distinguished road
Quote:
Originally Posted by singer1812 View Post
On the surface I don't think this is possible, but really haven't given it much thought. Using 2nd order difference for the derivative, you need to store the 2 previous values. If it is possible you need to get pretty tricky with the oldest value needed.
Hi Dear Edmund
I truly appreciate your kind,according your guess it was not possible until now I hope u could help me more, At first I used Update Loop for temperature and I got old value of this value and then created an expression for first time derivative(dT),now it seems UPDATE LOOP for this expression doesn't work because dTold-dT always is zero!!
What do u think about this problem?
regards
marjan is offline   Reply With Quote

Old   September 28, 2011, 06:26
Default
  #39
New Member
 
Join Date: Sep 2011
Posts: 8
Rep Power: 14
Hemo is on a distinguished road
Marjan,

Perhaps you already know this, but how are you monitoring this value?
At the end of each internal loop, the value of dTold will be effectively discarded.

If you set up a monitor in pre (Output control -> Monitor -> Monitor points and expressions) you should be able to see in solver that dTold takes the value of dT from the previous internal loop and remains constant until convergence has been reached for that time step (while dT will be changing).
However, as it seems that the value of dTold is not stored (and thus any calculations based on it) between time steps, I cannot see how a second derivative in time would be achieved.
Hemo is offline   Reply With Quote

Old   October 13, 2011, 04:48
Default
  #40
New Member
 
Join Date: Jun 2011
Posts: 6
Rep Power: 14
marjan is on a distinguished road
Thanks dear Hemo,
you are right and I couldn't find any solution for this problem still, Do u know anyone has used user FORTRAN for getting second time derivative and has succeeded?or are there other ways for this problem?
I will be so thankful if u could help me
marjan 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
Cel expressions RAMAN6089 CFX 13 November 30, 2009 23:17
junction box routine and CEL function bornspur CFX 2 February 3, 2009 02:24
Cel expressions for trasient problem Jervds CFX 0 March 4, 2008 10:03
Cel expressions Time dependent Juan Maria Campos CFX 8 December 27, 2007 18:16
CEL Expressions Nick CFX 3 September 25, 2007 14:54


All times are GMT -4. The time now is 06:37.