-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change selection of state variables #1412
Comments
@mwetter this is a workaround while the root cause of the problem is inadequate tolerance settings. The state variable
Note that the I propose to revise the PR #1413 accordingly. |
@Mathadon : A problem is that |
Todo:
|
Also, set nominal attribute for Medium.T as this is a state if mSenFac > 1. For #1412
@Mathadon : I did some further modifications (all pushed to git) to make Also, if we use In short, it looks like |
@mwetter For U = m*medium.u + CSen*(medium.T-Medium.reference_T);
//baseproperties:
dT = T - reference_T;
h = dT*dryair.cp * X_air +
(dT * steam.cp + h_fg) * X_steam;
u = h-pStp/dStp; I think that we'll have to do some more equation inverting (in the equations above) if we want |
I think What do you think about |
That's a fair point. Chances are that the solver would still pick |
@Mathadon : I run experiments on all models of the Buildings library, using branches Using For Optimica, the differences are For Dymola, the differences are Selecting For Optimica, the differences are For Dymola, the differences are Therefore, using Another issue I see is that the state is pressure of density. (For I see either problematic because they only vary slightly, for example, pressure is 1E5 and variations can be in the order of 1 to 1000. I will try on branch Edit:
Branch will be |
@mwetter what is the nominal value for T in these simulations when T is a state? Nominal temperature differences are in the order of 1-2K for zone air while the nominal value of T is about 290K. This could cause the solver to solve for lower accuracy when T is a state. I guess that these benchmarks don't take solver accuracy into account? |
It was |
This merges https://github.com/lbl-srg/modelica-buildings/tree/IBPSASync_issue1412_humidifer_u_Cvode_d_T_state 154682c039d2ad083bf24be095d934f633f1f2c6, and makes some further changes. For #1412. [ci skip]
This merges https://github.com/lbl-srg/modelica-buildings/tree/IBPSASync_issue1412_humidifer_u_Cvode_d_T_state 154682c039d2ad083bf24be095d934f633f1f2c6, and makes some further changes. For #1412. [ci skip]
This is a work-around because addressing #1412 will take longer
As a work-around for #1412, changed solver for Humidifer_u
Note that with the old state selection,
simulates very slow. With Radau 1E-6, and with CVode 1E-8, it simulates quickly. This is with 096aa2a and Dymola 2020x. The trajectory of the above command is shown below: |
Todo:
|
Some models have higher number of nonlinear systems of equations. Likely due to different tearing, based on looking at Fluid.Examples.Performance.Example2. For #1412
The latest development branches are
The respective branches in Buildings have the same name, but |
The model IBPSA.Fluid.Interfaces.Examples.Humidifier_u shows oscillations if simulated with CVODE:
If changed to Radau, these oscillations do not occur.
Moreover, the statistics is for the original formulation:
In the Buildings library result comparison across tools, we remove the inverse function annotation in
basicFlowFunction_m_flow
and inbasicFlowFunction_dp
. This leads toIt turns out that this model then does not simulate with Cvode 1E-6 because the oscillations trigger the assertions in the media, e.g., the model is unstable. Best is to switch for this model to the Radau solver.
The text was updated successfully, but these errors were encountered: