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

Make a field variable single valued?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 27, 2024, 17:12
Default Make a field variable single valued?
  #1
New Member
 
Join Date: Apr 2022
Posts: 26
Rep Power: 4
3nhu1 is on a distinguished road
Hi, thank you for all your help in this forum previously as it has been massive.

Recently I used the tutorial provided here https://innovationspace.ansys.com/kn...g-userfortran/ to get the value of an expression at the previous timestep without using UserFortan or Update Loop = TRANS_LOOP, this was by using a monitor point and arithmetic sum method. I have managed to use this to get the value of p(t-1) and q(t-1) for the previous timestep and from monitoring these points this works nicely!

However I have 2 very small outlets, which makes initialisation important. I've had to run a steady simulation first, getting some variables (table below). The steady simulation also finished with the p(t) and q(t) current timestep which can be initialised. But I also defined the p(t-1) and q(t-1) terms to be initialised when starting the transient simulation as these values default to 0 by the solver otherwise and the poor initial guess for q(t-1) will cause pressure at the 2 small outlets will diverge.

(Table from steady solution end)
| Courant Number | 2.27E-05 | 5.65E+02 |
| Density | 1.06E+03 | 1.06E+03 |
| Pressure | 7.91E+03 | 8.31E+03 |
| pout0prev | 8.31E+03 | 8.31E+03 |
| pout1prev | 8.31E+03 | 8.31E+03 |
| pout2prev | 8.31E+03 | 8.31E+03 |
| qout0prev | -9.59E-07 | -9.59E-07 |
| qout1prev | 1.13E-06 | 1.13E-06 |
| qout2prev | 1.39E-06 | 1.39E-06 |
| Velocity | 5.53E-10 | 7.13E-01 |
| Dynamic Viscosity | 4.00E-03 | 4.00E-03 |

Now I then set up the transient model, having created an AV for qout0prev so this can be used, but I am now getting this error. (please see outfile)

This is the error The parameter 'Expression Value' is defined to be Single Valued but it depends on the field variable: qout0prev Error processing expression: Expression Value = pout0

I define pout0 = ((areaAve(pout0prev)@OutAorta*(cp0*res0d/dt)) + (res0d*(qout0*(1+(res0p/res0d)+(cp0*res0p/dt))- (qout0prev)* (cp0*res0p/dt))))*(1/(1+(cp0*res0d/dt)))

qout0 = -massFlow()@OutAorta/1060 [kg/m^3]
qout0prevvalue = probe(Expression Value.Arithmetic Sum)@MPcurrentoutletflow - probe(Expression Value)@MPcurrentoutletflow

And an AV qout0prev to be equal to qout0prevvalue


Question
1. How do I fix this? Is there a function to make a field variable single valued?
2. On another question on initialisation, I understand checking continue history from when using a previous res file carries over the convergence history and iteration counters, does it carry additional initial conditions versus when that box is not checked?
3. Alternatively is it possible specify a "Value" for qout0prev by editing def file in command editor using like this https://ansys13.ansys.com/KnowledgeA...13/676913.pdf?

Thank you!
Attached Files
File Type: txt outfile.txt (28.6 KB, 3 views)
3nhu1 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
[Other] dynamicTopoFVMesh and pointDisplacement RandomUser OpenFOAM Meshing & Mesh Conversion 6 April 26, 2018 08:30
how can make normal shock in the nozzle at inlet B.C : Pressure Far field SonicGhoul FLUENT 2 May 8, 2016 06:16
variable density in single fluid simulation not running with total energy viking CFX 2 September 18, 2012 21:19
emag beta feature: charge density charlotte CFX 4 March 22, 2011 10:14
error in COMSOL:'ERROR:6164 Duplicate Variable' bhushas COMSOL 1 May 30, 2008 05:35


All times are GMT -4. The time now is 13:11.