Skip to content

Commit 236b0b7

Browse files
committed
jacobians for manual update
1 parent 9d235a4 commit 236b0b7

File tree

1 file changed

+2
-25
lines changed

1 file changed

+2
-25
lines changed

SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ class CAvgGrad_TurbSA final : public CAvgGrad_Scalar<FlowIndices> {
9090
/*--- For Jacobians -> Use of TSL approx. to compute derivatives of the gradients ---*/
9191
su2double diffusion_coefficient = nu_e/sigma - cb2_sigma*nu_c;
9292
if (implicit) {
93-
Jacobian_i[0][0] = 0.5 * (diffusion_coefficient * -proj_vector_ij); //exact: ((1+cb2)*0.5 * Proj_Mean_GradScalarVar[0]-nu_e*proj_vector_ij)/sigma - cb2_sigma * (Proj_Mean_GradScalarVar[0] - ScalarVar_i[0] * proj_vector_ij);
94-
Jacobian_j[0][0] = 0.5 * (diffusion_coefficient * proj_vector_ij); //exact: ((1+cb2)*0.5 * Proj_Mean_GradScalarVar[0]+nu_e*proj_vector_ij)/sigma - cb2_sigma * ScalarVar_i[0] * proj_vector_ij;
93+
Jacobian_i[0][0] = diffusion_coefficient*-proj_vector_ij; //((1+cb2)*0.5 * Proj_Mean_GradScalarVar[0]-nu_e*proj_vector_ij)/sigma - cb2_sigma * (Proj_Mean_GradScalarVar[0] - ScalarVar_i[0] * proj_vector_ij);
94+
Jacobian_j[0][0] = diffusion_coefficient*proj_vector_ij; //((1+cb2)*0.5 * Proj_Mean_GradScalarVar[0]+nu_e*proj_vector_ij)/sigma - cb2_sigma * ScalarVar_i[0] * proj_vector_ij;
9595
}
9696
}
9797

@@ -184,29 +184,6 @@ class CAvgGrad_TurbSA_Neg final : public CAvgGrad_Scalar<FlowIndices> {
184184
su2double term_2 = cb2*nu_tilde_i*fn_i* Proj_Mean_GradScalarVar[0]/sigma;
185185
Flux[0] = term_1 - term_2;
186186

187-
/*--- Buffer to store the values (prints values of all nodes per iteration) DELTE LATER */
188-
189-
// unsigned long iter = config->GetMultizone_Problem() ? config->GetOuterIter() : config->GetInnerIter();
190-
// std::ofstream URF_log_file;
191-
192-
// URF_log_file.open("diffusion_term.dat", std::ios::app);
193-
// if (!URF_log_file.is_open()) {
194-
// std::cerr << "Unable to open under_relaxation_buffer.dat" << std::endl;
195-
// }
196-
197-
198-
// if (URF_log_file.is_open()) {
199-
// URF_log_file << "Iteration: " << iter << std::endl;
200-
// URF_log_file << "Term 1: " << (nu_ij + (1 + cb2)*nu_tilde_ij*fn_i)/sigma << std::endl;
201-
// URF_log_file << "Term 2: " << cb2*nu_tilde_i*fn_i/sigma << std::endl;
202-
// URF_log_file << "total: " << (nu_ij + (1 + cb2)*nu_tilde_ij*fn_i)/sigma - cb2*nu_tilde_i*fn_i/sigma << std::endl;
203-
// URF_log_file << std::endl;
204-
// }
205-
206-
// if (URF_log_file.is_open()) {
207-
// URF_log_file.close();
208-
// }
209-
210187
/*--- For Jacobians -> Use of TSL approx. to compute derivatives of the gradients
211188
* To form the exact jacobians, use the chain and product rules.
212189
* The diffusion coefficient following Diskin's approach is: A = (nu_ij + (1+cb2)*nut_tilde_ij -cb2*nu_tilde_i)*fn_i = B*fni + nu_ij

0 commit comments

Comments
 (0)