View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003504 | OpenFOAM | Bug | public | 2020-06-04 05:36 | 2020-06-05 11:03 |
Reporter | SamMallinson | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | Linux | OS | Ubuntu and Debian | OS Version | 18.04 and sid |
Summary | 0003504: chtMultiRegionFoam in version 7 does not replicate good agreement with theory seen in version 6 | ||||
Description | When updating an OpenFOAM case from version 6 to version 7, we did not obtain the same good agreement with theory. To create a validation case, we derived an analytical solution for 2D fully-developed laminar flow in a plane channel (Poiseuille flow) with one wall attached to a plate heated from below, see attached schematic chtPlate.png and the following paper: https://www.researchgate.net/publication/334028691_Conjugate_Heat_Transfer_in_Thermal_Inkjet_Printheads With version 6, we obtained good agreement with theory, see attached plot T_of6.png and case files chtPlate_of6.tar. With version 7, the agreement with theory was not as good, see attached plot T_of7.png and case files chtPlate_of7.tar. On October 16th 2018 commit fc00e4 added departure functions to hConstThermo and defined an enthalpy departure for rhoConst equation of state, which meant https://github.com/OpenFOAM/OpenFOAM-6/blob/47517f2ebb1bdbacb8e3ce4b15110cd252953f87/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H#L76 changed from 0 to p/rho, see https://github.com/OpenFOAM/OpenFOAM-7/blob/b0f5c20a5a44b5ed5a1c55fd570c8c9c6dee963b/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H#L76 I would have thought the enthalpy departure function for rhoConst should be zero. We took the unpalatable step of editing the source code for OpenFOAM-7/src/thermophysicalModels/specie/equationOfState/rhoConst/rhoConstI.H#L76 so that it was the same as for OpenFOAM-6, ie 0;, and we recovered the good agreement, see attached T_of7mod.png We activated the debug switch compressible::turbulentTemperatureCoupledBaffleMixed, and this showed that the heat transfer at the interface decreases by about 4% going from version 6 to version 7. We tried refining the mesh, and found that for version 6, the agreement improved, whilst for version 7, the comparison became worse. | ||||
Steps To Reproduce | For version 6: - download chtPlate_of6.tar, un-tar it, call foam-bash-6 (. ~/pathTo/OpenFoam-6/etc/bashrc) then ./Allrun For version 7: - download chtPlate_of7.tar, un-tar it, call foam-bash-7 (. ~/pathTo/OpenFoam-6/etc/bashrc) then ./Allrun NB: the plotting routine in the folder plots requires python3 with numpy pylab os and sys installed. | ||||
Additional Information | We compared the analytical solution with results from other codes (eg ANSYS-CFX, scikit-fem) and found good agreement. Using chtMultiRegionFoam version 5 and 6, we obtained good agreement with another analytical solution (conduction against convection) and also with previous numerical simulations of laminar flow over a heated backwards-facing step, as discussed in the paper referred to above. | ||||
Tags | No tags attached. | ||||
|
|
|
> I would have thought the enthalpy departure function for rhoConst should be zero. Why? When I evaluate the departure function for rhoConst I get p/rho. There are various ways it is presented in terms of the various forms of thermodynamic state variables but a convenient form for this purpose is on page 59 of http://web.nchu.edu.tw/pweb/users/cmchang/lesson/10174.pdf or specifically for liquids on page 17/18 of https://nptel.ac.in/content/storage2/courses/103101004/downloads/chapter-5.pdf If you evaluate the departure function from that what do you get? Incidentally what solution do you get when using internal energy in OpenFOAM-6 and 7: thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo eConst; equationOfState rhoConst; specie specie; energy sensibleInternalEnergy; } Do you get the same solution for both the internal energy and enthalpy forms in both versions of OpenFOAM? |
|
The problem is that the pressure in the solid is non-uniform and so the pressure contribution to the enthalpy is non-uniform, specifically the bulk pressure in the solid is 1e5 but it is specified as 0 on the heater-liquid boundary: heater_to_liquid { type calculated; value uniform 0; } when I change this to heater_to_liquid { type calculated; value uniform 100000; } the case gives the results you expected. |
|
Thank you very much! I can confirm that changing the entry as per your suggestion returns the good agreement seen with version 6, see attached T_of7_corr_hTL_p.png The values for the patches heater_to_liquid and liquid_to_heater are set (I think) during splitMeshRegions. I had assumed that the patches would inherit values from (say) 0/p, in which all the patches, apart from frontAndBack, have calculated values: #include "./system/parameters" dimensions [1 -1 -2 0 0 0 0]; internalField uniform $pInf; boundaryField { ".*" { type calculated; value $internalField; } frontAndBack { type empty; } } After splitMeshRegions is run, the patch value settings are modified using changeDictionary. For system/liquid/changeDictionaryDict, the values for p and p_rgh are set explicitly, whereas they are not modified in system/heater/changeDictionaryDict. Then, the entry for 0/liquid/p.liquid_to_heater is correctly set as 100000, whereas (as you noted) the value for 0/heater/p.heater_to_liquid is 0 Some other points: - when the corrected case - ie with the value for heater_to_liquid correctly set - is run using sensibleInternalEnergy, the agreement is good: the values are somewhat higher than previously, but the results are withiin ~ 0.4% of theory, see attached T_of7_sIE.png - when above run is repeated in version 6, there is an error: [3] --> FOAM FATAL ERROR: [3] Unknown rhoReactionThermo type thermoType { type heRhoThermo; mixture pureMixture; transport const; thermo eConst; equationOfState rhoConst; specie specie; energy sensibleInternalEnergy; } Valid rhoReactionThermo types are: heRhoThermo homogeneousMixture const hConst incompressiblePerfectGas specie sensibleEnthalpy heRhoThermo homogeneousMixture const hConst perfectGas specie sensibleEnthalpy heRhoThermo homogeneousMixture sutherland janaf incompressiblePerfectGas specie sensibleEnthalpy heRhoThermo homogeneousMixture sutherland janaf perfectGas specie sensibleEnthalpy heRhoThermo inhomogeneousMixture const hConst incompressiblePerfectGas specie sensibleEnthalpy heRhoThermo inhomogeneousMixture const hConst perfectGas specie sensibleEnthalpy heRhoThermo inhomogeneousMixture sutherland janaf incompressiblePerfectGas specie sensibleEnthalpy heRhoThermo inhomogeneousMixture sutherland janaf perfectGas specie sensibleEnthalpy heRhoThermo multiComponentMixture const hConst adiabaticPerfectFluid specie sensibleEnthalpy heRhoThermo multiComponentMixture const hConst adiabaticPerfectFluid specie sensibleInternalEnergy heRhoThermo multiComponentMixture const hConst incompressiblePerfectGas specie sensibleEnthalpy heRhoThermo multiComponentMixture const hConst incompressiblePerfectGas specie sensibleInternalEnergy heRhoThermo multiComponentMixture const hConst perfectFluid specie sensibleEnthalpy heRhoThermo multiComponentMixture const hConst perfectFluid specie sensibleInternalEnergy heRhoThermo multiComponentMixture const hConst perfectGas specie sensibleEnthalpy heRhoThermo multiComponentMixture const hConst perfectGas specie sensibleInternalEnergy heRhoThermo multiComponentMixture const hConst rhoConst specie sensibleEnthalpy heRhoThermo multiComponentMixture const hConst rhoConst specie sensibleInternalEnergy heRhoThermo multiComponentMixture polynomial hPolynomial icoPolynomial specie sensibleEnthalpy heRhoThermo multiComponentMixture polynomial hPolynomial icoPolynomial specie sensibleInternalEnergy heRhoThermo multiComponentMixture sutherland janaf incompressiblePerfectGas specie sensibleEnthalpy heRhoThermo multiComponentMixture sutherland janaf incompressiblePerfectGas specie sensibleInternalEnergy heRhoThermo multiComponentMixture sutherland janaf perfectGas specie sensibleEnthalpy heRhoThermo multiComponentMixture sutherland janaf perfectGas specie sensibleInternalEnergy heRhoThermo pureMixture const hConst Boussinesq specie sensibleEnthalpy heRhoThermo pureMixture const hConst Boussinesq specie sensibleInternalEnergy heRhoThermo pureMixture const hConst adiabaticPerfectFluid specie sensibleEnthalpy heRhoThermo pureMixture const hConst adiabaticPerfectFluid specie sensibleInternalEnergy heRhoThermo pureMixture const hConst incompressiblePerfectGas specie sensibleEnthalpy heRhoThermo pureMixture const hConst incompressiblePerfectGas specie sensibleInternalEnergy heRhoThermo pureMixture [1] |
|
User error in the specification of the solid pressure. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-06-04 05:36 | SamMallinson | New Issue | |
2020-06-04 05:36 | SamMallinson | File Added: T_of6.png | |
2020-06-04 05:36 | SamMallinson | File Added: chtPlate.png | |
2020-06-04 05:36 | SamMallinson | File Added: T_of7.png | |
2020-06-04 05:36 | SamMallinson | File Added: chtPlate_of7.tar | |
2020-06-04 05:36 | SamMallinson | File Added: chtPlate_of6.tar | |
2020-06-04 05:36 | SamMallinson | File Added: T_of7mod.png | |
2020-06-04 14:13 | henry | Note Added: 0011374 | |
2020-06-04 19:24 | henry | Note Edited: 0011374 | |
2020-06-04 20:27 | henry | Note Added: 0011375 | |
2020-06-04 20:27 | henry | Note Edited: 0011375 | |
2020-06-05 03:18 | SamMallinson | File Added: T_of7_corr_hTL_p.png | |
2020-06-05 03:18 | SamMallinson | File Added: T_of7_sIE.png | |
2020-06-05 03:18 | SamMallinson | Note Added: 0011377 | |
2020-06-05 11:03 | henry | Assigned To | => henry |
2020-06-05 11:03 | henry | Status | new => closed |
2020-06-05 11:03 | henry | Resolution | open => no change required |
2020-06-05 11:03 | henry | Note Added: 0011378 |