How to produce this graph in COMSOL?

275 Views Asked by At

I am trying to model generalised Couette flow in COMSOL. My goal is to reproduce this textbook graph in COMSOL. Text-book graph

To cue in: Two parallel plates are in $h$ distance apart. The steady laminar flow of viscous incompressible fluid between them is along $x$-axis. The upper plate is moving with velocity $U$.

Then, satisfying all the relevant conditions, we get from the Navier-Stokes equation: $$\frac{d^2u}{dy^2}=\frac{P}{\mu}$$ Here $P$ is the pressure, $\mu$ is the viscosity, $u$ is the fluid-velocity component along $x$-axis. The boundary conditions are: $$u(x,0)=0, u(x,h)=U$$ Then we get the equation $$\frac{u}{U}=\frac{y}{h}+\alpha\frac{y}{h}(1-\frac{y}{h})$$ where $\alpha=\frac{-h^2P}{2\mu U}$

My attempts so far: Firstly I want to admit that my understanding of the software is not clear enough, but I can do and understand basic operations. Now,

  1. I modeled plane Couette flow in COMSOL. But I have no idea how to produce the desired graph.
  2. I tried learning solving boundary value problems in COMSOL but couldn't find anything useful. The closest I can find is PDE with boundary conditions. The equation at hand is an ODE.
  3. I tried to use the 'Component > Definitions > Analytic function' option in the Model Builder view, and tried to plug in the resultant equation. But can't introduce $\alpha$ as parameter, the software takes both $y$ and $\alpha$ as variables and then does a 3D plot.

I am asking for someone to explain how to produce the desired graph. If specifics can't be written for some policy, at least give enough and explicit directions.

2

There are 2 best solutions below

0
On

I have no knowledge of COMSOL, but I can recommend that you go step by step.

Since in this case the solution of the PDE is known, we start with plotting directly.

Since it's a parametric solution, it's necessary to tell which values to assign to the parameter.

At that point you can hope for something good like:

range = {Range[-0.4, 1.4, 0.2], Range[0.2, 1.0, 0.2]};
ParametricPlot[Table[{t + k t (1 - t), t}, {k, -3, 3}],
               {t, 0, 1}, AxesLabel -> {"u/U", "y/h"},
               GridLines -> range, Ticks -> range]

enter image description here

This was achieved in Mathematica, but beyond the syntax the philosophy shouldn't change.

0
On

After hours of restlessness I finally did it. I am documenting the process for future references. couette graph

Thanks to TeM who wrote in his answer to go step by step. I found the solution by trial and error basis; each time I took a little step, observed the outcome, learnt a feature, and took another little step based on that.

What I did: So far I am unable to plot the solution directly in COMSOL.

One needs the prior knowledge of (a) modelling Couette flow in COMSOL, (b) solving PDE in COMSOL, (c) the COMSOL mechanisms of 'cut line 2D', '1D plot > Line graph', 'parametric sweep' etc. I am using COMSOL 5.3a.

Take a 5cm by 1cm($=h$) rectangle, the width doesn't matter. The equation at hand can be written as $$\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2}=\frac{P}{\mu}$$ with additional boundary conditions $u(0,y)=0, u(5,y)=0$. Now we have Poisson's equation.

In 'Global Definitions > Parameters', enter a parameter 'pressure', give any value, $0$ for instance. (Press enter, otherwise it doesn't get saved. Also avoid one letter parameter names as it's most likely that COMSOL already uses those names for built in parameters.)

In the 'Add Physics' section select 'Mathematics > Classical PDEs > Poisson's equation'. In 'Poisson's equation (poeq) > Poisson's equation 1' locate the 'equation' section. Set Diffusion coefficient, c = $-1$ to make the Nabla operator positive. Set Source term, f = pressure/$0.001$ (the value of $\mu$). Right click on 'Poisson's equation (poeq)' and add four 'Dirichlet Boundary Condition's and select each edge for each condition. Rename the conditions for clarity. Set respective values.

Build mesh. I have done stationary study. Right click on study and select 'Parametric sweep' for family of curves. Locate and press the plus sign to add the parameter 'pressure'. Locate and press the range sign; there set start = -.6, stop = .6, number of steps = 7 to set the range of the parameter. (The range of 'pressure' will come from $-3\le\alpha \le3$.) Then press compute.

Under 'Results' right click on 'Data Sets' and select 'Cut line 2D'; I have used the coordinates (3,0), (3,1). Then right click on 'Results' and select '1D plot'; right click on '1D plot group 2' and select 'Line graph'. In '1D plot group 2' window, set dataset as 'Cut line 2D 1', parameter selection as 'All'. Now go to 'Line Graph 1' and press 'Plot'. Then in y-axis data set expression as y, and in x-axis data set expression as u. Play with other features.

If you set height of the rectangle as more than 1 unit, then be sure to set coordinates accordingly in 'Cut line 2D'. Also add a new parameter named 'ht_rec' (=2=$h$), and in 'y-axis data' set expression as y/ht_rec.