|
[Sponsors] |
November 27, 2024, 17:12 |
Make a field variable single valued?
|
#1 |
New Member
Join Date: Apr 2022
Posts: 26
Rep Power: 4 |
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! |
|
|
|
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 |