Matlab PDE工具箱无法解决对流扩散

问题描述 投票:0回答:1

出于好奇,我检查了Matlab的PDE工具箱,发现它无法求解平流扩散方程according to the documentation here

在文档中编写的PDE中,您只有扩散项,而没有对流项。有什么原因吗?对于这样的标准方程式,我希望Matlab能够处理它。

matlab scientific-computing pde
1个回答
0
投票

您应该可以在specifying a non-constant f之前做到这一点。我当前无权获得Matlab许可,但是根据文档,您可以访问应包含无源标量及其渐变和包含坐标位置的位置的结构状态。这应该使您可以指定恒定速度或使用坐标位置构造解析速度曲线(例如Poiseuille曲线)。 (也许也可以在该函数中使用逐点速度分布图吗?)

尝试设置m = 0d = 1c = D(扩散系数),a = 0计算f,使用两者结构状态(state.ux,state.uy,state.uz,它们是所传输标量u的梯度)和location(location.x,location.y和location.z)以施加分析速度曲线。以下伪代码应产生在x方向上具有恒定速度的扩散对流方程。

% set density
rho = 1;

% set viscosity
D = 1;

% set constant velocity
vel = [1, 0, 0];

% set coefficients for diffusion equation
specifyCoefficients(model,'m',0,...
                          'd',rho,...
                          'c',D,...
                          'a',0,...
                          'f',@fcoeffunction);

...

%% function for determining f
function f = fcoeffunction(location,state)

    f = - rho*( vel(1)*state.ux + vel(2)*state.uy + vel(3)*state.uz); %calculate f from constant velocities

end

© www.soinside.com 2019 - 2024. All rights reserved.