# Adding source terms to rhoCentralFoam

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 July 18, 2014, 03:06 Adding source terms to rhoCentralFoam #1 Senior Member   Join Date: Oct 2013 Posts: 321 Rep Power: 6 I would like to add some source terms to the density, impulse and energy equations in rhoCentralFoam. Unfortunately I don't have a complete understanding of the algorithm yet, so it's somewhat difficult for me. Why are two equations solved for impulse and energy respectively (viscid case), i.e. for rhoU and for U? Same goes for rhoE and e... for U: Code: ```solve(fvm::ddt(rhoU) + fvc::div(phiUp)); U.dimensionedInternalField() = rhoU.dimensionedInternalField() /rho.dimensionedInternalField(); U.correctBoundaryConditions(); rhoU.boundaryField() = rho.boundaryField()*U.boundaryField(); volScalarField rhoBydt(rho/runTime.deltaT()); if (!inviscid) { solve ( fvm::ddt(rho, U) - fvc::ddt(rho, U) - fvm::laplacian(muEff, U) - fvc::div(tauMC) ); rhoU = rho*U; }``` and for e: Code: ```// --- Solve energy surfaceScalarField sigmaDotU ( "sigmaDotU", ( fvc::interpolate(muEff)*mesh.magSf()*fvc::snGrad(U) + (mesh.Sf() & fvc::interpolate(tauMC)) ) & (a_pos*U_pos + a_neg*U_neg) ); solve ( fvm::ddt(rhoE) + fvc::div(phiEp) - fvc::div(sigmaDotU) ); e = rhoE/rho - 0.5*magSqr(U); e.correctBoundaryConditions(); thermo.correct(); rhoE.boundaryField() = rho.boundaryField()* ( e.boundaryField() + 0.5*magSqr(U.boundaryField()) ); if (!inviscid) { solve ( fvm::ddt(rho, e) - fvc::ddt(rho, e) - fvm::laplacian(turbulence->alphaEff(), e) ); thermo.correct(); rhoE = rho*(e + 0.5*magSqr(U)); }``` To which of these equations can I add my source terms? I would think to the latter ones, as the turbulence is added there, however, some terms also appear in the first equations. Do I need to discretize them using a central(upwind) scheme somehow? By the way, for anyone interested, I think this might be a good read about the pressure and density-based solvers in OF: http://www.cimec.org.ar/ojs/index.ph...File/4231/4157 Last edited by chriss85; July 18, 2014 at 06:04.

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post sachinlb OpenFOAM Installation 21 June 23, 2014 08:07 ofslcm OpenFOAM 3 April 7, 2012 10:57 gocarts OpenFOAM Announcements from Other Sources 35 March 1, 2012 21:41 vidyaraja FLUENT 0 May 25, 2009 13:16 ROOZBEH FLUENT 4 May 29, 2003 09:54

All times are GMT -4. The time now is 02:00.

 Contact Us - CFD Online - Top