-
Notifications
You must be signed in to change notification settings - Fork 288
[ConvectionDiffusionApplication] Adding crosswind stabilization to Eulerian Convection–Diffusion element #14272
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
3eaaff4
1bd6076
8d01273
e9c9a16
d837e32
e153855
23d1045
04e9db3
6418514
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,6 +103,9 @@ namespace Kratos | |
| this-> GetNodalValues(Variables,rCurrentProcessInfo); | ||
| double h = this->ComputeH(DN_DX); | ||
|
|
||
| array_1d<double,TDim> grad_phi_halfstep = prod(trans(DN_DX), 0.5*(Variables.phi+Variables.phi_old)); | ||
| const double norm_grad = norm_2(grad_phi_halfstep); | ||
|
|
||
| //Computing the divergence | ||
| for (unsigned int i = 0; i < TNumNodes; i++) | ||
| { | ||
|
|
@@ -141,6 +144,22 @@ namespace Kratos | |
| //terms which multiply the gradient of phi | ||
| noalias(aux2) += (1.0+tau*Variables.beta*Variables.div_v)*outer_prod(N, a_dot_grad); | ||
| noalias(aux2) += tau*outer_prod(a_dot_grad, a_dot_grad); | ||
|
|
||
| //cross-wind term | ||
| if(norm_grad > 1e-3 && norm_vel > 1e-9) | ||
| { | ||
| const double C = rCurrentProcessInfo[CROSS_WIND_STABILIZATION_FACTOR]; | ||
| const double time_derivative = Variables.dt_inv*(inner_prod(N,Variables.phi)-inner_prod(N,Variables.phi_old)); | ||
| const double res = -time_derivative -inner_prod(vel_gauss, grad_phi_halfstep); | ||
|
|
||
| const double disc_capturing_coeff = 0.5*C*h*fabs(res/norm_grad); | ||
|
Marco1410 marked this conversation as resolved.
Outdated
|
||
| BoundedMatrix<double,TDim,TDim> D = disc_capturing_coeff*( IdentityMatrix(TDim)); | ||
|
Marco1410 marked this conversation as resolved.
Outdated
|
||
| const double norm_vel_squared = norm_vel*norm_vel; | ||
| D += (std::max( disc_capturing_coeff - tau*norm_vel_squared , 0.0) - disc_capturing_coeff)/(norm_vel_squared) * outer_prod(vel_gauss,vel_gauss); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure about this? Shouldn't it involve the viscosity besides the tau?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rubenzorrilla, I use tau because I want to remove the contribution in the streamline direction. The problem with the projected Péclet is that when the velocity and the gradient are aligned, the crosswind contribution disappears, even if oscillations are still present. This is likely why the original formulation is implemented in this way. For this reason, I think it is better to keep the current approach, since it is more appropriate and robust. |
||
|
|
||
| noalias(tmp) = prod(DN_DX,D); | ||
| noalias(aux2) += prod(tmp,trans(DN_DX)); | ||
| } | ||
| } | ||
|
|
||
| //adding the second and third term in the formulation | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.