离散空间中的PDE以与Modelica一起使用 [英] Discretizing PDE in space for use with modelica

查看:130
本文介绍了离散空间中的PDE以与Modelica一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在上一门名为动态系统建模"的课程,并承担了在Modelica中用分布式温度描述对温水箱进行建模的任务.

I am currently doing a course called "Modeling of dynamic systems" and have been given the task of modeling a warm water tank in modelica with a distributed temperature description.

大多数任务进展顺利,我小组的任务是将由于浮力效应而产生的热通量引入模型中.这是我们卡住的地方.

Most of the tasks have gone well, and my group is left with the task of introducing the heat flux due to buoyancy effects into the model. Here is where we get stuck.

给出的等式是这样的: 给出PDE

the equation given is this: Given PDE

但是我们如何将其离散化为可在modelica中使用的东西?

But how do we discretize this into something we can use in modelica?

我们最终得到的离散化版本是这样的:

The discretized version we ended up with was this:

(Qd_pp_b[k+1] - Qd_pp_b[k]) / h_dz = -K_b *(T[k+1] - 2 * T[k] + T[k-1]) / h_dz^2

其中Qd_pp_b是左侧变量,即热通量,k是储罐的当前层,T是层中的温度.

where Qd_pp_b is the left-hand side variable, ie the heat flux, k is the current slice of the tank and T is the temperature in the slices.

我们在正确的道路上吗?还是完全错误?

Are we on the right path? or completely wrong?

推荐答案

这似乎不是一个微分方程(按原样),所以没有周围问题就没有意义.对于二阶导数,应始终创建辅助变量,对于每个偏导数,均应创建单独的方程式.我为参数添加了虚拟值,并为T[k]添加了虚拟方程式.这可以模拟,这与您的预期有关吗?

This doesn't seem to be a differential equation (as is) so this does not make sense without surrounding problem. For the second derivative you should always create auxiliary variables and for each partial derivative a separate equation. I added dummy values for parameters and dummy equations for T[k]. This can be simulated, is this about what you expected?

model test
  constant Integer n = 10;
  Real[n] Qd_pp_b;
  Real[n] dT;
  Real[n] T;
  parameter Real K_b = 1;
equation
    for k in 1:n loop
      der(Qd_pp_b[k]) = -K_b *der(dT[k]);
      der(T[k]) = dT[k];
      T[k] = sin(time+k);
    end for;
end test;

这篇关于离散空间中的PDE以与Modelica一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆