3

I am trying to build a 3D CFD pipe flow model using MATLAB, and I am hoping to assign values (boundary conditions) on the pipe wall. I've tried building a pipe using the cylinder function:

[X Y Z] = cylinder

but this generates me several points on the surface, which are not enough.

Aside, is there a better way to build a 3D CFD pipeflow model using MATLAB?

Eitan T
  • 32,037
  • 13
  • 65
  • 103
  • 5
    For more points, you can specify two more arguments in the `cylinder` function: `cylinder(r, n)`, where `r` is the profile curve and `n` is the number of equally-spaced points around its circumference. For example, `cylidner(1, 100)` creates a cylinder with unit radius and 100 points. Is that what you're looking for? – Eitan T Jan 29 '13 at 10:23

1 Answers1

0

I would use a struct to embed information in your CFD object.

% radius = 10
r = 10;
% number of radial points = 30
n = 30;
CFD_cyl = struct;
[CFD_cyl.X, CFD_cyl.Y, CFD_cyl.Z] = cylinder(r, n);
% Creates a value vector in the CFD_cyl struct that can relate to the cylinder X, Y, Z
CFD_cyl.value = CFD_cyl.X(:,:) + CFD_cyl.Y(:,:) + CFD_cyl.Z(:,:);

Change the value field accordingly for the useful relationship that you wish to express.

JesseBikman
  • 632
  • 1
  • 5
  • 22