|
[Sponsors] |
June 7, 2017, 03:20 |
Curl function in Matlab
|
#1 |
Member
Aru
Join Date: Feb 2012
Location: Chennai, India
Posts: 40
Rep Power: 14 |
Hi
I am trying to find the curl of a 3D vector field using the Matlab function curl. However, I get only -Inf and Inf in the output. The data I have is the velocity field in 3 different 3d arrays U, V and W and the grid points as one-dimensional monotonic arrays x, y and z. I do the following operation to find the curl. Code:
[Y,X,Z]=meshgrid(y,x,z) [Wx,Wy,Wz,omega]=curl(X,Y,Z,U,V,W) |
|
June 7, 2017, 04:11 |
|
#2 |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
curl requires first the velocity field, then the grid, see: https://it.mathworks.com/help/symbol...id=gn_loc_drop
|
|
June 7, 2017, 04:22 |
|
#3 | |
Member
Aru
Join Date: Feb 2012
Location: Chennai, India
Posts: 40
Rep Power: 14 |
I was referring to this function.
https://in.mathworks.com/help/matlab/ref/curl.html Quote:
|
||
June 7, 2017, 04:27 |
|
#4 | |
Senior Member
Filippo Maria Denaro
Join Date: Jul 2010
Posts: 6,897
Rep Power: 73 |
Quote:
I suggest to start first a check by using successive 2D planes. For example for several Z values you can first check if the vector plot in each plane is correct and then compute the 2D curl. |
||
June 7, 2017, 05:07 |
|
#5 |
Member
Aru
Join Date: Feb 2012
Location: Chennai, India
Posts: 40
Rep Power: 14 |
Thank you for your suggestion.
I have found out that the problem is associated with employing the meshgrid function. It has been sorted out by resizing the velocity arrays. |
|
Tags |
matlab coding |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] Contribution a new utility: refine wall layer mesh based on yPlus field | lakeat | OpenFOAM Community Contributions | 58 | December 23, 2021 03:36 |
[blockMesh] Errors during blockMesh meshing | Madeleine P. Vincent | OpenFOAM Meshing & Mesh Conversion | 51 | May 30, 2016 11:51 |
[swak4Foam] installation problem with version 0.2.3 | Claudio87 | OpenFOAM Community Contributions | 9 | May 8, 2013 11:20 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 06:42 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |