View Issue Details

IDProjectCategoryView StatusLast Update
0001991OpenFOAMBugpublic2020-11-21 19:53
Reporteremacchi Assigned Tohenry  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Product Versiondev 
Fixed in Versiondev 
Summary0001991: Problems with turbulentTemperatureCoupledBaffleMixed boundary condition
DescriptionWhile doing some CHT simulations (with low-Re RANS model) I noticed that the heat flux of a patch computed using the wallHeatFlux utility in either solid or fluid region is not the same. This is obviously not possible since the equality of heat fluxes is imposed through the boundary condition. The problems seems to appear only when performing variable properties simulations. I checked the output from the debug of the turbulentTemperatureCoupledBaffleMixed BC and in here the computation of the heat flux is correct. I did not check yet but I think the problem is connected to how the heat flux is computed in the utility: in particular it might be related to the conductivity/diffusivity coefficient. In the boundary conditions kappa is computed using directly the boundary values while in the utility fvc::interpolate(alpha) is used.
TagsNo tags attached.

Activities

emacchi

2016-02-10 16:31

reporter   ~0005933

I tried computing the heat flux as follows but there is still the same problem...

surfaceScalarField snGradh
(
fvc::snGrad(h)
);

surfaceScalarField::GeometricBoundaryField& patchHeatFlux =
                                          snGradh.boundaryField();

forAll(patchHeatFlux, patchi)
{
patchHeatFlux[patchi]*=(turb.alphaEff(patchi)());
};

emacchi

2016-02-10 17:07

reporter   ~0005934

Last edited: 2016-02-10 17:28

Ok, I think I found the problem: if I use temperature and effective conductivity to compute the heat flux the results are correct.

Thinking about it the turbulentTemperatureCoupledBaffleMixed BC starts from temperature and conductivity to impose the condition so it makes sense that the heat fluxes computed in this way are identical.

However I would not expect such differences (up to 5%) when using enthalpy. Is this due to the non-linearity of the h-T function I am using? I am modelling supercritical CO2 so the specific heat presents strong variations around the pseudo-critical temperature.

Unfortunately after this correction the error on the overall energy balance for the fluid region is larger...

wyldckat

2016-02-11 08:01

updater   ~0005935

Can you please provide a test case that reproduces this problem?

By the way, have you double-checked if the fixes made here: http://www.openfoam.org/mantisbt/view.php?id=1879 - worked as intended?

Juho

2016-02-11 09:54

reporter   ~0005936

Last edited: 2016-02-11 09:56

The turbulentTemperatureCoupledBaffleMixed BC calculates the heat flux: kappaEff*grad(T)

In the energy equations of chtMultiRegionFoam and wallHeatFlux utility the heat flux is calculated alphaEff*grad(he).

These are only equal if Cp is constant on between the wall face and the near wall cell. Otherwise there is an error in the energy balance between the regions.

This issue is explained in a bit more detail in this M.Sc. thesis: https://aaltodoc.aalto.fi/bitstream/handle/123456789/17759/master_Tuominen_Riku_2015.pdf?sequence=1

emacchi

2016-02-11 11:07

reporter   ~0005937

@ wyldckat: the previous issue was different and it was fixed in the dev (and 3.x) version

@ Juho: yes, I think that's exactly the problem. I will check the M.Sc. thesis. Thank you.

emacchi

2016-02-23 12:25

reporter   ~0005978

Last edited: 2016-02-23 15:11

Yesterday I finally got some time to work on the boundary condition. I implemented a boundary condition based on alphaEff*grad(he) and computed the boundary temperature using Newton method (through assuming constant alpha during iterations). I think its more or less what's described in the MSc, thesis.

Very few Newton iterations are needed, however the heat flux computed on the two sides of the same patch is not identical; sometimes the difference is very small (practically negligible) but it seems that when the transients are important the error also becomes significant. It seems that the number of outer iterations must increased (>25-30) to solve the problem.

Any thoughts?

Juho

2016-02-26 07:15

reporter   ~0005980

It is probably just a consequence of the region-segregated solution algorithm. You need to iterate over the energy solutions of the regions to converge the inter-region heat transfer. Implicit coupling between the energy solutions of the the different regions would remove the need for these iterations.

You could probably speed-up the simulation a bit by splitting a nOuterEnergyCorr from the nOuterCorr.

Something like:
// --- PIMPLE loop
   for (int oCorr=0; oCorr<nOuterEnergyCorr; oCorr++)

solveFluid.H:
if (oCorr >= nOuterCorr)
{
    frozenFlow = true;
}
else
{
    frozenFlow = false;
}


With something like:
nOuterCorr 3;
nOuterEnergyCorr 30;

You could also add some kind of inter-region heat balance check to stop the extra energy corrector loop if they are below a set tolerance, so that they are only done when needed.

emacchi

2016-02-26 12:21

reporter   ~0005981

Yeah, its also due to the segregated solution algorithm but I think that the "approximated" Newton method used while computing enthalpy based boundary condition plays a large role.

I could try to update also alpha during the Newton iteration but it's not that simple because both kappa(T) and Cp(T) are not simple functions (for example Cp(T) is something like a Gaussian function).

I was also thinking of adding additional iterations to compute only the fluid energy equation. In this way the alpha in the BC is updated without having to do a full outer correction. Implementing an inter-region heat balance to stop the energy corrector loop is good idea! I will do this shortly, thank you!

Last week, before adding the new BC I tried to use the regionCoupled functionality in OF-dev (src/regionCoupled and src/meshTools/regionCoupled/). I got it to run so the simulation setup should be ok but the results are not correct. Unfortunately there is almost no information about this functionality and I am not sure whether it is fully functional or not. I tried to check the source code (src/regionCoupled/derivedFvPatchFields/energyRegionCoupled/energyRegionCoupledFvPatchScalarField.C) but I don't understand how this works (it not that clear from "updateInterfaceMatrix"). However this seems for sure quite different from conjugateHeatFoam, the fully-coupled CHT solver of FOAM-extend.

Do you have any info about this?

emacchi

2016-03-08 11:55

reporter   ~0006007

Last edited: 2016-03-08 12:05

Update about this problem:

adding an energyCorrector loop inside the outerCorrections loop (to solve the energy equation for all the regions) solves the problems. As suggested by Juho the number of iterations can be managed automatically based on an inter-region heat balance. The latter can be computed similarly to what is done in temperatureCoupled.. boundary conditions.

jherb

2020-06-25 17:59

reporter   ~0011411

Any updates on this issue? I am running exactly into this problem. I have created a test case based on $FOAM_TUTORIALS/heatTransfer/chtMultiRegionFoam/coolingSphere

The thermophysical proberties of vapor were fitted to the output of:
https://webbook.nist.gov/cgi/fluid.cgi?Action=Data&Wide=on&ID=C7732185&Type=IsoBar&Digits=5&P=16&THigh=1275&TLow=625&TInc=10&RefState=DEF&TUnit=K&PUnit=MPa&DUnit=kg%2Fm3&HUnit=kJ%2Fkg&WUnit=m%2Fs&VisUnit=Pa*s&STUnit=N%2Fm

Is the boundary condition "turbulentTemperatureCoupledBaffleMixedMod" mentioned in the master thesis or the other developments available?

Thank you for any help

henry

2020-11-21 19:53

manager   ~0011705

This should now be resolved in OpenFOAM-dev.

Issue History

Date Modified Username Field Change
2016-02-10 15:02 emacchi New Issue
2016-02-10 16:31 emacchi Note Added: 0005933
2016-02-10 17:07 emacchi Note Added: 0005934
2016-02-10 17:28 emacchi Note Edited: 0005934
2016-02-11 08:01 wyldckat Note Added: 0005935
2016-02-11 09:54 Juho Note Added: 0005936
2016-02-11 09:56 Juho Note Edited: 0005936
2016-02-11 11:07 emacchi Note Added: 0005937
2016-02-23 12:25 emacchi Note Added: 0005978
2016-02-23 14:19 emacchi Note Edited: 0005978
2016-02-23 14:55 emacchi Note Edited: 0005978
2016-02-23 15:11 emacchi Note Edited: 0005978
2016-02-23 15:11 emacchi Note Edited: 0005978
2016-02-26 07:15 Juho Note Added: 0005980
2016-02-26 12:21 emacchi Note Added: 0005981
2016-03-08 11:55 emacchi Note Added: 0006007
2016-03-08 11:59 wyldckat Summary Heat flux computed in wallHeatFlux not correct => Problems with turbulentTemperatureCoupledBaffleMixed boundary condition
2016-03-08 12:05 emacchi Note Edited: 0006007
2016-03-08 12:05 emacchi Note Edited: 0006007
2016-03-11 11:44 administrator Category 3.0.1 => (No Category)
2016-03-20 20:38 wyldckat Category (No Category) => Bug
2020-06-25 17:59 jherb File Added: modifiedCoolingSphere.tar.gz
2020-06-25 17:59 jherb Note Added: 0011411
2020-11-21 19:53 henry Assigned To => henry
2020-11-21 19:53 henry Status new => resolved
2020-11-21 19:53 henry Resolution open => fixed
2020-11-21 19:53 henry Fixed in Version => dev
2020-11-21 19:53 henry Note Added: 0011705