CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CFX post-processing - Current Time Step (https://www.cfd-online.com/Forums/cfx/25861-cfx-post-processing-current-time-step.html)

Molly May 25, 2008 15:07

CFX post-processing - Current Time Step
 
I'm trying to build an expression in CFX-Post to determine the work done by a fluid in a simple flat-plate FSI case. I'm having trouble when it comes to getting the correct time step in my expression - when I try to use ctstep, I get the total time step (80) at all times. Does anyone know how to get this parameter to reflect the current time step? The CFX help is singularly unhelpful, as usual.

Cheers!

CycLone May 25, 2008 22:26

Re: CFX post-processing - Current Time Step
 
current timestep (ctstep) is the current timestep number. You need "dtime", which returns the current value of the timestep number.

That said, why do you need the timestep value for this calculation?

-CycLone

Molly May 26, 2008 05:57

Re: CFX post-processing - Current Time Step
 
Well, fair enough. I'm not entirely sure how to achieve this work calculation, this was just one of the ideas I had as I've been working on this project. Do you have any recommendations as how to determine the work?

I was thinking I could determine the work by multiplying the force (areaint(pressure)@surface) by the plate displacement in the simulation minus the displacement I had set in Ansys. It's this last value that I'd need the current time step for.

If there's an easier way, I'd love to hear it.

Thanks! M

Molly May 26, 2008 08:13

Re: CFX post-processing - Current Time Step
 
Either way, I cannot get this value to work for me - when I try to enter it an expression, I get the following error:

"The following unrecognised name was referenced: dtime.."

I feel like I'm missing a crucial step in all this...

CycLone May 26, 2008 11:51

Re: CFX post-processing - Current Time Step
 
Hi Molly,

To get the displacement, just use "Mesh Displacement X|Y|Z", this is the displacement at the current timestep. You also need to account for the normal vs. tangential direction. This can be done by taking the dot product of the mesh displacement and surface normal. The following expression does all of this will return the total work at a surface in a single timestep:

Work = areaInt(Pressure * (Normal X*Mesh Displacement X + Normal Y*Mesh Displacement Y + Normal Z*Mesh Displacement Z))@Location

Just replace 'Location' with the name of your surface. You will then need to integrate this over the length of your run using a macro in Post.

It might be easier to create an algebraic AV in Pre equating to the local work per unit area as:

workPerUnitArea = Pressure * (Normal X*Mesh Displacement X + Normal Y*Mesh Displacement Y + Normal Z*Mesh Displacement Z

Then create a monitor expression equal to:

workInput = areaInt(workPerUnitArea)@Location

At the end of the run you can right click on the plot in the Solver Manager and export the plot data to a .csv file, which you can then load into Excel and integrate.

-CycLone

Molly May 28, 2008 13:08

Re: CFX post-processing - Current Time Step
 
Okay, thank you. I haven't gotten it quite right yet, however. I'm trying to do this as you've described in Pre: I assumed that by "AV" you mean additional variable, but I can't create an expression that way (only set units, tensor type, etc), so I created a new expression and inserted that into the monitored expression as you describe. The error I get says that WorkPerInputArea is an invalid argument.

Do I edit the AV in the command editor and place the expression in there?

Again, thank you so much, you've been very helpful.

Molly May 28, 2008 13:25

Re: CFX post-processing - Current Time Step
 
oh, I may have figured it out - I enter the algebraic details in the Fluid Models tab?

CycLone May 28, 2008 13:54

Re: CFX post-processing - Current Time Step
 
That's right.

Molly May 28, 2008 14:12

Re: CFX post-processing - Current Time Step
 
Okay. The boundary I'm trying to determine the work on is a 3D plate, and this is apparently an issue. As I start the solver, I get this error under Initial Conditions Supplied by Fields in the Input Files:

Domain Name : Default Domain

Mesh Coordinates

----------------------------------

Error in subroutine CEL_FORCALC : Normal unit vectors are only available for boundaries or 2d regions when using Expression Language

GETVAR originally called by subroutine SU_PERMANENT_DVAR

Any ideas? I'm sorry if this is getting annoying. I hope you can help. M

CycLone May 29, 2008 10:23

Re: CFX post-processing - Current Time Step
 
Is this a grid region?


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