フィルターのクリア

How to set space-varying boundary conditions?

2 ビュー (過去 30 日間)
Stephan
Stephan 2017 年 3 月 1 日
コメント済み: Stephan 2017 年 3 月 2 日
Hello,
the following code gives 6 faces. I want to add a space-varying boundary condition for one face (F6). I think it is not possible to use applyBoundaryCondition(). How can I divide face F6 into small slices to specify constant boundary conditions for each of them?
Many thanks
Stephan
% Create a 3-dimensional PDE Model
model = createpde(3);
% Construct the Geometry
[x,y,z] = meshgrid([-3:0.25:3],[-2:0.25:2],[-1:0.25:1]);
% Create the convex hull.
x = x(:);
y = y(:);
z = z(:);
K = convhull(x,y,z);
% Put the data in the correct shape for |geometryFromMesh|.
nodes = [x';y';z'];
elements = K';
% Create a PDE model and import the mesh.
geometryFromMesh(model,nodes,elements);
% Plot geometry
figure
pdegplot(model,'FaceLabels','on')
title('Bracket with Face Labels')

採用された回答

Alan Weiss
Alan Weiss 2017 年 3 月 1 日
You can use applyBoundaryCondition. You just have to create a mesh for the geometry.
% Create a 3-dimensional PDE Model
model = createpde(3);
% Construct the Geometry
[x,y,z] = meshgrid([-3:0.25:3],[-2:0.25:2],[-1:0.25:1]);
% Create the convex hull.
x = x(:);
y = y(:);
z = z(:);
K = convhull(x,y,z);
% Put the data in the correct shape for |geometryFromMesh|.
nodes = [x';y';z'];
elements = K';
% Create a PDE model and import the mesh.
geometryFromMesh(model,nodes,elements);
% Plot geometry
figure
pdegplot(model,'FaceLabels','on')
title('Bracket with Face Labels')
% Now the new stuff
generateMesh(model)
ufun = @(region,state)[region.x.^2;region.x.^2 + region.y.^2;region.x.^2 + region.y.^2 - region.z]
applyBoundaryCondition(model,'dirichlet','Face',6,'u',ufun,'Vectorized','on')
specifyCoefficients(model,'m',0,'d',0,'c',1,'a',0,'f',[1;2;3]);
results = solvepde(model);
pdeplot3D(model,'ColorMapData',results.NodalSolution(:,1))
Alan Weiss
MATLAB mathematical toolbox documentation
  1 件のコメント
Stephan
Stephan 2017 年 3 月 2 日
Thank you very much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometry and Mesh についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by