CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Heat flux BC (https://www.cfd-online.com/Forums/openfoam/129523-heat-flux-bc.html)

lfrigeri3 February 6, 2014 18:58

Heat flux BC
 
Hi,
I'm me again and I've another problem in my famous room.

The room has inlet, outlet and a window. The other walls and floor are insulated.

The window has a internal surface temperature of 18°C and I know the heat flux (-218W/m^2) , yes out is cold. I don't know conductivity and thickness of the window, so I can't calculate the gradient.

In my 0/T , how can I set the BC for the window? Is it enough if I just set 18°C as fixedValue?

I tried also with:
HTML Code:

type          compressible::turbulentHeatFluxTemperature;
heatSource    flux;
q                  uniform -218;
kappa            basicThermo;
value            uniform 305;

but I have this error:
HTML Code:

--> FOAM FATAL IO ERROR:
basicThermo is not in enumeration:
4
(
directionalSolidThermo
fluidThermo
lookup
solidThermo
)

How can I solve this error?
What solution is better? How can I solve this error?

Thanks

lfrigeri3 February 10, 2014 18:05

No answers?

ahmmedshakil February 10, 2014 23:14

You can add as the heat loss from the surface as Qloss, just add the term in the governing equation. I guess this is the easiest way.

wyldckat February 16, 2014 10:50

Greetings to all!

@Luca: Have you tried using:
Code:

kappa  fluidThermo;
Best regards,
Bruno

lfrigeri3 February 16, 2014 10:55

Yes but it doesnt work i'll send the error later

lfrigeri3 February 16, 2014 16:35

Ok i tried to solve some errors, but every time it give me another error ... and now i'm stuck.

Code:

Time = 1

DILUPBiCG:  Solving for Ux, Initial residual = 0.000315202, Final residual = 1.81125e-06, No Iterations 2
DILUPBiCG:  Solving for Uy, Initial residual = 0.000383197, Final residual = 2.00909e-06, No Iterations 2
DILUPBiCG:  Solving for Uz, Initial residual = 0.000448386, Final residual = 3.1772e-06, No Iterations 2


--> FOAM FATAL ERROR:

    lookup of turbulenceModel from objectRegistry region0 successful
    but it is not a turbulenceModel, it is a kOmegaSST

    From function objectRegistry::lookupObject<Type>(const word&) const
    in file /home/opencfd/OpenFOAM/OpenFOAM-2.2.2/src/OpenFOAM/lnInclude/objectRegistryTemplates.C at line 147.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) at ??:?
#1  Foam::error::abort() at ??:?
#2  Foam::compressible::turbulenceModel const& Foam::objectRegistry::lookupObject<Foam::compressible::turbulenceModel>(Foam::word const&) const at ??:?
#3  Foam::temperatureCoupledBase::kappa(Foam::Field<double> const&) const at ??:?
#4  Foam::compressible::turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() at ??:?
#5  Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::GeometricBoundaryField::updateCoeffs() at ??:?
#6  Foam::fvMatrix<double>::fvMatrix(Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh> const&, Foam::dimensionSet const&) at ??:?
#7
 at ??:?
#8
 at ??:?
#9  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#10
 at ??:?
Aborted (core dumped)

I think I have to change something in temperature boundary condition...but i don't know how :mad::mad:

wyldckat February 22, 2014 10:35

Hi Luca,

From the description you've made on the first post, could you please create a modified case using the tutorial "heatTransfer/buoyantSimpleFoam/hotRoom", using the same settings you're using and share it with us?
I ask this because this way we (anyone reading this thread) would be able to more easily reproduce the same problem and try to find a solution.

Otherwise, it will take considerable time for anyone else to set-up the same case and attempt at reproducing the same problem.

Best regards,
Bruno

lfrigeri3 February 22, 2014 10:50

1 Attachment(s)
This is the test-case, with a very very simple mesh

I tried to manipulate this case by myself..I'm a newbie so sure there will be stupid errors.. but everyone learn from their mistakes :p

Thanks

wyldckat February 22, 2014 11:54

1 Attachment(s)
Hi Luca,

Attached is a working case, albeit not realistic at all. I simply took a hammer, a few nails and made it work without wobling :D

This is the whole list of changes made... but very cryptic looking, aren't they:
Code:

diff -Nur Prova/0/T.org Prova2/0/T.org
--- Prova/0/T.org    2014-02-16 21:33:08.000000000 +0000
+++ Prova2/0/T.org    2014-02-22 16:28:44.768521049 +0000
@@ -22,11 +22,10 @@
 {
    floor
    {
-        type          compressible::turbulentHeatFluxTemperature;
+        type            turbulentHeatFluxTemperature;
        heatSource      flux;
        q              uniform 10;
-        kappa          fluidThermo;
-    kappaName    fluidThermo;
+        alphaEff        alphat;
        value          uniform 305;
    }
    ceiling
diff -Nur Prova/constant/transportProperties Prova2/constant/transportProperties
--- Prova/constant/transportProperties    2014-02-16 20:55:43.000000000 +0000
+++ Prova2/constant/transportProperties    2014-02-22 16:30:03.320518263 +0000
@@ -21,6 +21,7 @@
 TRef        TRef [0 0 0 1 0 0 0] 298;
 Pr              Pr [0 0 0 0 0 0 0] 0.73;
 Prt            Prt [0 0 0 0 0 0 0] 0.85;
+Cp0            1.3;
 
 CrossPowerLawCoeffs
 {
diff -Nur Prova/system/fvSchemes Prova2/system/fvSchemes
--- Prova/system/fvSchemes    2014-02-16 21:26:43.000000000 +0000
+++ Prova2/system/fvSchemes    2014-02-22 16:38:19.752500655 +0000
@@ -16,42 +16,40 @@
 
 ddtSchemes
 {
-    default Euler;
+    default        steadyState;
 }
 
 gradSchemes
 {
    default        Gauss linear;
-    grad(p)        Gauss linear;
-    grad(U)        Gauss linear;
 }
 
 divSchemes
 {
-    default          none;
-    div(phi,U)      Gauss  linearUpwind Gauss;
-    div(phi,k)      Gauss  upwind;
-    div(phi,epsilon) Gauss  upwind;
-    div(phi,omega)  Gauss  upwind;
-    div((muEff*dev(T(grad(U))))) Gauss linear;
+    default        none;
+    div(phi,U)      bounded Gauss upwind;
+    div(phi,T)      bounded Gauss upwind;
+    div(phi,k)      bounded Gauss upwind;
+    div(phi,epsilon) bounded Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
+    div(phi,omega) bounded Gauss linear;
 }
 
 laplacianSchemes
 {
-    default                    none;
-    laplacian(nuEff,U)            Gauss linear corrected;
-    laplacian((1|A(U)),p)        Gauss linear corrected;
-    laplacian(DkEff,k)            Gauss linear corrected;
-    laplacian(DomegaEff,omega)        Gauss linear corrected;
-    laplacian(DepsilonEff,epsilon)      Gauss linear corrected;
-    laplacian(1,p)                      Gauss linear corrected;
+    default        none;
+    laplacian(nuEff,U) Gauss linear corrected;
+    laplacian(Dp,p_rgh) Gauss linear corrected;
+    laplacian(alphaEff,T) Gauss linear corrected;
+    laplacian(DkEff,k) Gauss linear corrected;
+    laplacian(DepsilonEff,epsilon) Gauss linear corrected;
+    laplacian(DREff,R) Gauss linear corrected;
+    laplacian(DomegaEff,omega) Gauss linear corrected;
 }
 
 interpolationSchemes
 {
    default        linear;
-    interpolate(U)  linear;
 }
 
 snGradSchemes
@@ -62,7 +60,7 @@
 fluxRequired
 {
    default        no;
-    p;
+    p_rgh          ;
 }
 
 // ************************************************************************* //
diff -Nur Prova/system/fvSolution Prova2/system/fvSolution
--- Prova/system/fvSolution    2014-02-16 21:24:56.000000000 +0000
+++ Prova2/system/fvSolution    2014-02-22 16:36:54.124503691 +0000
@@ -24,58 +24,52 @@
 
 solvers
 {
-
-    p PCG
+    p_rgh
    {
-        maxIter          1000;
-        preconditioner  DIC;
-        tolerance        1e-06;
-        relTol          0;
-    };
+        solver          PCG;
+        preconditioner  DIC;
+        tolerance      1e-08;
+        relTol          0.01;
+    }
 
-    U PBiCG
-    {
-        preconditioner  DILU;
-        tolerance        1e-05;
-        relTol          0;
-    };
-    k PBiCG
-    {
-        preconditioner  DILU;
-        tolerance        1e-05;
-        relTol          0;
-    };
-    omega PBiCG
+    "(U|T|k|epsilon|R|omega)"
    {
-        preconditioner  DILU;
-        tolerance        1e-05;
-        relTol          0;
-    };
-    epsilon PBiCG
-    {
-        preconditioner  DILU;
-        tolerance        1e-05;
-        relTol          0;
-    };
-
+        solver          PBiCG;
+        preconditioner  DILU;
+        tolerance      1e-05;
+        relTol          0.1;
+    }
 }
 
 SIMPLE
 {
-    nNonOrthogonalCorrectors  2;
-pRefCell            0;
-    pRefValue          0;
+    nNonOrthogonalCorrectors 0;
+    pRefCell        0;
+    pRefValue      0;
 
+    residualControl
+    {
+        p_rgh          1e-2;
+        U              1e-4;
+        T              1e-2;
+
+        // possibly check turbulence fields
+        "(k|epsilon|omega)" 1e-3;
+    }
 }
 
 relaxationFactors
 {
-    p        0.3;
-    U        0.7;
-    k        0.7;
-    epsilon  0.7;
-    omega    0.7;
+    fields
+    {
+        p_rgh          0.7;
+    }
+    equations
+    {
+        U              0.3;
+        T              0.5;
+        "(k|epsilon|R)" 0.7;
+    }
 }
 
-
 // ************************************************************************* //

Essentially, what I've done was:
  1. Looked into the source code for the boundary condition "compressible::turbulentHeatFluxTemperature". Guess what, this boundary condition cannot be used with the solver buoyantBoussinesqSimpleFoam, because it's an incompressible solver with the Boussinesq approximation for buoyancy.
  2. So I switched to the incompressible BC "turbulentHeatFluxTemperature":
    Code:

        floor
        {
            type            turbulentHeatFluxTemperature;
            heatSource      flux;
            q              uniform 10;
            alphaEff        alphat;
            value          uniform 305;
        }

  3. Had to add the entry "Cp0" to the file "constant/transportProperties". The value I used is completely random. You'll have to define the correct one for your own case.
  4. Configured the files "system/fvSchemes" and "system/fvSolution" based on the tutorial "heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/" and added in the entries that the solver complained about.
Note: The solver crashes after 400 and something iterations, because the temperature goes well beyond the 15 degree Celsius that the Boussinesq approximation allows for.

Best regards,
Bruno

lfrigeri3 February 22, 2014 11:59

Thanks a lot!!

Later I will try .. even if for my thesis I'm using another set of BC and, compared to the experimental result, it seems quite good.

Then in the conclusions I will talk about this (probably better) possibility!

Thanks again!


All times are GMT -4. The time now is 05:11.