|
[Sponsors] |
April 18, 2014, 13:36 |
Transient energy conservation
|
#1 |
New Member
David Van Cauwenberge
Join Date: Feb 2012
Location: Ghent, Belgium
Posts: 19
Rep Power: 14 |
Hello Foamers, I have been breaking my head over this for the past 2 days, so I would really appreciate it if I could get some feedback on this.
I'm simulating flow through a pipe using a modified version of rhoPimpleFoam with cyclic boundaries at the in- and outlet of my domain while the flow is heated with a constant temperature gradient imposed on the tube wall. The problem however is that when I impose a gradient that is twice as big, the rate at which my gas is heating is only slightly higher and takes a considerable amount of time (~1s) to reach the double value of my initial deltaT/time with half the gradient imposed. I understand that it takes a while to develop a temperature profile but still energy should be conserved, right? Performing additional subiterations offers a slight improvement but still doesn't balance out the energy equation. I thought a good way to monitor the heat going into the volume would be this function: Code:
const fvPatchField<scalar>& heatFluxPatchField = T.boundaryField()[patchI]; // Print patch total heat transfer rate const tmp<volScalarField> tkappa = thermo.kappa(); const scalarField& kappa = tkappa().boundaryField()[patchI]; scalar patchHeatRate = gSum ( kappa * heatFluxPatchField.snGrad() * heatFluxPatchField.patch().magSf() ); The energy equation is standard I'd say: Code:
volScalarField& he = thermo.he(); fvScalarMatrix EEqn ( fvm::ddt(rho, he) + fvm::div(phi, he) + fvc::ddt(rho, K) + fvc::div(phi, K) - fvm::laplacian(turbulence->alphaEff(), he) == fvOptions(rho, he) ); EEqn.relax(); fvOptions.constrain(EEqn); EEqn.solve(); fvOptions.correct(he); thermo.correct(); Anyway, thanks to anyone that might be able to shed some light on this! Best regards, David |
|
April 24, 2014, 14:48 |
|
#2 |
New Member
David Van Cauwenberge
Join Date: Feb 2012
Location: Ghent, Belgium
Posts: 19
Rep Power: 14 |
Ok, I isolated the problem to the term "fvm::div(phi, he)", which according to my limited experience with OpenFOAM uses the face values of he. The lack of energy conservation then stems from my inlet patch automatically being converted to a fixedEnergy bc with values that are not being updated according to the changing temperature field.
By running the simulation 10 timesteps at a time and then restarting, the inlet patch is updated each time but obviously that's not an option so I need some way to change the enthalpy values on this patch. I tried all of the stuff below but nothing seems to work, please let me know if there's something else that might! Code:
label patchID = mesh.boundaryMesh().findPatchID("in"); scalarField Tp = T.boundaryField()[patchID]; const scalarField& pp = p.boundaryField()[patchID]; scalarField heFix(thermo.he(pp, Tp, patchID)); fixedEnergyFvPatchScalarField& hPatch = refCast<fixedEnergyFvPatchScalarField>(he.boundaryField()[patchID]); hPatch==heFix; forAll(hPatch, faceI) { hPatch[faceI] = heFix[faceI]; hPatch.evaluate(Pstream::blocking); hPatch.updateCoeffs(); Best regards, David |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Energy equation for compressible flow | majkl | OpenFOAM Running, Solving & CFD | 5 | February 10, 2021 16:17 |
Turbulent kinetic energy in transient flow | chmurillor | FLUENT | 0 | June 2, 2013 12:41 |
Energy conservation issue | izumi11 | FLUENT | 0 | May 10, 2010 02:05 |
how to prove energy conservation in Fluent | Tony | FLUENT | 0 | May 15, 2006 13:42 |
The energy conservation in a case of phase change | robin | Phoenics | 2 | April 6, 2002 01:09 |