|
[Sponsors] |
July 18, 2014, 04:06 |
Adding source terms to rhoCentralFoam
|
#1 |
Senior Member
Join Date: Oct 2013
Posts: 397
Rep Power: 19 |
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; } 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)); } 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 07:04. |
|
July 1, 2023, 14:08 |
|
#2 |
Senior Member
qutadah
Join Date: Jun 2021
Location: USA
Posts: 101
Rep Power: 5 |
I think this solver uses flux terms to calculate the field using some kind of flux splitting scheme, and therefore it needs the equations in the conservative form, which have d(rho*U)/dt = RHS and d(rho*E)/dt = RHS for both momentum and energy equations, therefore you find the rho*U and rho*E recalculated again using the appropriate boundary conditions.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GPU Linear Solvers for OpenFOAM | gocarts | OpenFOAM Announcements from Other Sources | 37 | August 17, 2022 15:22 |
[Other] OpenFOAM Installation for navalFoam | sachinlb | OpenFOAM Community Contributions | 22 | July 28, 2017 06:26 |
HELP! adding a mass source to VOF eqn. by UDF??? | ROOZBEH | FLUENT | 5 | December 3, 2016 18:53 |
friction forces icoFoam | ofslcm | OpenFOAM | 3 | April 7, 2012 11:57 |
Source Terms in momentum Balance | vidyaraja | FLUENT | 0 | May 25, 2009 14:16 |