How to implement the dissipation term of TKE budget equation in MATLAB?
Hello everyone,
I’m not even sure if I’m in the right section or forum. I am having trouble calculating the dissipation term in the TKE (Turbulent Kinetic Energy) budget while studying turbulence.
Consider a rectangular channel with dimensions along the x-axis, along the y-axis, and along the z-axis, through which a flow is passing. Let .
The meshgrid for this channel consists of 256x128x128 points along the , , and directions, respectively. At each point, 6 values are stored: 3 velocity components ( along , along , and along ) and 3 spatial coordinates (, , and ). Therefore, there are 6 matrices of size 256x128x128: 3 velocity matrices (, , and ) and 3 position matrices (, , and ). Next, we calculate the velocity fluctuation matrices , , and (denoted as `u_prime`, `v_prime`, and `w_prime`, respectively), which are simply the difference between the velocity matrices and their mean values: , , and .
Assume the flow is steady and homogeneous along the and directions, so the partial derivatives with respect to and are zero.
The dissipation term in the TKE budget is given by the formula:
and I guess the formula calculated along the direction becomes like this:
Assume . Here is my attempt to implement this equation:
u_mean = mean(u, [1, 3]); %calculating u mean along the y-direction
u_prime = u – u_mean; %calculating u’
[~, du_dy_prime, ~] = gradient(u_prime); %calculating the partial derivative of u’ with respect to y
epsilon = – nu * mean(du_dy_prime .* du_dy_prime, [1, 3]); %calculating the dissipation term
To validate my results, I need to compare them with data from a study by Moser, Kim, and Mansour. Here’s the comparison: the curves are plotted along the -axis. The blue curve represents my results, while the orange curve corresponds to the data from the study by Moser, Kim, and Mansour.
All other terms in the TKE budget match well, except for the dissipation term, as you can see. I’m confident that the input data for the dissipation calculation are accurate, but I suspect the issue lies in the implementation of the formula. This assumption is based on the fact that all the other terms align closely with the data from Moser, Kim, and Mansour.
So, finally, how would you implement the dissipation function in light of the information provided?
Please feel free to ask for any further clarifications if needed.Hello everyone,
I’m not even sure if I’m in the right section or forum. I am having trouble calculating the dissipation term in the TKE (Turbulent Kinetic Energy) budget while studying turbulence.
Consider a rectangular channel with dimensions along the x-axis, along the y-axis, and along the z-axis, through which a flow is passing. Let .
The meshgrid for this channel consists of 256x128x128 points along the , , and directions, respectively. At each point, 6 values are stored: 3 velocity components ( along , along , and along ) and 3 spatial coordinates (, , and ). Therefore, there are 6 matrices of size 256x128x128: 3 velocity matrices (, , and ) and 3 position matrices (, , and ). Next, we calculate the velocity fluctuation matrices , , and (denoted as `u_prime`, `v_prime`, and `w_prime`, respectively), which are simply the difference between the velocity matrices and their mean values: , , and .
Assume the flow is steady and homogeneous along the and directions, so the partial derivatives with respect to and are zero.
The dissipation term in the TKE budget is given by the formula:
and I guess the formula calculated along the direction becomes like this:
Assume . Here is my attempt to implement this equation:
u_mean = mean(u, [1, 3]); %calculating u mean along the y-direction
u_prime = u – u_mean; %calculating u’
[~, du_dy_prime, ~] = gradient(u_prime); %calculating the partial derivative of u’ with respect to y
epsilon = – nu * mean(du_dy_prime .* du_dy_prime, [1, 3]); %calculating the dissipation term
To validate my results, I need to compare them with data from a study by Moser, Kim, and Mansour. Here’s the comparison: the curves are plotted along the -axis. The blue curve represents my results, while the orange curve corresponds to the data from the study by Moser, Kim, and Mansour.
All other terms in the TKE budget match well, except for the dissipation term, as you can see. I’m confident that the input data for the dissipation calculation are accurate, but I suspect the issue lies in the implementation of the formula. This assumption is based on the fact that all the other terms align closely with the data from Moser, Kim, and Mansour.
So, finally, how would you implement the dissipation function in light of the information provided?
Please feel free to ask for any further clarifications if needed. Hello everyone,
I’m not even sure if I’m in the right section or forum. I am having trouble calculating the dissipation term in the TKE (Turbulent Kinetic Energy) budget while studying turbulence.
Consider a rectangular channel with dimensions along the x-axis, along the y-axis, and along the z-axis, through which a flow is passing. Let .
The meshgrid for this channel consists of 256x128x128 points along the , , and directions, respectively. At each point, 6 values are stored: 3 velocity components ( along , along , and along ) and 3 spatial coordinates (, , and ). Therefore, there are 6 matrices of size 256x128x128: 3 velocity matrices (, , and ) and 3 position matrices (, , and ). Next, we calculate the velocity fluctuation matrices , , and (denoted as `u_prime`, `v_prime`, and `w_prime`, respectively), which are simply the difference between the velocity matrices and their mean values: , , and .
Assume the flow is steady and homogeneous along the and directions, so the partial derivatives with respect to and are zero.
The dissipation term in the TKE budget is given by the formula:
and I guess the formula calculated along the direction becomes like this:
Assume . Here is my attempt to implement this equation:
u_mean = mean(u, [1, 3]); %calculating u mean along the y-direction
u_prime = u – u_mean; %calculating u’
[~, du_dy_prime, ~] = gradient(u_prime); %calculating the partial derivative of u’ with respect to y
epsilon = – nu * mean(du_dy_prime .* du_dy_prime, [1, 3]); %calculating the dissipation term
To validate my results, I need to compare them with data from a study by Moser, Kim, and Mansour. Here’s the comparison: the curves are plotted along the -axis. The blue curve represents my results, while the orange curve corresponds to the data from the study by Moser, Kim, and Mansour.
All other terms in the TKE budget match well, except for the dissipation term, as you can see. I’m confident that the input data for the dissipation calculation are accurate, but I suspect the issue lies in the implementation of the formula. This assumption is based on the fact that all the other terms align closely with the data from Moser, Kim, and Mansour.
So, finally, how would you implement the dissipation function in light of the information provided?
Please feel free to ask for any further clarifications if needed. equation, plot, cfd MATLAB Answers — New Questions