void PorousFlowMethane::computeQpProperties() { /// Density and derivatives wrt pressure and temperature at the nodes _density_nodal[_qp] = density(_porepressure_nodal[_qp][_phase_num], _temperature_nodal[_qp][_phase_num]); _ddensity_nodal_dp[_qp] = dDensity_dP(_temperature_nodal[_qp][_phase_num]); _ddensity_nodal_dt[_qp] = dDensity_dT(_porepressure_nodal[_qp][_phase_num], _temperature_nodal[_qp][_phase_num]); /// Density and derivatives wrt pressure and temperature at the qps _density_qp[_qp] = density(_porepressure_qp[_qp][_phase_num], _temperature_qp[_qp][_phase_num]); _ddensity_qp_dp[_qp] = dDensity_dP(_temperature_qp[_qp][_phase_num]); _ddensity_qp_dt[_qp] = dDensity_dT(_porepressure_qp[_qp][_phase_num], _temperature_qp[_qp][_phase_num]); /// Viscosity and derivative wrt temperature at the nodes _viscosity_nodal[_qp] = viscosity(_temperature_nodal[_qp][_phase_num]); _dviscosity_nodal_dt[_qp] = dViscosity_dT(_temperature_nodal[_qp][_phase_num]); }
/** * Update the species diffusion coefficients. */ void SimpleTransport::updateDiff_T() { if (useHydroRadius_) { double visc = viscosity(); double RT = GasConstant * m_temp; for (size_t k = 0; k < m_nsp; k++) { double rad = m_coeffHydroRadius_Ns[k]->getSpeciesTransProp() ; m_diffSpecies[k] = RT / (6.0 * Pi * visc * rad); } } else { for (size_t k = 0; k < m_nsp; k++) { m_diffSpecies[k] = m_coeffDiff_Ns[k]->getSpeciesTransProp(); } } m_diff_temp_ok = true; m_diff_mix_ok = false; }
void single_step(int itimestep, float &dt, int ntotal, float *hsml, float *mass, float **x, float **vx, float *u, float *rho, float *p, float *tdsdt, float **dvx, float *du, float *drho, int *itype, float **av) { int nvirt, niac = 0; int *pair_i = new int[max_interaction]; int *pair_j = new int[max_interaction]; int *ns = new int[maxn]; float *w = new float[max_interaction]; float **dwdx = new float*[dim+1]; float **indvxdt = new float*[dim+1]; float **exdvxdt = new float*[dim+1]; float **ardvxdt = new float*[dim+1]; float *avdudt = new float[maxn]; float *ahdudt = new float[maxn]; float *c = new float[maxn]; float *eta = new float[maxn]; for (int i = 0; i <= dim; i++) { dwdx[i] = new float[max_interaction]; indvxdt[i] = new float[maxn]; exdvxdt[i] = new float[maxn]; ardvxdt[i] = new float[maxn]; for (int j = 1; j < maxn; j++) { indvxdt[i][j] = (float)NULL; exdvxdt[i][j] = (float)NULL; ardvxdt[i][j] = (float)NULL;; } for (int j = 0; j < max_interaction; j++) dwdx[i][j] = (float)NULL; } for(int i=1;i<=ntotal;i++) { avdudt[i] = 0.; ahdudt[i] = 0.; for(int d=1;d<=dim;d++) { indvxdt[d][i] = 0.; ardvxdt[d][i] = 0.; exdvxdt[d][i] = 0.; } } //Positions of virtual (boundary) particles: 2D+ nvirt = 0; if (virtual_part)virt_part(itimestep, ntotal,nvirt,hsml,mass,x,vx,rho,u,p,itype); //Interaction parameters, calculating neighboring particles //and optimzing smoothing length 2D+ if (nnps==1)direct_find(itimestep, ntotal + nvirt, hsml,x,niac, pair_i,pair_j,w,dwdx,ns); //Density approximation or change rate 2D+ if (summation_density)sum_density(ntotal+nvirt,hsml,mass,niac,pair_i,pair_j,w,rho); else con_density(ntotal+nvirt,mass,niac,pair_i,pair_j,dwdx,vx,drho); //Dynamic viscosity: 2D+ if (visc)viscosity(ntotal+nvirt,itype,eta); //Internal forces: 2D+ int_force(ntotal+nvirt,mass,vx,niac,rho,eta,pair_i,pair_j,dwdx, u,itype,c,p,indvxdt,tdsdt,du); //Artificial viscosity: if (visc_artificial)art_visc(ntotal+nvirt,hsml,mass,x,vx,niac,rho,c,pair_i,pair_j,dwdx,ardvxdt, avdudt); //External forces: 2D+ if (ex_force)ext_force(ntotal+nvirt,x,niac,pair_i,pair_j,itype,exdvxdt); //ext_force(ntotal+nvirt,mass,x,niac,pair_i,pair_j,itype,hsml,exdvxdt); //Calculating the neighboring particles and undating HSML if (sle!=0)h_upgrade(dt,ntotal, mass, vx, rho, niac,pair_i, pair_j, dwdx, hsml); if (heat_artificial)art_heat(ntotal+nvirt,hsml,mass,x,vx,niac,rho,u, c,pair_i,pair_j,dwdx,ahdudt); //Calculating average velocity of each partile for avoiding penetration 2D if (average_velocity)av_vel(ntotal,mass,niac,pair_i,pair_j, w, vx, rho, av); //Convert velocity, force, and energy to f and dfdt for(int i=1;i<=ntotal;i++) { for(int d=1;d<=dim;d++) dvx[d][i] = indvxdt[d][i] + exdvxdt[d][i] + ardvxdt[d][i]; du[i] = du[i] + avdudt[i] + ahdudt[i]; } if ((itimestep % print_step)==0) { cout<<"\n**** Information for particle **** "<<moni_particle<<endl; cout << "internal a=" << indvxdt[1][moni_particle] << " artifical a=" << ardvxdt[1][moni_particle]<< "\nexternal a=" << exdvxdt[1][moni_particle]<< " total a="<<dvx[1][moni_particle]<<endl; } delete[] pair_i; delete[] pair_j; delete[] ns; delete[] w; for (int i = 0; i <= dim; i++) delete dwdx[i]; delete[] dwdx; for (int i = 0; i <= dim; i++) delete indvxdt[i]; delete[] indvxdt; for (int i = 0; i <= dim; i++) delete exdvxdt[i]; delete[] exdvxdt; for (int i = 0; i <= dim; i++) delete ardvxdt[i]; delete[] ardvxdt; delete[] avdudt; delete[] ahdudt; delete[] c; delete[] eta; }
void shell_n_dot_pflux_bc(double func[DIM], double d_func[DIM][MAX_VARIABLE_TYPES + MAX_CONC][MDE], const double flux, /* imposed particles flux */ const double time, /* current time */ const double dt) /* current time step size */ /*********************************************************************** * * shell_n_dot_pflux_bc(): * * Function which evaluates the expression specifying the * particles flux at a quadrature point normal to the side * of an element. * * func = - flux + n . ( SH_PC * SH_FH^3/(3*mu) * (- grad_SH_FP) * + SH_PC * Ubot * SH_FH * - SH_FH * Diff * grad SH_PC ) * * The boundary condition SHELL_GRAD_PC_BC employs this function. * * * Input: * * flux = specified on the bc card as the first float * SH_PC = particles concentration * SH_FH = film thickness * grad_SH_FP = film lubrication pressure gradient * grad SH_FH = film slope * grad_SH_PC = particles concentration gradient * * Output: * * func[0] = value of the function mentioned above * d_func[0][varType][lvardof] = * Derivate of func[0] wrt * the variable type, varType, and the local variable * degree of freedom, lvardof, corresponding to that * variable type. * * Author: K. Tjiptowidjojo (3/10/2010) * ********************************************************************/ { int j, ii, jj, var; double phi_j; double grad_phi_j[DIM], grad_phi_j_corrected[DIM]; double veloU[DIM], veloL[DIM]; double grad_C[DIM]; double bound_normal[DIM], shell_normal[DIM]; double H; double mu, dmu_dc, diff_coeff, ddiff_dmu, ddiff_dc; VISCOSITY_DEPENDENCE_STRUCT d_mu_struct; /* viscosity dependence */ VISCOSITY_DEPENDENCE_STRUCT *d_mu = &d_mu_struct; H = fv->sh_fh; mu = viscosity(gn, NULL, d_mu); diff_coeff = diffusion_coefficient_model(mu, &ddiff_dmu); dmu_dc = mp->d_viscosity[SHELL_PARTC]; ddiff_dc = ddiff_dmu * dmu_dc; velocity_function_model(veloU, veloL, time, dt); /* Save the boundary normal vector */ for(ii = 0; ii < VIM; ii++) { grad_C[ii] = 0.0; bound_normal[ii] = fv->snormal[ii]; } shell_determinant_and_normal(ei->ielem, ei->iconnect_ptr, ei->num_local_nodes, ei->ielem_dim, 1); for(ii = 0; ii < VIM; ii++) { shell_normal[ii] = fv->snormal[ii]; } /* Peform I- nn to gradient operator */ for (ii = 0; ii < VIM; ii++) { for (jj = 0; jj < VIM; jj++) { grad_C[ii] += ( delta(ii,jj) * fv->grad_sh_pc[jj] - shell_normal[ii] * shell_normal[jj] * fv->grad_sh_pc[jj] ); } } if (af->Assemble_LSA_Mass_Matrix) { return; } if (af->Assemble_Jacobian) { var = SHELL_FILMH; if (pd->v[var]) { for ( j=0; j<ei->dof[var]; j++) { phi_j = bf[var]->phi[j]; if ( fabs(flux) < 1.0e-10 ) { d_func[0][var][j] += 0.0; } else { for (ii=0; ii<VIM; ii++) { d_func[0][var][j] += phi_j * diff_coeff * grad_C[ii] * bound_normal[ii]; } } } } var = SHELL_PARTC; if (pd->v[var]) { for ( j=0; j<ei->dof[var]; j++) { phi_j = bf[var]->phi[j]; for (ii = 0; ii < VIM; ii++) { grad_phi_j[ii] = bf[var]->grad_phi[j][ii]; grad_phi_j_corrected[ii] = 0.0; } for (ii = 0; ii < VIM; ii++) { for (jj = 0; jj < VIM; jj++) { grad_phi_j_corrected[ii] += (delta(ii,jj)*grad_phi_j[jj] - shell_normal[ii]*shell_normal[jj]*grad_phi_j[jj]); } } if ( fabs(flux) == 0.0 ) { for (ii=0; ii<VIM; ii++) { d_func[0][var][j] += grad_phi_j_corrected[ii] * bound_normal[ii]; } } else { for (ii=0; ii<VIM; ii++) { d_func[0][var][j] += H * ddiff_dc * grad_C[ii] * bound_normal[ii]; d_func[0][var][j] += H * diff_coeff * grad_phi_j_corrected[ii] * bound_normal[ii]; } } } } } /* end of if Assemble_Jacobian */ /* Calculate the residual contribution */ func[0] = - flux; if ( fabs(flux) == 0. ) { for (ii = 0; ii < VIM; ii++) { func[0] += bound_normal[ii] * grad_C[ii]; } } else { for (ii = 0; ii < VIM; ii++) { func[0] += bound_normal[ii] * H * diff_coeff * grad_C[ii]; } } } /* END of routine shell_n_dot_pflux_bc */
void FluidSim::solve_viscosity(float dt) { int ni = liquid_phi.ni; int nj = liquid_phi.nj; //static obstacles for simplicity - for moving objects, //use a spatially varying 2d array, and modify the linear system appropriately float u_obj = 0; float v_obj = 0; Array2c u_state(ni+1,nj,(const char&)0); Array2c v_state(ni,nj+1,(const char&)0); const int SOLID = 1; const int FLUID = 0; printf("Determining states\n"); //just determine if the face position is inside the wall! That's it. for(int j = 0; j < nj; ++j) { for(int i = 0; i < ni+1; ++i) { if(i - 1 < 0 || i >= ni || (nodal_solid_phi(i,j+1) + nodal_solid_phi(i,j))/2 <= 0) u_state(i,j) = SOLID; else u_state(i,j) = FLUID; } } for(int j = 0; j < nj+1; ++j) { for(int i = 0; i < ni; ++i) { if(j - 1 < 0 || j >= nj || (nodal_solid_phi(i+1,j) + nodal_solid_phi(i,j))/2 <= 0) v_state(i,j) = SOLID; else v_state(i,j) = FLUID; } } printf("Building matrix\n"); int elts = (ni+1)*nj + ni*(nj+1); if(vrhs.size() != elts) { vrhs.resize(elts); velocities.resize(elts); vmatrix.resize(elts); } vmatrix.zero(); float factor = dt/sqr(dx); for(int j = 1; j < nj-1; ++j) for(int i = 1; i < ni-1; ++i) { if(u_state(i,j) == FLUID ) { int index = u_ind(i,j); vrhs[index] = u_vol(i,j) * u(i,j); vmatrix.set_element(index,index,u_vol(i,j)); //uxx terms float visc_right = viscosity(i,j); float visc_left = viscosity(i-1,j); float vol_right = c_vol(i,j); float vol_left = c_vol(i-1,j); //u_x_right vmatrix.add_to_element(index,index, 2*factor*visc_right*vol_right); if(u_state(i+1,j) == FLUID) vmatrix.add_to_element(index,u_ind(i+1,j), -2*factor*visc_right*vol_right); else if(u_state(i+1,j) == SOLID) vrhs[index] -= -2*factor*visc_right*vol_right*u_obj; //u_x_left vmatrix.add_to_element(index,index, 2*factor*visc_left*vol_left); if(u_state(i-1,j) == FLUID) vmatrix.add_to_element(index,u_ind(i-1,j), -2*factor*visc_left*vol_left); else if(u_state(i-1,j) == SOLID) vrhs[index] -= -2*factor*visc_left*vol_left*u_obj; //uyy terms float visc_top = 0.25f*(viscosity(i-1,j+1) + viscosity(i-1,j) + viscosity(i,j+1) + viscosity(i,j)); float visc_bottom = 0.25f*(viscosity(i-1,j) + viscosity(i-1,j-1) + viscosity(i,j) + viscosity(i,j-1)); float vol_top = n_vol(i,j+1); float vol_bottom = n_vol(i,j); //u_y_top vmatrix.add_to_element(index,index, +factor*visc_top*vol_top); if(u_state(i,j+1) == FLUID) vmatrix.add_to_element(index,u_ind(i,j+1), -factor*visc_top*vol_top); else if(u_state(i,j+1) == SOLID) vrhs[index] -= -u_obj*factor*visc_top*vol_top; //u_y_bottom vmatrix.add_to_element(index,index, +factor*visc_bottom*vol_bottom); if(u_state(i,j-1) == FLUID) vmatrix.add_to_element(index,u_ind(i,j-1), -factor*visc_bottom*vol_bottom); else if(u_state(i,j-1) == SOLID) vrhs[index] -= -u_obj*factor*visc_bottom*vol_bottom; //vxy terms //v_x_top if(v_state(i,j+1) == FLUID) vmatrix.add_to_element(index,v_ind(i,j+1), -factor*visc_top*vol_top); else if(v_state(i,j+1) == SOLID) vrhs[index] -= -v_obj*factor*visc_top*vol_top; if(v_state(i-1,j+1) == FLUID) vmatrix.add_to_element(index,v_ind(i-1,j+1), factor*visc_top*vol_top); else if(v_state(i-1,j+1) == SOLID) vrhs[index] -= v_obj*factor*visc_top*vol_top; //v_x_bottom if(v_state(i,j) == FLUID) vmatrix.add_to_element(index,v_ind(i,j), +factor*visc_bottom*vol_bottom); else if(v_state(i,j) == SOLID) vrhs[index] -= v_obj*factor*visc_bottom*vol_bottom; if(v_state(i-1,j) == FLUID) vmatrix.add_to_element(index,v_ind(i-1,j), -factor*visc_bottom*vol_bottom); else if(v_state(i-1,j) == SOLID) vrhs[index] -= -v_obj*factor*visc_bottom*vol_bottom; } } for(int j = 1; j < nj; ++j) for(int i = 1; i < ni-1; ++i) { if(v_state(i,j) == FLUID) { int index = v_ind(i,j); vrhs[index] = v_vol(i,j)*v(i,j); vmatrix.set_element(index, index, v_vol(i,j)); //vyy float visc_top = viscosity(i,j); float visc_bottom = viscosity(i,j-1); float vol_top = c_vol(i,j); float vol_bottom = c_vol(i,j-1); //vy_top vmatrix.add_to_element(index,index, +2*factor*visc_top*vol_top); if(v_state(i,j+1) == FLUID) vmatrix.add_to_element(index,v_ind(i,j+1), -2*factor*visc_top*vol_top); else if (v_state(i,j+1) == SOLID) vrhs[index] -= -2*factor*visc_top*vol_top*v_obj; //vy_bottom vmatrix.add_to_element(index,index, +2*factor*visc_bottom*vol_bottom); if(v_state(i,j-1) == FLUID) vmatrix.add_to_element(index,v_ind(i,j-1), -2*factor*visc_bottom*vol_bottom); else if(v_state(i,j-1) == SOLID) vrhs[index] -= -2*factor*visc_bottom*vol_bottom*v_obj; //vxx terms float visc_right = 0.25f*(viscosity(i,j-1) + viscosity(i+1,j-1) + viscosity(i,j) + viscosity(i+1,j)); float visc_left = 0.25f*(viscosity(i,j-1) + viscosity(i-1,j-1) + viscosity(i,j) + viscosity(i-1,j)); float vol_right = n_vol(i+1,j); float vol_left = n_vol(i,j); //v_x_right vmatrix.add_to_element(index,index, +factor*visc_right*vol_right); if(v_state(i+1,j) == FLUID) vmatrix.add_to_element(index,v_ind(i+1,j), -factor*visc_right*vol_right); else if(v_state(i+1,j) == SOLID) vrhs[index] -= -v_obj*factor*visc_right*vol_right; //v_x_left vmatrix.add_to_element(index,index, +factor*visc_left*vol_left); if(v_state(i-1,j) == FLUID) vmatrix.add_to_element(index,v_ind(i-1,j), -factor*visc_left*vol_left); else if(v_state(i-1,j) == SOLID) vrhs[index] -= -v_obj*factor*visc_left*vol_left; //uyx //u_y_right if(u_state(i+1,j) == FLUID) vmatrix.add_to_element(index,u_ind(i+1,j), -factor*visc_right*vol_right); else if(u_state(i+1,j) == SOLID) vrhs[index] -= -u_obj*factor*visc_right*vol_right; if(u_state(i+1,j-1) == FLUID) vmatrix.add_to_element(index,u_ind(i+1,j-1), factor*visc_right*vol_right); else if(u_state(i+1,j-1) == SOLID) vrhs[index] -= u_obj*factor*visc_right*vol_right; //u_y_left if(u_state(i,j) == FLUID) vmatrix.add_to_element(index,u_ind(i,j), factor*visc_left*vol_left); else if(u_state(i,j) == SOLID) vrhs[index] -= u_obj*factor*visc_left*vol_left; if(u_state(i,j-1) == FLUID) vmatrix.add_to_element(index,u_ind(i,j-1), -factor*visc_left*vol_left); else if(u_state(i,j-1) == SOLID) vrhs[index] -= -u_obj*factor*visc_left*vol_left; } } double res_out; int iter_out; solver.solve(vmatrix, vrhs, velocities, res_out, iter_out); for(int j = 0; j < nj; ++j) for(int i = 0; i < ni+1; ++i) if(u_state(i,j) == FLUID) u(i,j) = (float)velocities[u_ind(i,j)]; else if(u_state(i,j) == SOLID) u(i,j) = u_obj; for(int j = 0; j < nj+1; ++j) for(int i = 0; i < ni; ++i) if(v_state(i,j) == FLUID) v(i,j) = (float)velocities[v_ind(i,j)]; else if(v_state(i,j) == SOLID) v(i,j) = v_obj; }
int main(int argc, char *argv[]) { int j; int n; int status; char directory[256],outputdir[256]; if (argc > 4) { printf("Too many arguments.Only using first 3.\n"); } n = atoi(argv[1]); time_step = atof(argv[2]); strcpy(directory,argv[3]); nb = 2; sprintf(outputdir,"%stemp_files/",directory); status = mkdir(outputdir,S_IRWXU | S_IRWXG | S_IRWXO); if (status == -33) { printf("Status is -33 for some reason.\n"); } //sprintf(param_fname,"%sparam_file.txt",directory); read_param_file(directory); nx = params.nx; ny = params.ny; nz = params.nz; CFL = params.cfl; IndirectTerm = params.indirect; size_x = nx; size_y = ny+2*NGHY; size_z = nz; stride = size_x*size_y; pitch = size_x; pitch2d = 0; //size_t double_to_int = sizeof(double)/sizeof(int); pitch2d_int = 0 ;//pitch*(int)double_to_int; dx = 2*M_PI/nx; if (size_x % 2 == 0) NEVEN = TRUE; else NEVEN = FALSE; num_threads = 1; #ifdef _OPENMP //omp_set_num_threads(8); num_threads = omp_get_max_threads(); printf("Using %d threads\n",num_threads); #endif allocate_all(); #ifdef _FFTW allocate_conv(); #endif read_domain(directory); read_files(n,directory); //read_single_file(n,1,directory); /* if (cfl_dt < dt) { printf("Using cfl limited timestep of %.4e instead of %.4e\n",cfl_dt,dt); dt = cfl_dt; } */ //move_to_com(); read_stockholm(directory); /* for(j=0;j<size_y;j++) { dens0[j] = params.mdot/(3*M_PI*Nu(ymed(j))); vy0[j] = -1.5*Nu(ymin(j))/ymin(j); vx0[j] = pow(ymed(j),-.5); vx0[j] *= sqrt(1.0+pow(params.h,2)*pow(ymed(j),2*params.flaringindex)* (2.0*params.flaringindex - 1.5)); vx0[j] -= omf*ymed(j); } */ omf0 = omf; output_stock(outputdir); output_init(outputdir); init_rk5(); nsteps = 0; double tstart = psys[0].t; double tend = psys[0].t + time_step; double time = tstart; #ifdef _FFTW printf("Using FFTW to compute fourier transforms\n"); #endif #ifdef ARTIFICIALVISCOSITY printf("Using ARTIFICIAL VISCOSITY\n"); #endif #ifdef FARGO printf("Using FARGO TRANSPORT\n"); #endif #ifdef STOCKHOLMACC printf("Damping to current average in stockholm boundaries.\n"); #endif #ifdef NOWAVEKILLRHO printf("Not damping the density.\n"); #endif #ifdef FIXEDPSYS printf("Planetary system is FIXED.\n"); #endif printf("Starting time = %.3f\nEnding time = %.3f\n",tstart,tend); set_bc(); set_dtLt(-1.0); while ((time < tend) && nsteps<MAXSTEPS) { #ifdef FARGO compute_vmed(vx); #endif dt = cfl(); if (dt <= MINDT) { printf("Timestep has fallen below minimum!\n"); break; } if (time + dt > tend) { dt = tend-time; } printf("\r t=%.3f, dt = %.8f, %02d%% complete...",time,dt,(int)(100*(time-tstart)/(tend-tstart))); fflush(stdout); set_avg(0); potential(); #ifndef FIXEDPSYS move_planet(); #endif source_step(); set_Lamex(); viscosity(); #ifdef ARTIFICIALVISCOSITY artificial_visc(); #endif temp_to_vel(); set_bc(); vel_to_temp(); #ifdef FARGO compute_vmed(vx_temp); #endif transport_step(); time += dt; set_avg(1); set_Lamdep(); set_bc(); stockholm(); //output_psys(outputdir,nsteps); nsteps++; } // temp_to_vel(); set_dtLt(1.0); dt = tend - tstart; for(j=0;j<size_y;j++) { dbart[j]/=dt; //Lt[j]/=dt; //Lt[j+size_y]/=dt; //Ld[j]/=dt; //Ld[j+size_y]/=dt; //Lw[j]/=dt; //Lw[j+size_y]/=dt; Lw[j] = Lt[j] - Ld[j]; Lw[j+size_y] = Lt[j+size_y] - Ld[j+size_y]; drFt[j]/=dt; drFd[j]/=dt; drFdB[j]/=dt; mdotl[j]/=dt; drFnu[j]/=dt; drFw[j]/=dt; drFwB[j]/=dt; Lamex[j]/=dt; //Lamex[j+size_y]/=dt; Lamdep[j]/=dt; LamdepB[j]/=dt; dtLt[j]/=dt; dtLd[j]/=dt; dtLw[j]/=dt; dtLd_rhs[j]/=dt; mdotavg[j] /= dt; LamdepS[j + size_y*0] /= dt; LamdepS[j + size_y*1] /= dt; LamdepS[j + size_y*2] /= dt; LamdepS[j + size_y*3] /= dt; LamdepS[j + size_y*4] /= dt; LamdepS[j + size_y*5] /= dt; LamdepS[j + size_y*6] /= dt; } int mi; for(mi=1;mi<MMAX+2;mi++) { for(j=0;j<size_y;j++) { Lamex[j + size_y*mi] /= dt; drFd[j + size_y*mi] /= dt; dtLt[j + size_y*mi] /= dt; } } output(outputdir); output_torque(directory,n); output_torque(outputdir,n); free_rk5(); #ifdef _FFTW free_conv(); #endif //free_all(); return 0; }