|
[Sponsors] |
Additional variable at a previous timestep for use in CEL |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 22, 2024, 11:36 |
Additional variable at a previous timestep for use in CEL
|
#1 |
New Member
Join Date: Apr 2022
Posts: 25
Rep Power: 4 |
Hello,
Please could I ask for some assistance, and thank you especially for all the help previously in the last few months I have a previous boundary condition implemented that had a 2 element windkessel (see picture). It required me to create an additional variable for pressure at the previous timestep i.e. P(t-1) What we had done for this was create an additional variable called pprev. Set it to scalar. In the default domain Modified field, pprev was activated as an Algebraic Equation and set to Pressure. This additional variable in the expression could then be used in the expression for the pout boundary condition using the final equation for P(t) in the picture by calling for P(t-1) as areaAve(pprev)@out1 (the model has multiple outlets that does similar) I now need to implement a 3 element windkessel (see 2nd picture). The methodology is fairly similar, but I'm having some difficulty as it requires creating an additional variable for flow rate Q at the previous timestep i.e. Q(t-1). Mainly as there is no global variable for flow. (Although density is constant in the model). A colleague suggested using velocity. First I have checked and tried the 2 inbuilt functions, and by using a normal velocity at outlet give a reasonable answer. Additional variable NormalVelocity = VelDotn and CEL VelDotn = (Velocity u*Normal X + Velocity v*Normal Y + Velocity w*Normal Z) Then option 1 for q - areaInt(NormalVelocity)@OutAorta and option 2 for q - Qout_option5=areaAve(NormalVelocity)@OutAorta * area()@OutAorta Option and Option 2 are equal and very similar to the massflow()@OutAorta / Density when post processed. Knowing this - What would be a reasonable way to implement Q(t-1)? Ref 2017 Acedo- Optimisation of a windkessel system for arterial simulation (thesis) |
|
February 22, 2024, 18:06 |
|
#2 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,819
Rep Power: 144 |
This thread may be interesting: derivative in CEL expressions
As you have got an expression which gives you the flow rate from the velocity, haven't you got an approach which will work for getting Q(last time step)?
__________________
Note: I do not answer CFD questions by PM. CFD questions should be posted on the forum. |
|
February 23, 2024, 05:54 |
|
#3 |
New Member
Join Date: Apr 2022
Posts: 25
Rep Power: 4 |
Thank you! That thread looks very helpful and has some ccl I can look at
|
|
February 24, 2024, 08:18 |
|
#4 |
New Member
Join Date: Apr 2022
Posts: 25
Rep Power: 4 |
Think I've managed to make it work
[Option 1] q(t-1) = areaInt(NormalVelocity)@OutAorta where Additional variable: NormalVelocity = VelDotn & CEL: VelDotn = (Velocity u*Normal X + Velocity v*Normal Y + Velocity w*Normal Z) [Option 2] q(t-1) = qprev where Additional variable: qprev = qout0 & CEL: qout0 = -massFlow()@OutAorta/1060 [kg/m^3] Also I didn't realise - but after reading the threads I need to put the unsupported setting "update Loop = TRANS_LOOP" The results look very wrong otherwise. The results for option 1 and 2 are slightly different with different sys/dias 126/65 vs 117/54 (not sure why?, although do still need to run it for more cycles as not fully stabilised yet) but both produce realistic looking pressure curves for a 3EWK at the aorta. Which is right - not sure. For now I will use option 1 as I need to use this variable for multiple outlets and I think it saves me creating multiple additional variables which 2 requires. Also from the thread referenced above: A value at a previous timestep can also be obtained in this manner, which I think is the more supported way to do this https://forum.ansys.com/forums/topic...-a-cel-in-cfx/ E.g. Previous Pressure = (areaAve(Pressure )@OUTLET-(Pressure.Time Derivative*dtstep)) |
|
February 29, 2024, 05:58 |
|
#5 | |
Member
Evelyn
Join Date: Mar 2021
Posts: 32
Rep Power: 5 |
Quote:
__________________
biofluid mechanics;Hemodynamics |
||
February 29, 2024, 06:03 |
|
#6 | |
Member
Evelyn
Join Date: Mar 2021
Posts: 32
Rep Power: 5 |
Quote:
__________________
biofluid mechanics;Hemodynamics |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Additional variable | Luigi | CFX | 9 | March 26, 2019 16:51 |
solidification viscosity governed through an additional variable | l.te | CFX | 8 | September 13, 2012 19:19 |
emag beta feature: charge density | charlotte | CFX | 4 | March 22, 2011 09:14 |
use additional variable for CO concentration | MinJaeHong | CFX | 0 | August 25, 2008 05:14 |
GETVAR SUBROUTINE for additional variable in CFX | Tuks | Main CFD Forum | 0 | November 8, 2005 06:13 |