From 49faec23f90704bba0f57600d6e75fafd0bae12d Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 1 Sep 2009 19:35:59 +0100 Subject: [PATCH 01/12] added binary diffusion calc - uses molecular weight of binary pair --- src/thermophysicalModels/liquids/Ar/Ar.H | 3 +++ src/thermophysicalModels/liquids/Ar/ArI.H | 6 ++++++ src/thermophysicalModels/liquids/C10H22/C10H22.H | 3 +++ src/thermophysicalModels/liquids/C10H22/C10H22I.H | 6 ++++++ src/thermophysicalModels/liquids/C12H26/C12H26.H | 3 +++ src/thermophysicalModels/liquids/C12H26/C12H26I.H | 6 ++++++ src/thermophysicalModels/liquids/C13H28/C13H28.H | 3 +++ src/thermophysicalModels/liquids/C13H28/C13H28I.H | 6 ++++++ src/thermophysicalModels/liquids/C14H30/C14H30.H | 3 +++ src/thermophysicalModels/liquids/C14H30/C14H30I.H | 6 ++++++ src/thermophysicalModels/liquids/C16H34/C16H34.H | 3 +++ src/thermophysicalModels/liquids/C16H34/C16H34I.H | 6 ++++++ src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H | 3 +++ src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H | 6 ++++++ src/thermophysicalModels/liquids/C2H6/C2H6.H | 3 +++ src/thermophysicalModels/liquids/C2H6/C2H6I.H | 6 ++++++ src/thermophysicalModels/liquids/C2H6O/C2H6O.H | 3 +++ src/thermophysicalModels/liquids/C2H6O/C2H6OI.H | 6 ++++++ src/thermophysicalModels/liquids/C3H6O/C3H6O.H | 3 +++ src/thermophysicalModels/liquids/C3H6O/C3H6OI.H | 6 ++++++ src/thermophysicalModels/liquids/C3H8/C3H8.H | 3 +++ src/thermophysicalModels/liquids/C3H8/C3H8I.H | 6 ++++++ src/thermophysicalModels/liquids/C4H10O/C4H10O.H | 3 +++ src/thermophysicalModels/liquids/C4H10O/C4H10OI.H | 6 ++++++ src/thermophysicalModels/liquids/C6H14/C6H14.H | 3 +++ src/thermophysicalModels/liquids/C6H14/C6H14I.H | 6 ++++++ src/thermophysicalModels/liquids/C6H6/C6H6.H | 3 +++ src/thermophysicalModels/liquids/C6H6/C6H6I.H | 6 ++++++ src/thermophysicalModels/liquids/C7H16/C7H16.H | 3 +++ src/thermophysicalModels/liquids/C7H16/C7H16I.H | 6 ++++++ src/thermophysicalModels/liquids/C7H8/C7H8.H | 3 +++ src/thermophysicalModels/liquids/C7H8/C7H8I.H | 6 ++++++ src/thermophysicalModels/liquids/C8H10/C8H10.H | 3 +++ src/thermophysicalModels/liquids/C8H10/C8H10I.H | 6 ++++++ src/thermophysicalModels/liquids/C8H18/C8H18.H | 3 +++ src/thermophysicalModels/liquids/C8H18/C8H18I.H | 6 ++++++ src/thermophysicalModels/liquids/C9H20/C9H20.H | 3 +++ src/thermophysicalModels/liquids/C9H20/C9H20I.H | 6 ++++++ src/thermophysicalModels/liquids/CH3OH/CH3OH.H | 3 +++ src/thermophysicalModels/liquids/CH3OH/CH3OHI.H | 6 ++++++ src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H | 3 +++ src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H | 6 ++++++ src/thermophysicalModels/liquids/H2O/H2O.H | 3 +++ src/thermophysicalModels/liquids/H2O/H2OI.H | 6 ++++++ src/thermophysicalModels/liquids/IC8H18/IC8H18.H | 3 +++ src/thermophysicalModels/liquids/IC8H18/IC8H18I.H | 6 ++++++ src/thermophysicalModels/liquids/IDEA/IDEA.H | 3 +++ src/thermophysicalModels/liquids/IDEA/IDEAI.H | 6 ++++++ src/thermophysicalModels/liquids/MB/MB.H | 3 +++ src/thermophysicalModels/liquids/MB/MBI.H | 6 ++++++ src/thermophysicalModels/liquids/N2/N2.H | 3 +++ src/thermophysicalModels/liquids/N2/N2I.H | 6 ++++++ src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H | 3 +++ src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H | 8 ++++++++ src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H | 3 +++ src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H | 6 ++++++ src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H | 4 ++++ src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H | 7 +++++++ src/thermophysicalModels/liquids/liquid/liquid.H | 3 +++ src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H | 4 ++++ src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H | 7 +++++++ .../APIfunctions/APIdiffCoefFunc/APIdiffCoefFunc.H | 8 ++++++++ 62 files changed, 287 insertions(+) diff --git a/src/thermophysicalModels/liquids/Ar/Ar.H b/src/thermophysicalModels/liquids/Ar/Ar.H index 39e8f0f960..dff4470831 100644 --- a/src/thermophysicalModels/liquids/Ar/Ar.H +++ b/src/thermophysicalModels/liquids/Ar/Ar.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/Ar/ArI.H b/src/thermophysicalModels/liquids/Ar/ArI.H index 72ba64c1a8..f1a4aa24f8 100644 --- a/src/thermophysicalModels/liquids/Ar/ArI.H +++ b/src/thermophysicalModels/liquids/Ar/ArI.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::Ar::D(scalar p, scalar T) const } +inline Foam::scalar Foam::Ar::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C10H22/C10H22.H b/src/thermophysicalModels/liquids/C10H22/C10H22.H index 88ee972321..6e6804b014 100644 --- a/src/thermophysicalModels/liquids/C10H22/C10H22.H +++ b/src/thermophysicalModels/liquids/C10H22/C10H22.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C10H22/C10H22I.H b/src/thermophysicalModels/liquids/C10H22/C10H22I.H index bdbc395f1f..e79745b6db 100644 --- a/src/thermophysicalModels/liquids/C10H22/C10H22I.H +++ b/src/thermophysicalModels/liquids/C10H22/C10H22I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C10H22::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C10H22::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C12H26/C12H26.H b/src/thermophysicalModels/liquids/C12H26/C12H26.H index 9c3cba2ac2..01ca933f8e 100644 --- a/src/thermophysicalModels/liquids/C12H26/C12H26.H +++ b/src/thermophysicalModels/liquids/C12H26/C12H26.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C12H26/C12H26I.H b/src/thermophysicalModels/liquids/C12H26/C12H26I.H index 0edb1e981a..f11b325533 100644 --- a/src/thermophysicalModels/liquids/C12H26/C12H26I.H +++ b/src/thermophysicalModels/liquids/C12H26/C12H26I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C12H26::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C12H26::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C13H28/C13H28.H b/src/thermophysicalModels/liquids/C13H28/C13H28.H index d97300f1d1..dbae5d0ca6 100644 --- a/src/thermophysicalModels/liquids/C13H28/C13H28.H +++ b/src/thermophysicalModels/liquids/C13H28/C13H28.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C13H28/C13H28I.H b/src/thermophysicalModels/liquids/C13H28/C13H28I.H index 333905a9f3..557898017e 100644 --- a/src/thermophysicalModels/liquids/C13H28/C13H28I.H +++ b/src/thermophysicalModels/liquids/C13H28/C13H28I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C13H28::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C13H28::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C14H30/C14H30.H b/src/thermophysicalModels/liquids/C14H30/C14H30.H index 183ee026de..65e06ac6b4 100644 --- a/src/thermophysicalModels/liquids/C14H30/C14H30.H +++ b/src/thermophysicalModels/liquids/C14H30/C14H30.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C14H30/C14H30I.H b/src/thermophysicalModels/liquids/C14H30/C14H30I.H index 6c64cab8c4..3d977890dc 100644 --- a/src/thermophysicalModels/liquids/C14H30/C14H30I.H +++ b/src/thermophysicalModels/liquids/C14H30/C14H30I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C14H30::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C14H30::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C16H34/C16H34.H b/src/thermophysicalModels/liquids/C16H34/C16H34.H index 5f2b883163..9a486ba41b 100644 --- a/src/thermophysicalModels/liquids/C16H34/C16H34.H +++ b/src/thermophysicalModels/liquids/C16H34/C16H34.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C16H34/C16H34I.H b/src/thermophysicalModels/liquids/C16H34/C16H34I.H index 66a19bb3d4..e3fc33a016 100644 --- a/src/thermophysicalModels/liquids/C16H34/C16H34I.H +++ b/src/thermophysicalModels/liquids/C16H34/C16H34I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C16H34::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C16H34::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H b/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H index 88a7099446..0cab3020c4 100644 --- a/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H +++ b/src/thermophysicalModels/liquids/C2H5OH/C2H5OH.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H b/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H index cf051eea9c..b23ab9f4a6 100644 --- a/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H +++ b/src/thermophysicalModels/liquids/C2H5OH/C2H5OHI.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C2H5OH::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C2H5OH::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H6/C2H6.H b/src/thermophysicalModels/liquids/C2H6/C2H6.H index 728c362732..bd213ab41e 100644 --- a/src/thermophysicalModels/liquids/C2H6/C2H6.H +++ b/src/thermophysicalModels/liquids/C2H6/C2H6.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C2H6/C2H6I.H b/src/thermophysicalModels/liquids/C2H6/C2H6I.H index a788413b0e..5ebc99786d 100644 --- a/src/thermophysicalModels/liquids/C2H6/C2H6I.H +++ b/src/thermophysicalModels/liquids/C2H6/C2H6I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C2H6::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C2H6::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C2H6O/C2H6O.H b/src/thermophysicalModels/liquids/C2H6O/C2H6O.H index 690f68d9e4..5baa101b99 100644 --- a/src/thermophysicalModels/liquids/C2H6O/C2H6O.H +++ b/src/thermophysicalModels/liquids/C2H6O/C2H6O.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H b/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H index 5e2b7cadc7..794b495979 100644 --- a/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H +++ b/src/thermophysicalModels/liquids/C2H6O/C2H6OI.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C2H6O::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C2H6O::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C3H6O/C3H6O.H b/src/thermophysicalModels/liquids/C3H6O/C3H6O.H index b08db3fc0b..bfca7d5a26 100644 --- a/src/thermophysicalModels/liquids/C3H6O/C3H6O.H +++ b/src/thermophysicalModels/liquids/C3H6O/C3H6O.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H b/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H index a02afbde38..9b6928c992 100644 --- a/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H +++ b/src/thermophysicalModels/liquids/C3H6O/C3H6OI.H @@ -101,4 +101,10 @@ inline Foam::scalar Foam::C3H6O::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C3H6O::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C3H8/C3H8.H b/src/thermophysicalModels/liquids/C3H8/C3H8.H index 27477b01c6..73e0268e6e 100644 --- a/src/thermophysicalModels/liquids/C3H8/C3H8.H +++ b/src/thermophysicalModels/liquids/C3H8/C3H8.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C3H8/C3H8I.H b/src/thermophysicalModels/liquids/C3H8/C3H8I.H index 7ba1f47a74..013935c41b 100644 --- a/src/thermophysicalModels/liquids/C3H8/C3H8I.H +++ b/src/thermophysicalModels/liquids/C3H8/C3H8I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C3H8::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C3H8::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C4H10O/C4H10O.H b/src/thermophysicalModels/liquids/C4H10O/C4H10O.H index b2da446849..d0055e3593 100644 --- a/src/thermophysicalModels/liquids/C4H10O/C4H10O.H +++ b/src/thermophysicalModels/liquids/C4H10O/C4H10O.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H b/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H index bc067ebaff..b9eedfda55 100644 --- a/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H +++ b/src/thermophysicalModels/liquids/C4H10O/C4H10OI.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C4H10O::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C4H10O::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C6H14/C6H14.H b/src/thermophysicalModels/liquids/C6H14/C6H14.H index 919d68bfd6..a250804137 100644 --- a/src/thermophysicalModels/liquids/C6H14/C6H14.H +++ b/src/thermophysicalModels/liquids/C6H14/C6H14.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C6H14/C6H14I.H b/src/thermophysicalModels/liquids/C6H14/C6H14I.H index 144648c0a7..076914fb2a 100644 --- a/src/thermophysicalModels/liquids/C6H14/C6H14I.H +++ b/src/thermophysicalModels/liquids/C6H14/C6H14I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C6H14::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C6H14::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C6H6/C6H6.H b/src/thermophysicalModels/liquids/C6H6/C6H6.H index cc9c5ac1f1..f404e22e98 100644 --- a/src/thermophysicalModels/liquids/C6H6/C6H6.H +++ b/src/thermophysicalModels/liquids/C6H6/C6H6.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C6H6/C6H6I.H b/src/thermophysicalModels/liquids/C6H6/C6H6I.H index 3aca0ee525..6205801ca9 100644 --- a/src/thermophysicalModels/liquids/C6H6/C6H6I.H +++ b/src/thermophysicalModels/liquids/C6H6/C6H6I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C6H6::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C6H6::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C7H16/C7H16.H b/src/thermophysicalModels/liquids/C7H16/C7H16.H index 617cffb04b..b186035160 100644 --- a/src/thermophysicalModels/liquids/C7H16/C7H16.H +++ b/src/thermophysicalModels/liquids/C7H16/C7H16.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C7H16/C7H16I.H b/src/thermophysicalModels/liquids/C7H16/C7H16I.H index 27eb0761e1..9908b72174 100644 --- a/src/thermophysicalModels/liquids/C7H16/C7H16I.H +++ b/src/thermophysicalModels/liquids/C7H16/C7H16I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C7H16::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C7H16::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C7H8/C7H8.H b/src/thermophysicalModels/liquids/C7H8/C7H8.H index 8d0afcf8cb..1eaab1c348 100644 --- a/src/thermophysicalModels/liquids/C7H8/C7H8.H +++ b/src/thermophysicalModels/liquids/C7H8/C7H8.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C7H8/C7H8I.H b/src/thermophysicalModels/liquids/C7H8/C7H8I.H index 02813a18f8..6a8e4c8762 100644 --- a/src/thermophysicalModels/liquids/C7H8/C7H8I.H +++ b/src/thermophysicalModels/liquids/C7H8/C7H8I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C7H8::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C7H8::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C8H10/C8H10.H b/src/thermophysicalModels/liquids/C8H10/C8H10.H index 6301c555cc..c9cc72ac0e 100644 --- a/src/thermophysicalModels/liquids/C8H10/C8H10.H +++ b/src/thermophysicalModels/liquids/C8H10/C8H10.H @@ -152,6 +152,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C8H10/C8H10I.H b/src/thermophysicalModels/liquids/C8H10/C8H10I.H index 58ee6c81a9..09bb1750d2 100644 --- a/src/thermophysicalModels/liquids/C8H10/C8H10I.H +++ b/src/thermophysicalModels/liquids/C8H10/C8H10I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C8H10::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C8H10::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C8H18/C8H18.H b/src/thermophysicalModels/liquids/C8H18/C8H18.H index 20f4f5aa11..9b3db0de3f 100644 --- a/src/thermophysicalModels/liquids/C8H18/C8H18.H +++ b/src/thermophysicalModels/liquids/C8H18/C8H18.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C8H18/C8H18I.H b/src/thermophysicalModels/liquids/C8H18/C8H18I.H index 3844155a37..9a6258e68d 100644 --- a/src/thermophysicalModels/liquids/C8H18/C8H18I.H +++ b/src/thermophysicalModels/liquids/C8H18/C8H18I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C8H18::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C8H18::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/C9H20/C9H20.H b/src/thermophysicalModels/liquids/C9H20/C9H20.H index be28728d4f..b8b90c8d5f 100644 --- a/src/thermophysicalModels/liquids/C9H20/C9H20.H +++ b/src/thermophysicalModels/liquids/C9H20/C9H20.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/C9H20/C9H20I.H b/src/thermophysicalModels/liquids/C9H20/C9H20I.H index d478264307..0417380dab 100644 --- a/src/thermophysicalModels/liquids/C9H20/C9H20I.H +++ b/src/thermophysicalModels/liquids/C9H20/C9H20I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::C9H20::D(scalar p, scalar T) const } +inline Foam::scalar Foam::C9H20::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/CH3OH/CH3OH.H b/src/thermophysicalModels/liquids/CH3OH/CH3OH.H index 11deb6a861..87770ab0fe 100644 --- a/src/thermophysicalModels/liquids/CH3OH/CH3OH.H +++ b/src/thermophysicalModels/liquids/CH3OH/CH3OH.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H b/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H index 28c56dde54..2ca785c910 100644 --- a/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H +++ b/src/thermophysicalModels/liquids/CH3OH/CH3OHI.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::CH3OH::D(scalar p, scalar T) const } +inline Foam::scalar Foam::CH3OH::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H b/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H index bcfbbd62ef..8818596e59 100644 --- a/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H +++ b/src/thermophysicalModels/liquids/CH4N2O/CH4N2O.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H b/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H index b04233aad1..b1aa667864 100644 --- a/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H +++ b/src/thermophysicalModels/liquids/CH4N2O/CH4N2OI.H @@ -102,5 +102,11 @@ inline Foam::scalar Foam::CH4N2O::D(scalar p, scalar T) const } +inline Foam::scalar Foam::CH4N2O::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/H2O/H2O.H b/src/thermophysicalModels/liquids/H2O/H2O.H index 92287b2216..5b7e4f1715 100644 --- a/src/thermophysicalModels/liquids/H2O/H2O.H +++ b/src/thermophysicalModels/liquids/H2O/H2O.H @@ -152,6 +152,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/H2O/H2OI.H b/src/thermophysicalModels/liquids/H2O/H2OI.H index bc5c4bff5a..5032fcc341 100644 --- a/src/thermophysicalModels/liquids/H2O/H2OI.H +++ b/src/thermophysicalModels/liquids/H2O/H2OI.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::H2O::D(scalar p, scalar T) const } +inline Foam::scalar Foam::H2O::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/IC8H18/IC8H18.H b/src/thermophysicalModels/liquids/IC8H18/IC8H18.H index 48de18edbe..3833578a07 100644 --- a/src/thermophysicalModels/liquids/IC8H18/IC8H18.H +++ b/src/thermophysicalModels/liquids/IC8H18/IC8H18.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H b/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H index ac53685cb8..9e0cecf277 100644 --- a/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H +++ b/src/thermophysicalModels/liquids/IC8H18/IC8H18I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::IC8H18::D(scalar p, scalar T) const } +inline Foam::scalar Foam::IC8H18::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/IDEA/IDEA.H b/src/thermophysicalModels/liquids/IDEA/IDEA.H index a51aa86cbf..58f1a45d4d 100644 --- a/src/thermophysicalModels/liquids/IDEA/IDEA.H +++ b/src/thermophysicalModels/liquids/IDEA/IDEA.H @@ -175,6 +175,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/IDEA/IDEAI.H b/src/thermophysicalModels/liquids/IDEA/IDEAI.H index 865d7babfe..fd236ccb00 100644 --- a/src/thermophysicalModels/liquids/IDEA/IDEAI.H +++ b/src/thermophysicalModels/liquids/IDEA/IDEAI.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::IDEA::D(scalar p, scalar T) const } +inline Foam::scalar Foam::IDEA::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/MB/MB.H b/src/thermophysicalModels/liquids/MB/MB.H index e9e4703e3d..ef1047582a 100644 --- a/src/thermophysicalModels/liquids/MB/MB.H +++ b/src/thermophysicalModels/liquids/MB/MB.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/MB/MBI.H b/src/thermophysicalModels/liquids/MB/MBI.H index 058d2c9f26..c4c8f126c6 100644 --- a/src/thermophysicalModels/liquids/MB/MBI.H +++ b/src/thermophysicalModels/liquids/MB/MBI.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::MB::D(scalar p, scalar T) const } +inline Foam::scalar Foam::MB::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/N2/N2.H b/src/thermophysicalModels/liquids/N2/N2.H index 3595320ce8..61ce2f50cb 100644 --- a/src/thermophysicalModels/liquids/N2/N2.H +++ b/src/thermophysicalModels/liquids/N2/N2.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/N2/N2I.H b/src/thermophysicalModels/liquids/N2/N2I.H index 757f99d293..c4ae9e25be 100644 --- a/src/thermophysicalModels/liquids/N2/N2I.H +++ b/src/thermophysicalModels/liquids/N2/N2I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::N2::D(scalar p, scalar T) const } +inline Foam::scalar Foam::N2::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H index 7489d6a0e4..e8cceb248a 100644 --- a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H +++ b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H index 4cf642cc0b..68b2759081 100644 --- a/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H +++ b/src/thermophysicalModels/liquids/aC10H7CH3/aC10H7CH3I.H @@ -102,4 +102,12 @@ inline Foam::scalar Foam::aC10H7CH3::D(scalar p, scalar T) const } + + +inline Foam::scalar Foam::aC10H7CH3::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H index add7fa7e93..ee07c95228 100644 --- a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H +++ b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3.H @@ -153,6 +153,9 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H index 1be40b2f2d..7d8a29062a 100644 --- a/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H +++ b/src/thermophysicalModels/liquids/bC10H7CH3/bC10H7CH3I.H @@ -102,4 +102,10 @@ inline Foam::scalar Foam::bC10H7CH3::D(scalar p, scalar T) const } +inline Foam::scalar Foam::bC10H7CH3::D(scalar p, scalar T, scalar Wb) const +{ + return D_.f(p, T, Wb); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H b/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H index d6f59b9568..e1ac389d51 100644 --- a/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H +++ b/src/thermophysicalModels/liquids/iC3H8O/iC3H8O.H @@ -151,6 +151,10 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + // Note: behaves the same as D(p, T) + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H b/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H index 3ec8bd368d..1c65174759 100644 --- a/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H +++ b/src/thermophysicalModels/liquids/iC3H8O/iC3H8OI.H @@ -102,5 +102,12 @@ inline Foam::scalar Foam::iC3H8O::D(scalar p, scalar T) const } +inline Foam::scalar Foam::iC3H8O::D(scalar p, scalar T, scalar) const +{ + // Use 'standard' NSRDS D(p, T) function + return D(p, T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/liquids/liquid/liquid.H b/src/thermophysicalModels/liquids/liquid/liquid.H index 053d36027b..c0f52c11c3 100644 --- a/src/thermophysicalModels/liquids/liquid/liquid.H +++ b/src/thermophysicalModels/liquids/liquid/liquid.H @@ -243,6 +243,9 @@ public: //- Vapour diffussivity [m2/s] virtual scalar D(scalar p, scalar T) const = 0; + //- Vapour diffussivity [m2/s] with specified binary pair + virtual scalar D(scalar p, scalar T, scalar Wb) const = 0; + // I-O diff --git a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H b/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H index 27601bc548..055eeb264d 100644 --- a/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H +++ b/src/thermophysicalModels/liquids/nC3H8O/nC3H8O.H @@ -151,6 +151,10 @@ public: //- Vapour diffussivity [m2/s] inline scalar D(scalar p, scalar T) const; + //- Vapour diffussivity [m2/s] with specified binary pair + // Note: behaves the same as D(p, T) + inline scalar D(scalar p, scalar T, scalar Wb) const; + // I-O diff --git a/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H b/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H index ec850eddf8..d5305d2d58 100644 --- a/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H +++ b/src/thermophysicalModels/liquids/nC3H8O/nC3H8OI.H @@ -102,5 +102,12 @@ inline Foam::scalar Foam::nC3H8O::D(scalar p, scalar T) const } +inline Foam::scalar Foam::nC3H8O::D(scalar p, scalar T, scalar) const +{ + // Use 'standard' NSRDS D(p, T) function + return D(p, T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/thermophysicalFunctions/APIfunctions/APIdiffCoefFunc/APIdiffCoefFunc.H b/src/thermophysicalModels/thermophysicalFunctions/APIfunctions/APIdiffCoefFunc/APIdiffCoefFunc.H index 7f95e450e3..506aac64c7 100644 --- a/src/thermophysicalModels/thermophysicalFunctions/APIfunctions/APIdiffCoefFunc/APIdiffCoefFunc.H +++ b/src/thermophysicalModels/thermophysicalFunctions/APIfunctions/APIdiffCoefFunc/APIdiffCoefFunc.H @@ -103,6 +103,14 @@ public: return 3.6059e-3*(pow(1.8*T, 1.75))*alpha_/(p*beta_); } + //- API vapour mass diffusivity function using properties from + // construction - with specified binary pair + scalar f(scalar p, scalar T, scalar Wa) const + { + const scalar alphaBinary = sqrt(1/wf_ + 1/Wa); + return 3.6059e-3*(pow(1.8*T, 1.75))*alphaBinary/(p*beta_); + } + //- Write the function coefficients void writeData(Ostream& os) const { From 68ad7013350c8def50890068f9706a866dedd851 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 1 Sep 2009 19:40:00 +0100 Subject: [PATCH 02/12] library updates + introduction of thermal shielding --- .../COxidationDiffusionLimitedRate.C | 2 +- .../COxidationDiffusionLimitedRate.H | 2 +- .../COxidationKineticDiffusionLimitedRate.C | 2 +- .../COxidationKineticDiffusionLimitedRate.H | 2 +- .../COxidationMurphyShaddix.C | 7 +- .../COxidationMurphyShaddix.H | 2 +- .../KinematicParcel/KinematicParcel.C | 14 +- .../KinematicParcel/KinematicParcel.H | 10 + .../KinematicParcel/KinematicParcelI.H | 13 ++ .../ReactingMultiphaseParcel.C | 145 ++++++++++--- .../ReactingMultiphaseParcel.H | 9 +- .../Templates/ReactingParcel/ReactingParcel.C | 195 ++++++++++++++++-- .../Templates/ReactingParcel/ReactingParcel.H | 23 ++- .../Templates/ThermoParcel/ThermoParcel.C | 84 ++++++-- .../Templates/ThermoParcel/ThermoParcel.H | 25 ++- .../Templates/ThermoParcel/ThermoParcelI.H | 11 +- .../include/makeParcelHeatTransferModels.H | 7 + .../makeReactingParcelHeatTransferModels.H | 8 + .../Kinematic/DragModel/DragModel/DragModel.C | 9 +- .../Kinematic/DragModel/DragModel/DragModel.H | 8 +- .../LiquidEvaporation/LiquidEvaporation.C | 47 ++--- .../LiquidEvaporation/LiquidEvaporation.H | 6 +- .../NoPhaseChange/NoPhaseChange.C | 2 +- .../NoPhaseChange/NoPhaseChange.H | 6 +- .../PhaseChangeModel/PhaseChangeModel.H | 6 +- .../NoSurfaceReaction/NoSurfaceReaction.C | 2 +- .../NoSurfaceReaction/NoSurfaceReaction.H | 2 +- .../SurfaceReactionModel.H | 2 +- .../HeatTransferModel/HeatTransferModel.C | 46 +---- .../HeatTransferModel/HeatTransferModel.H | 24 +-- .../RanzMarshallBirdCorrection.C | 79 +++++++ .../RanzMarshallBirdCorrection.H | 101 +++++++++ 32 files changed, 706 insertions(+), 195 deletions(-) create mode 100644 src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.C create mode 100644 src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.H diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C index 21e51a9e63..cdea75f6a4 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C @@ -103,7 +103,7 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate const scalarField& YLiquid, const scalarField& YSolid, const scalarField& YMixture, - const scalarField& dMassVolatile, + const scalar N, scalarField& dMassGas, scalarField& dMassLiquid, scalarField& dMassSolid, diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.H b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.H index 9ab6a5c0f9..c7fb7c05ea 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.H +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.H @@ -131,7 +131,7 @@ public: const scalarField& YLiquid, const scalarField& YSolid, const scalarField& YMixture, - const scalarField& dMassVolatile, + const scalar N, scalarField& dMassGas, scalarField& dMassLiquid, scalarField& dMassSolid, diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C index a96c2ee507..d2cfccc5a3 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C @@ -111,7 +111,7 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate const scalarField& YLiquid, const scalarField& YSolid, const scalarField& YMixture, - const scalarField& dMassVolatile, + const scalar N, scalarField& dMassGas, scalarField& dMassLiquid, scalarField& dMassSolid, diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.H b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.H index 6500b24c4f..794aaf431f 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.H +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.H @@ -139,7 +139,7 @@ public: const scalarField& YLiquid, const scalarField& YSolid, const scalarField& YMixture, - const scalarField& dMassVolatile, + const scalar N, scalarField& dMassGas, scalarField& dMassLiquid, scalarField& dMassSolid, diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C index 6ee7419b8a..39f4f2d28a 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C @@ -107,7 +107,7 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate const scalarField& YLiquid, const scalarField& YSolid, const scalarField& YMixture, - const scalarField& dMassVolatile, + const scalar N, scalarField& dMassGas, scalarField& dMassLiquid, scalarField& dMassSolid, @@ -143,9 +143,6 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate // Far field partial pressure O2 [Pa] const scalar ppO2 = rhoO2/WO2_*specie::RR*Tc; - // Molar emission rate of volatiles per unit surface area - const scalar qVol = sum(dMassVolatile)/(WVol_*Ap); - // Total molar concentration of the carrier phase [kmol/m^3] const scalar C = pc/(specie::RR*Tc); @@ -174,7 +171,7 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate while ((mag(qCs - qCsOld)/qCs > tolerance_) && (iter <= maxIters_)) { qCsOld = qCs; - const scalar PO2Surface = ppO2*exp(-(qCs + qVol)*d/(2*C*D)); + const scalar PO2Surface = ppO2*exp(-(qCs + N)*d/(2*C*D)); qCs = A_*exp(-E_/(specie::RR*T))*pow(PO2Surface, n_); qCs = (100.0*qCs + iter*qCsOld)/(100.0 + iter); qCs = min(qCs, qCsLim); diff --git a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.H b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.H index 7864fc6337..1abd05190b 100644 --- a/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.H +++ b/src/lagrangian/coalCombustion/submodels/surfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.H @@ -152,7 +152,7 @@ public: const scalarField& YLiquid, const scalarField& YSolid, const scalarField& YMixture, - const scalarField& dMassVolatile, + const scalar N, scalarField& dMassGas, scalarField& dMassLiquid, scalarField& dMassSolid, diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index c7a4b464c5..cb301d8210 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -101,6 +101,12 @@ void Foam::KinematicParcel::calc const scalar rho0 = rho_; const scalar mass0 = mass(); + // Reynolds number + const scalar Re = this->Re(U0, d0, muc_); + + + // Sources + //~~~~~~~~ // Explicit momentum source for particle vector Su = vector::zero; @@ -113,7 +119,8 @@ void Foam::KinematicParcel::calc // ~~~~~~ // Calculate new particle velocity - vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); + vector U1 = + calcVelocity(td, dt, cellI, Re, muc_, d0, U0, rho0, mass0, Su, dUTrans); // Accumulate carrier phase source terms @@ -138,6 +145,8 @@ const Foam::vector Foam::KinematicParcel::calcVelocity TrackData& td, const scalar dt, const label cellI, + const scalar Re, + const scalar mu, const scalar d, const vector& U, const scalar rho, @@ -149,8 +158,7 @@ const Foam::vector Foam::KinematicParcel::calcVelocity const polyMesh& mesh = this->cloud().pMesh(); // Momentum transfer coefficient - const scalar utc = - td.cloud().drag().utc(U - Uc_, d, rhoc_, muc_) + ROOTVSMALL; + const scalar utc = td.cloud().drag().utc(Re, d, mu) + ROOTVSMALL; // Momentum source due to particle forces const vector FCoupled = diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 04615ab605..29979d106d 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -238,6 +238,8 @@ protected: TrackData& td, const scalar dt, // timestep const label cellI, // owner cell + const scalar Re, // Reynolds number + const scalar mu, // local carrier viscosity const scalar d, // diameter const vector& U, // velocity const scalar rho, // density @@ -387,6 +389,14 @@ public: //- Surface area for given diameter inline scalar areaS(const scalar d) const; + //- Reynolds number - particle properties input + inline scalar Re + ( + const vector& U, + const scalar d, + const scalar mu + ) const; + // Main calculation loop diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index 30dc8ca1e7..d847ac38e0 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -385,4 +385,17 @@ Foam::KinematicParcel::areaS(const scalar d) const } +template +inline Foam::scalar +Foam::KinematicParcel::Re +( + const vector& U, + const scalar d, + const scalar mu +) const +{ + return rhoc_*mag(U - Uc_)*d/mu; +} + + // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index a215242cbc..31d8e9b2d6 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -206,6 +206,20 @@ void Foam::ReactingMultiphaseParcel::calc const label idL = td.cloud().composition().idLiquid(); const label idS = td.cloud().composition().idSolid(); + + // Calc surface values + // ~~~~~~~~~~~~~~~~~~~ + scalar Ts, rhos, mus, Pr, kappa; + ThermoParcel:: + calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa); + + // Reynolds number + scalar Re = this->Re(U0, d0, mus); + + + // Sources + //~~~~~~~~ + // Explicit momentum source for particle vector Su = vector::zero; @@ -219,6 +233,45 @@ void Foam::ReactingMultiphaseParcel::calc scalar dhsTrans = 0.0; + // Phase change in liquid phase + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + // Mass transfer due to phase change + scalarField dMassPC(YLiquid_.size(), 0.0); + + // Molar flux of species emitted from the particle (kmol/m^2/s) + scalar Ne = 0.0; + + // Sum Ni*Cpi*Wi of emission species + scalar NCpW = 0.0; + + // Surface concentrations of emitted species + scalarField Cs(td.cloud().mcCarrierThermo().species().size(), 0.0); + + // Calc mass and enthalpy transfer due to phase change + calcPhaseChange + ( + td, + dt, + cellI, + Re, + Ts, + mus/rhos, + d0, + T0, + mass0, + idL, + YMix[LIQ], + YLiquid_, + dMassPC, + Sh, + dhsTrans, + Ne, + NCpW, + Cs + ); + + // Devolatilisation // ~~~~~~~~~~~~~~~~ @@ -230,6 +283,8 @@ void Foam::ReactingMultiphaseParcel::calc ( td, dt, + Ts, + d0, T0, mass0, this->mass0_, @@ -239,9 +294,15 @@ void Foam::ReactingMultiphaseParcel::calc canCombust_, dMassDV, Sh, - dhsTrans + dhsTrans, + Ne, + NCpW, + Cs ); + // Correct surface values due to emitted species + correctSurfaceValues(td, cellI, Ts, Cs, rhos, mus, Pr, kappa); + // Surface reactions // ~~~~~~~~~~~~~~~~~ @@ -267,7 +328,7 @@ void Foam::ReactingMultiphaseParcel::calc T0, mass0, canCombust_, - dMassDV, // assuming d(mass) due to phase change is non-volatile + Ne, YMix, YGas_, YLiquid_, @@ -281,31 +342,6 @@ void Foam::ReactingMultiphaseParcel::calc ); - // Phase change in liquid phase - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - // Mass transfer due to phase change - scalarField dMassPC(YLiquid_.size(), 0.0); - - // Calc mass and enthalpy transfer due to phase change - calcPhaseChange - ( - td, - dt, - cellI, - d0, - T0, - U0, - mass0, - idL, - YMix[LIQ], - YLiquid_, - dMassPC, - Sh, - dhsTrans - ); - - // Update component mass fractions // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -322,14 +358,30 @@ void Foam::ReactingMultiphaseParcel::calc // Calculate new particle temperature scalar T1 = - calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans); + calcHeatTransfer + ( + td, + dt, + cellI, + Re, + Pr, + kappa, + d0, + rho0, + T0, + cp0, + NCpW, + Sh, + dhsTrans + ); // Motion // ~~~~~~ // Calculate new particle velocity - vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); + vector U1 = + calcVelocity(td, dt, cellI, Re, mus, d0, U0, rho0, mass0, Su, dUTrans); dUTrans += 0.5*(mass0 - mass1)*(U0 + U1); @@ -455,6 +507,8 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation ( TrackData& td, const scalar dt, + const scalar Ts, + const scalar d, const scalar T, const scalar mass, const scalar mass0, @@ -464,7 +518,10 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation bool& canCombust, scalarField& dMassDV, scalar& Sh, - scalar& dhsTrans + scalar& dhsTrans, + scalar& N, + scalar& NCpW, + scalarField& Cs ) const { // Check that model is active, and that the parcel temperature is @@ -496,6 +553,30 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation td.cloud().addToMassDevolatilisation(this->nParticle_*dMassTot); Sh -= dMassTot*td.constProps().LDevol()/dt; + + // Molar average molecular weight of carrier mix + const scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; + + // Update molar emissions + forAll(dMassDV, i) + { + // Note: hardcoded gaseous diffusivities for now + // TODO: add to carrier thermo + const scalar beta = sqr(cbrt(15.0) + cbrt(15.0)); + const label id = + td.cloud().composition().localToGlobalCarrierId(GAS, i); + const scalar Cp = td.cloud().mcCarrierThermo().speciesData()[id].Cp(Ts); + const scalar W = td.cloud().mcCarrierThermo().speciesData()[id].W(); + const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W); + + // Dab calc'd using API vapour mass diffusivity function + const scalar Dab = + 3.6059e-3*(pow(1.8*Ts, 1.75))*sqrt(1.0/W + 1.0/Wc)/(this->pc_*beta); + + N += Ni; + NCpW += Ni*Cp*W; + Cs[id] += Ni*d/(2.0*Dab); + } } @@ -510,7 +591,7 @@ void Foam::ReactingMultiphaseParcel::calcSurfaceReactions const scalar T, const scalar mass, const bool canCombust, - const scalarField& dMassVolatile, + const scalar N, const scalarField& YMix, const scalarField& YGas, const scalarField& YLiquid, @@ -544,7 +625,7 @@ void Foam::ReactingMultiphaseParcel::calcSurfaceReactions YLiquid, YSolid, YMix, - dMassVolatile, + N, dMassSRGas, dMassSRLiquid, dMassSRSolid, diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index e4e311ed90..fabe2f6136 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -227,6 +227,8 @@ protected: ( TrackData& td, const scalar dt, // timestep + const scalar Ts, // Surface temperature + const scalar d, // diameter const scalar T, // temperature const scalar mass, // mass const scalar mass0, // mass (initial on injection) @@ -236,7 +238,10 @@ protected: bool& canCombust, // 'can combust' flag scalarField& dMassDV, // mass transfer - local to particle scalar& Sh, // explicit particle enthalpy source - scalar& dhsTrans // sensible enthalpy transfer to carrier + scalar& dhsTrans, // sensible enthalpy transfer to carrier + scalar& N, // flux of species emitted from particle + scalar& NCpW, // sum of N*Cp*W of emission species + scalarField& Cs // carrier conc. of emission species ) const; //- Calculate surface reactions @@ -250,7 +255,7 @@ protected: const scalar T, // temperature const scalar mass, // mass const bool canCombust, // 'can combust' flag - const scalarField& dMassVolatile, // mass transfer of volatiles + const scalar N, // flux of species emitted from particle const scalarField& YMix, // mixture mass fractions const scalarField& YGas, // gas-phase mass fractions const scalarField& YLiquid,// liquid-phase mass fractions diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 3d534e39d4..fdc4d91a28 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -26,6 +26,9 @@ License #include "ReactingParcel.H" #include "mathConstants.H" +#include "specie.H" + +using namespace Foam::constant; // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // @@ -98,6 +101,92 @@ void Foam::ReactingParcel::cellValueSourceCorrection } +template +template +void Foam::ReactingParcel::correctSurfaceValues +( + TrackData& td, + const label cellI, + const scalar T, + const scalarField& Cs, + scalar& rhos, + scalar& mus, + scalar& Pr, + scalar& kappa +) +{ + // No correction if total concentration of emitted species is small + if (sum(Cs) < SMALL) + { + return; + } + + // Far field gas molar fractions + scalarField Xinf(Y_.size()); + + forAll(Xinf, i) + { + Xinf[i] = + td.cloud().mcCarrierThermo().Y(i)[cellI] + /td.cloud().mcCarrierThermo().speciesData()[i].W(); + } + Xinf /= sum(Xinf); + + // Molar fraction of far field species at particle surface + const scalar Xsff = 1.0 - min(sum(Cs)*specie::RR*this->T_/pc_, 1.0); + + // Surface gas total molar concentration + const scalar CsTot = pc_/(specie::RR*this->T_); + + // Surface carrier composition (molar fraction) + scalarField Xs(Xinf.size()); + + // Surface carrier composition (mass fraction) + scalarField Ys(Xinf.size()); + + forAll(Xs, i) + { + // Molar concentration of species at particle surface + const scalar Csi = Cs[i] + Xsff*Xinf[i]*CsTot; + + Xs[i] = (2.0*Csi + Xinf[i]*CsTot)/3.0; + Ys[i] = Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].W(); + } + Xs /= sum(Xs); + Ys /= sum(Ys); + + + rhos = 0; + mus = 0; + kappa = 0; + scalar cps = 0.0; + scalar sumYiSqrtW = 0; + scalar sumYiCbrtW = 0; + + forAll(Ys, i) + { + const scalar sqrtW = + sqrt(td.cloud().mcCarrierThermo().speciesData()[i].W()); + const scalar cbrtW = + cbrt(td.cloud().mcCarrierThermo().speciesData()[i].W()); + + rhos += Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].W(); + cps += Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].Cp(T); + mus += Ys[i]*sqrtW*td.cloud().mcCarrierThermo().speciesData()[i].mu(T); + kappa += + Ys[i]*cbrtW*td.cloud().mcCarrierThermo().speciesData()[i].kappa(T); + + sumYiSqrtW += Ys[i]*sqrtW; + sumYiCbrtW += Ys[i]*cbrtW; + } + + rhos *= pc_/(specie::RR*T); + mus /= sumYiSqrtW; + kappa /= sumYiCbrtW; + Pr = cps*mus/kappa; +} + + template Foam::scalar Foam::ReactingParcel::updateMassFraction ( @@ -140,6 +229,20 @@ void Foam::ReactingParcel::calc const scalar cp0 = this->cp_; const scalar mass0 = this->mass(); + + // Calc surface values + // ~~~~~~~~~~~~~~~~~~~ + scalar Ts, rhos, mus, Pr, kappa; + ThermoParcel:: + calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa); + + // Reynolds number + scalar Re = this->Re(U0, d0, mus); + + + // Sources + //~~~~~~~~ + // Explicit momentum source for particle vector Su = vector::zero; @@ -159,24 +262,41 @@ void Foam::ReactingParcel::calc // Mass transfer due to phase change scalarField dMassPC(Y_.size(), 0.0); + // Molar flux of species emitted from the particle (kmol/m^2/s) + scalar Ne = 0.0; + + // Sum Ni*Cpi*Wi of emission species + scalar NCpW = 0.0; + + // Surface concentrations of emitted species + scalarField Cs(td.cloud().mcCarrierThermo().species().size(), 0.0); + // Calc mass and enthalpy transfer due to phase change calcPhaseChange ( td, dt, cellI, + Ts, + mus/rhos, + Re, d0, T0, - U0, mass0, 0, 1.0, Y_, dMassPC, Sh, - dhsTrans + dhsTrans, + Ne, + NCpW, + Cs ); + // Correct surface values due to emitted species + correctSurfaceValues(td, cellI, Ts, Cs, rhos, mus, Pr, kappa); + // Update particle component mass and mass fractions scalar mass1 = updateMassFraction(mass0, dMassPC, Y_); @@ -186,14 +306,30 @@ void Foam::ReactingParcel::calc // Calculate new particle temperature scalar T1 = - calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans); + calcHeatTransfer + ( + td, + dt, + cellI, + Re, + Pr, + kappa, + d0, + rho0, + T0, + cp0, + NCpW, + Sh, + dhsTrans + ); // Motion // ~~~~~~ // Calculate new particle velocity - vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); + vector U1 = + calcVelocity(td, dt, cellI, Re, mus, d0, U0, rho0, mass0, Su, dUTrans); dUTrans += 0.5*(mass0 - mass1)*(U0 + U1); @@ -258,7 +394,7 @@ void Foam::ReactingParcel::calc } else { - this->d_ = cbrt(mass1/this->rho_*6.0/constant::math::pi); + this->d_ = cbrt(mass1/this->rho_*6.0/math::pi); } } } @@ -271,16 +407,21 @@ void Foam::ReactingParcel::calcPhaseChange TrackData& td, const scalar dt, const label cellI, + const scalar Re, + const scalar Ts, + const scalar nus, const scalar d, const scalar T, - const vector& U, const scalar mass, const label idPhase, const scalar YPhase, const scalarField& YComponents, scalarField& dMassPC, scalar& Sh, - scalar& dhsTrans + scalar& dhsTrans, + scalar& N, + scalar& NCpW, + scalarField& Cs ) { if @@ -298,12 +439,12 @@ void Foam::ReactingParcel::calcPhaseChange ( dt, cellI, + Re, d, - min(T, td.constProps().Tbp()), // Limit to boiling temperature + nus, + T, + Ts, pc_, - this->Tc_, - this->muc_/(this->rhoc_ + ROOTVSMALL), - U - this->Uc_, dMassPC ); @@ -315,18 +456,38 @@ void Foam::ReactingParcel::calcPhaseChange // Add to cumulative phase change mass td.cloud().addToMassPhaseChange(this->nParticle_*dMassTot); - // Enthalphy transfer to carrier phase - label id; + // Average molecular weight of carrier mix - assumes perfect gas + scalar Wc = this->rhoc_*specie::RR*this->Tc_/this->pc_; + forAll(YComponents, i) { - id = td.cloud().composition().localToGlobalCarrierId(idPhase, i); - const scalar hv = td.cloud().mcCarrierThermo().speciesData()[id].H(T); + const label idc = + td.cloud().composition().localToGlobalCarrierId(idPhase, i); + const scalar hv = td.cloud().mcCarrierThermo().speciesData()[idc].H(T); - id = td.cloud().composition().globalIds(idPhase)[i]; + const label idl = td.cloud().composition().globalIds(idPhase)[i]; const scalar hl = - td.cloud().composition().liquids().properties()[id].h(pc_, T); + td.cloud().composition().liquids().properties()[idl].h(pc_, T); + // Enthalphy transfer to carrier phase Sh += dMassPC[i]*(hl - hv)/dt; + + const scalar Dab = + td.cloud().composition().liquids().properties()[idl].D(pc_, Ts, Wc); + + const scalar Cp = + td.cloud().mcCarrierThermo().speciesData()[idc].Cp(Ts); + const scalar W = td.cloud().mcCarrierThermo().speciesData()[idc].W(); + const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W); + + // Molar flux of species coming from the particle (kmol/m^2/s) + N += Ni; + + // Sum of Ni*Cpi*Wi of emission species + NCpW += Ni*Cp*W; + + // Concentrations of emission species + Cs[idc] += Ni*d/(2.0*Dab); } } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H index f17cd21171..c3910a46ab 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -195,16 +195,21 @@ protected: TrackData& td, const scalar dt, // timestep const label cellI, // owner cell + const scalar Re, // Reynolds number + const scalar Ts, // Surface temperature + const scalar nus, // Surface kinematic viscosity const scalar d, // diameter const scalar T, // temperature - const vector& U, // velocity const scalar mass, // mass const label idPhase, // id of phase involved in phase change const scalar YPhase, // total mass fraction const scalarField& YComponents, // component mass fractions scalarField& dMassPC, // mass transfer - local to particle scalar& Sh, // explicit particle enthalpy source - scalar& dhsTrans // sensible enthalpy transfer to carrier + scalar& dhsTrans, // sensible enthalpy transfer to carrier + scalar& N, // flux of species emitted from particle + scalar& NCpW, // sum of N*Cp*W of emission species + scalarField& Cs // carrier conc. of emission species ); //- Update mass fraction @@ -316,6 +321,20 @@ public: const label cellI ); + //- Correct surface values due to emitted species + template + void correctSurfaceValues + ( + TrackData& td, + const label cellI, + const scalar T, + const scalarField& Cs, + scalar& rhos, + scalar& mus, + scalar& Pr, + scalar& kappa + ); + //- Update parcel properties over the time interval template void calc diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 8bd9a3a126..94b71f7d1a 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -27,6 +27,8 @@ License #include "ThermoParcel.H" #include "physicoChemicalConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // template @@ -78,6 +80,33 @@ void Foam::ThermoParcel::cellValueSourceCorrection } +template +template +void Foam::ThermoParcel::calcSurfaceValues +( + TrackData& td, + const label cellI, + const scalar T, + scalar& Ts, + scalar& rhos, + scalar& mus, + scalar& Pr, + scalar& kappa +) const +{ + // Surface temperature using two thirds rule + Ts = (2.0*T + Tc_)/3.0; + + // Assuming thermo props vary linearly with T for small dT + scalar factor = td.TInterp().interpolate(this->position(), cellI)/Ts; + rhos = this->rhoc_*factor; + mus = td.muInterp().interpolate(this->position(), cellI)/factor; + + Pr = td.constProps().Pr(); + kappa = cpc_*mus/Pr; +} + + template template void Foam::ThermoParcel::calc @@ -97,6 +126,19 @@ void Foam::ThermoParcel::calc const scalar cp0 = this->cp_; const scalar mass0 = this->mass(); + + // Calc surface values + // ~~~~~~~~~~~~~~~~~~~ + scalar Ts, rhos, mus, Pr, kappa; + calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa); + + // Reynolds number + scalar Re = this->Re(U0, d0, mus); + + + // Sources + // ~~~~~~~ + // Explicit momentum source for particle vector Su = vector::zero; @@ -109,19 +151,39 @@ void Foam::ThermoParcel::calc // Sensible enthalpy transfer from the particle to the carrier phase scalar dhsTrans = 0.0; + // Heat transfer // ~~~~~~~~~~~~~ + // Sum Ni*Cpi*Wi of emission species + scalar NCpW = 0.0; + // Calculate new particle velocity scalar T1 = - calcHeatTransfer(td, dt, cellI, d0, U0, rho0, T0, cp0, Sh, dhsTrans); + calcHeatTransfer + ( + td, + dt, + cellI, + Re, + Pr, + kappa, + d0, + rho0, + T0, + cp0, + NCpW, + Sh, + dhsTrans + ); // Motion // ~~~~~~ // Calculate new particle velocity - vector U1 = calcVelocity(td, dt, cellI, d0, U0, rho0, mass0, Su, dUTrans); + vector U1 = + calcVelocity(td, dt, cellI, Re, mus, d0, U0, rho0, mass0, Su, dUTrans); // Accumulate carrier phase source terms @@ -149,11 +211,14 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer TrackData& td, const scalar dt, const label cellI, + const scalar Re, + const scalar Pr, + const scalar kappa, const scalar d, - const vector& U, const scalar rho, const scalar T, const scalar cp, + const scalar NCpW, const scalar Sh, scalar& dhsTrans ) @@ -164,16 +229,7 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer } // Calc heat transfer coefficient - scalar htc = td.cloud().heatTransfer().h - ( - d, - U - this->Uc_, - this->rhoc_, - rho, - cpc_, - cp, - this->muc_ - ); + scalar htc = td.cloud().heatTransfer().htc(d, Re, Pr, kappa, NCpW); const scalar As = this->areaS(d); @@ -189,7 +245,7 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer { const scalarField& G = td.cloud().mesh().objectRegistry::lookupObject("G"); - const scalar sigma = constant::physicoChemical::sigma.value(); + const scalar sigma = physicoChemical::sigma.value(); const scalar epsilon = td.constProps().epsilon0(); ap = diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H index c11fecd11d..f0e728bc1f 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.H @@ -97,6 +97,9 @@ public: //- Particle scattering factor [] (radiation) const scalar f0_; + //- Default carrier Prandtl number [] + const scalar Pr_; + public: @@ -124,6 +127,9 @@ public: //- Return const access to the particle scattering factor [] // Active for radiation only inline scalar f0() const; + + //- Return const access to the default carrier Prandtl number [] + inline scalar Pr() const; }; @@ -217,11 +223,14 @@ protected: TrackData& td, const scalar dt, // timestep const label cellI, // owner cell + const scalar Re, // Reynolds number + const scalar Pr, // Prandtl number - surface + const scalar kappa, // Thermal conductivity - surface const scalar d, // diameter - const vector& U, // velocity const scalar rho, // density const scalar T, // temperature const scalar cp, // specific heat capacity + const scalar NCpW, // Sum of N*Cp*W of emission species const scalar Sh, // explicit particle enthalpy source scalar& dhsTrans // sensible enthalpy transfer to carrier ); @@ -323,6 +332,20 @@ public: const label cellI ); + //- Calculate surface thermo properties + template + void calcSurfaceValues + ( + TrackData& td, + const label cellI, + const scalar T, + scalar& Ts, + scalar& rhos, + scalar& mus, + scalar& Pr, + scalar& kappa + ) const; + //- Update parcel properties over the time interval template void calc diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H index 8ce0cb5691..284c46eb42 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcelI.H @@ -37,7 +37,8 @@ inline Foam::ThermoParcel::constantProperties::constantProperties TMin_(dimensionedScalar(this->dict().lookup("TMin")).value()), cp0_(dimensionedScalar(this->dict().lookup("cp0")).value()), epsilon0_(dimensionedScalar(this->dict().lookup("epsilon0")).value()), - f0_(dimensionedScalar(this->dict().lookup("f0")).value()) + f0_(dimensionedScalar(this->dict().lookup("f0")).value()), + Pr_(dimensionedScalar(this->dict().lookup("Pr")).value()) {} @@ -159,6 +160,14 @@ Foam::ThermoParcel::constantProperties::f0() const } +template +inline Foam::scalar +Foam::ThermoParcel::constantProperties::Pr() const +{ + return Pr_; +} + + // * * * * * * * * * * * trackData Member Functions * * * * * * * * * * * * // template diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H index a2ce194202..b55cdebd96 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H @@ -33,6 +33,7 @@ License #include "NoHeatTransfer.H" #include "RanzMarshall.H" +#include "RanzMarshallBirdCorrection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,6 +53,12 @@ License ThermoCloud, \ ParcelType \ ); \ + makeHeatTransferModelType \ + ( \ + RanzMarshallBirdCorrection, \ + ThermoCloud, \ + ParcelType \ + ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H index 0bfe7af9a8..e26f99e25c 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H @@ -34,6 +34,7 @@ License #include "NoHeatTransfer.H" #include "RanzMarshall.H" +#include "RanzMarshallBirdCorrection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,6 +75,13 @@ License ParcelType, \ ThermoType \ ); \ + makeHeatTransferModelThermoType \ + ( \ + RanzMarshallBirdCorrection, \ + ThermoCloud, \ + ParcelType, \ + ThermoType \ + ); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C index ae4e2a2062..8fd449e756 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.C @@ -66,19 +66,14 @@ const Foam::dictionary& Foam::DragModel::dict() const template Foam::scalar Foam::DragModel::utc ( - const vector& Ur, + const scalar Re, const scalar d, - const scalar rhoc, const scalar mu ) const { - const scalar magUr = mag(Ur); - - const scalar Re = rhoc*magUr*d/(mu + ROOTVSMALL); - const scalar Cd = this->Cd(Re); - return Cd*rhoc*magUr/8.0; + return Cd*Re/d*mu/8.0; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H index 4b4d6c4dd8..e0c60b526e 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H @@ -122,13 +122,7 @@ public: //- Return momentum transfer coefficient // Drag force per unit particle surface area = utc(U - Up) - scalar utc - ( - const vector& Ur, - const scalar d, - const scalar rhoc, - const scalar mu - ) const; + scalar utc(const scalar Re, const scalar d, const scalar mu) const; }; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index 324e4f80bc..ae1ee89074 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -38,15 +38,14 @@ Foam::scalarField Foam::LiquidEvaporation::calcXc { scalarField Xc(this->owner().mcCarrierThermo().Y().size()); - scalar Winv = 0.0; forAll(Xc, i) { - scalar Y = this->owner().mcCarrierThermo().Y()[i][cellI]; - Winv += Y/this->owner().mcCarrierThermo().speciesData()[i].W(); - Xc[i] = Y/this->owner().mcCarrierThermo().speciesData()[i].W(); + Xc[i] = + this->owner().mcCarrierThermo().Y()[i][cellI] + /this->owner().mcCarrierThermo().speciesData()[i].W(); } - return Xc/Winv; + return Xc/sum(Xc); } @@ -136,12 +135,12 @@ void Foam::LiquidEvaporation::calculate ( const scalar dt, const label cellI, + const scalar Re, const scalar d, + const scalar nu, const scalar T, + const scalar Ts, const scalar pc, - const scalar Tc, - const scalar nuc, - const vector& Ur, scalarField& dMassPC ) const { @@ -151,29 +150,25 @@ void Foam::LiquidEvaporation::calculate // droplet surface area scalar A = constant::math::pi*sqr(d); - // Reynolds number - scalar Re = mag(Ur)*d/(nuc + ROOTVSMALL); - - // film temperature evaluated using the 2/3 rule - scalar Tf = (2.0*T + Tc)/3.0; - // calculate mass transfer of each specie in liquid forAll(activeLiquids_, i) { label gid = liqToCarrierMap_[i]; label lid = liqToLiqMap_[i]; - // vapour diffusivity at film temperature and cell pressure [m2/s] - scalar Dab = liquids_->properties()[lid].D(pc, Tf); + // vapour diffusivity [m2/s] + scalar Dab = liquids_->properties()[lid].D(pc, Ts); - // saturation pressure for species i at film temperature and cell - // pressure [pa] - carrier phase pressure assumed equal to the liquid - // vapour pressure close to the surface - // - limited to pc if pSat > pc - scalar pSat = min(liquids_->properties()[lid].pv(pc, Tf), pc); + // Saturation pressure for species i [pa] + // - carrier phase pressure assumed equal to the liquid vapour pressure + // close to the surface + // NOTE: if pSat > pc then particle is superheated + // calculated evaporation rate will be greater than that of a particle + // at boiling point, but this is not a boiling model + scalar pSat = liquids_->properties()[lid].pv(pc, T); // Schmidt number - scalar Sc = nuc/(Dab + ROOTVSMALL); + scalar Sc = nu/(Dab + ROOTVSMALL); // Sherwood number scalar Sh = this->Sh(Re, Sc); @@ -181,11 +176,11 @@ void Foam::LiquidEvaporation::calculate // mass transfer coefficient [m/s] scalar kc = Sh*Dab/(d + ROOTVSMALL); - // vapour concentration at droplet surface at film temperature [kmol/m3] - scalar Cs = pSat/(specie::RR*Tf); + // vapour concentration at droplet surface [kmol/m3] at film temperature + scalar Cs = pSat/(specie::RR*Ts); - // vapour concentration in bulk gas at film temperature [kmol/m3] - scalar Cinf = Xc[gid]*pc/(specie::RR*Tf); + // vapour concentration in bulk gas [kmol/m3] at film temperature + scalar Cinf = Xc[gid]*pc/(specie::RR*Ts); // molar flux of vapour [kmol/m2/s] scalar Ni = max(kc*(Cs - Cinf), 0.0); diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H index 6f0bf06c4b..2426f374c8 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H @@ -106,12 +106,12 @@ public: ( const scalar dt, const label cellI, + const scalar Re, const scalar d, + const scalar nu, const scalar T, + const scalar Ts, const scalar pc, - const scalar Tc, - const scalar nuc, - const vector& Ur, scalarField& dMassPC ) const; }; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.C index 32a0c449ea..f6b51d6b9a 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.C @@ -65,7 +65,7 @@ void Foam::NoPhaseChange::calculate const scalar, const scalar, const scalar, - const vector&, + const scalar, scalarField& ) const { diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.H index 3b6effa402..95fb6201ae 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/NoPhaseChange/NoPhaseChange.H @@ -74,12 +74,12 @@ public: ( const scalar dt, const label cellI, + const scalar Re, const scalar d, + const scalar nu, const scalar T, + const scalar Ts, const scalar pc, - const scalar Tc, - const scalar nuc, - const vector& Ur, scalarField& dMassPC ) const; }; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H index 7445ea6264..e19856a064 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H @@ -140,12 +140,12 @@ public: ( const scalar dt, const label cellI, + const scalar Re, const scalar d, + const scalar nu, const scalar T, + const scalar Ts, const scalar pc, - const scalar Tc, - const scalar nuc, - const vector& Ur, scalarField& dMassPC ) const = 0; }; diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/NoSurfaceReaction/NoSurfaceReaction.C b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/NoSurfaceReaction/NoSurfaceReaction.C index 53eecf01f9..c6fb74f00d 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/NoSurfaceReaction/NoSurfaceReaction.C +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/NoSurfaceReaction/NoSurfaceReaction.C @@ -70,7 +70,7 @@ Foam::scalar Foam::NoSurfaceReaction::calculate const scalarField&, const scalarField&, const scalarField&, - const scalarField&, + const scalar, scalarField&, scalarField&, scalarField&, diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/NoSurfaceReaction/NoSurfaceReaction.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/NoSurfaceReaction/NoSurfaceReaction.H index d3c99ebd5d..da002eaf1f 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/NoSurfaceReaction/NoSurfaceReaction.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/NoSurfaceReaction/NoSurfaceReaction.H @@ -88,7 +88,7 @@ public: const scalarField& YLiquid, const scalarField& YSolid, const scalarField& YMixture, - const scalarField& dMassVolatile, + const scalar N, scalarField& dMassGas, scalarField& dMassLiquid, scalarField& dMassSolid, diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H index f876563fec..f22cc2acac 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H @@ -146,7 +146,7 @@ public: const scalarField& YLiquid, const scalarField& YSolid, const scalarField& YMixture, - const scalarField& dMassVolatile, + const scalar N, scalarField& dMassGas, scalarField& dMassLiquid, scalarField& dMassSolid, diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C index 37b5276269..3db839ea15 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C @@ -82,57 +82,21 @@ const Foam::dictionary& Foam::HeatTransferModel::coeffDict() const template -Foam::scalar Foam::HeatTransferModel::h +Foam::scalar Foam::HeatTransferModel::htc ( const scalar dp, - const vector& Ur, - const scalar rhoc, - const scalar rhop, - const scalar cpc, - const scalar cpp, - const scalar muc + const scalar Re, + const scalar Pr, + const scalar kappa, + const scalar NCpW ) const { - const scalar Re = rhoc*mag(Ur)*dp/(muc + ROOTVSMALL); - -// const scalar Pr = muc/alphac; - const scalar Pr = this->Pr(); - const scalar Nu = this->Nu(Re, Pr); - const scalar kappa = cpc*muc/Pr; - return Nu*kappa/dp; } -template -Foam::scalar Foam::HeatTransferModel::Cu -( - const scalar dp, - const vector& Ur, - const scalar rhoc, - const scalar rhop, - const scalar cpc, - const scalar cpp, - const scalar muc -) const -{ - const scalar Re = rhoc*mag(Ur)*dp/(muc + ROOTVSMALL); - -// const scalar Pr = muc/alphac; - const scalar Pr = this->Pr(); - - const scalar Nu = this->Nu(Re, Pr); - - const scalar kappa = cpc*muc/Pr; - - const scalar htc = Nu*kappa/dp; - - return 6.0*htc/(dp*rhop*cpp); -} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "NewHeatTransferModel.C" diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H index baf61f2395..44cf7c3928 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H @@ -138,27 +138,13 @@ public: virtual scalar Pr() const = 0; //- Return heat transfer coefficient - virtual scalar h + virtual scalar htc ( const scalar dp, - const vector& Ur, - const scalar rhoc, - const scalar rhop, - const scalar cpc, - const scalar cpp, - const scalar muc - ) const; - - //- Return linearised coefficient for temperature equation - virtual scalar Cu - ( - const scalar dp, - const vector& Ur, - const scalar rhoc, - const scalar rhop, - const scalar cpc, - const scalar cpp, - const scalar muc + const scalar Re, + const scalar Pr, + const scalar kappa, + const scalar NCpW ) const; }; diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.C new file mode 100644 index 0000000000..9ea771fcc1 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.C @@ -0,0 +1,79 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "RanzMarshallBirdCorrection.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::RanzMarshallBirdCorrection::RanzMarshallBirdCorrection +( + const dictionary& dict, + CloudType& cloud +) +: + RanzMarshall(dict, cloud) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::RanzMarshallBirdCorrection::~RanzMarshallBirdCorrection() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +Foam::scalar Foam::RanzMarshallBirdCorrection::htc +( + const scalar dp, + const scalar Re, + const scalar Pr, + const scalar kappa, + const scalar NCpW +) const +{ + scalar htc = RanzMarshall::htc(dp, Re, Pr, kappa, NCpW); + + // Bird correction + if (mag(htc) > ROOTVSMALL && mag(NCpW) > ROOTVSMALL) + { + const scalar phit = min(NCpW/htc, 50); + scalar fBird = 1.0; + if (phit > 0.001) + { + fBird = phit/(exp(phit) - 1.0); + } + htc *= fBird; + } + + return htc; +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.H new file mode 100644 index 0000000000..e8efca9f58 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.H @@ -0,0 +1,101 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2 of the License, or (at your + option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM; if not, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::RanzMarshallBirdCorrection + +Description + The Ranz-Marshall correlation for heat transfer with the Bird correction + to account for the local shielding effect due to emitted species. + +\*---------------------------------------------------------------------------*/ + +#ifndef RanzMarshallBirdCorrection_H +#define RanzMarshallBirdCorrection_H + +#include "RanzMarshall.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class RanzMarshallBirdCorrection Declaration +\*---------------------------------------------------------------------------*/ + +template +class RanzMarshallBirdCorrection +: + public RanzMarshall +{ + +public: + + //- Runtime type information + TypeName("RanzMarshallBirdCorrection"); + + + // Constructors + + //- Construct from dictionary + RanzMarshallBirdCorrection + ( + const dictionary& dict, + CloudType& cloud + ); + + + //- Destructor + virtual ~RanzMarshallBirdCorrection(); + + + // Member Functions + + //- Return heat transfer coefficient + virtual scalar htc + ( + const scalar dp, + const scalar Re, + const scalar Pr, + const scalar kappa, + const scalar NCpW + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "RanzMarshallBirdCorrection.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 49295210c948be7e26135190f3e9fccb60542109 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 1 Sep 2009 19:40:32 +0100 Subject: [PATCH 03/12] tutorial updates --- .../simplifiedSiwek/constant/coalCloud1Properties | 3 ++- .../simplifiedSiwek/constant/limestoneCloud1Properties | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties index 70f65bbf25..05909b3b58 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties @@ -23,7 +23,7 @@ DispersionModel StochasticDispersionRAS; PatchInteractionModel StandardWallInteraction; -HeatTransferModel RanzMarshall; +HeatTransferModel RanzMarshallBirdCorrection; CompositionModel SingleMixtureFraction; @@ -54,6 +54,7 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 4187; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; + Pr Pr [ 0 0 0 0 0 ] 1.0; Tvap Tvap [ 0 0 0 1 0 ] 400; Tbp Tvap [ 0 0 0 1 0 ] 400; LDevol LDevol [ 0 0 0 0 0 ] 0; diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index ed6ff6f985..41d8fe294d 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -45,6 +45,7 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 900; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; + Pr Pr [ 0 0 0 0 0 ] 1.0; } interpolationSchemes From 91675bd6165ac553a641941c9964d5ece8af4f28 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 2 Sep 2009 10:29:43 +0100 Subject: [PATCH 04/12] change in direction on Bird correction - using flag in base model instead... --- .../include/makeParcelHeatTransferModels.H | 7 -- .../makeReactingParcelHeatTransferModels.H | 8 -- .../HeatTransferModel/HeatTransferModel.C | 26 ++++- .../HeatTransferModel/HeatTransferModel.H | 15 ++- .../RanzMarshall/RanzMarshall.C | 12 +-- .../RanzMarshall/RanzMarshall.H | 32 +++--- .../RanzMarshallBirdCorrection.C | 79 -------------- .../RanzMarshallBirdCorrection.H | 101 ------------------ .../constant/coalCloud1Properties | 6 +- .../constant/limestoneCloud1Properties | 4 +- .../filter/constant/reactingCloud1Properties | 3 +- .../constant/reactingCloud1Properties | 3 +- .../constant/thermoCloud1Properties | 3 +- 13 files changed, 62 insertions(+), 237 deletions(-) delete mode 100644 src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.C delete mode 100644 src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.H diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H index b55cdebd96..3206b1616d 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelHeatTransferModels.H @@ -33,7 +33,6 @@ License #include "NoHeatTransfer.H" #include "RanzMarshall.H" -#include "RanzMarshallBirdCorrection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -52,12 +51,6 @@ License RanzMarshall, \ ThermoCloud, \ ParcelType \ - ); \ - makeHeatTransferModelType \ - ( \ - RanzMarshallBirdCorrection, \ - ThermoCloud, \ - ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H index e26f99e25c..25843df08e 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H @@ -34,7 +34,6 @@ License #include "NoHeatTransfer.H" #include "RanzMarshall.H" -#include "RanzMarshallBirdCorrection.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,13 +73,6 @@ License ThermoCloud, \ ParcelType, \ ThermoType \ - ); \ - makeHeatTransferModelThermoType \ - ( \ - RanzMarshallBirdCorrection, \ - ThermoCloud, \ - ParcelType, \ - ThermoType \ ); diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C index 3db839ea15..45e58352b7 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.C @@ -33,7 +33,8 @@ Foam::HeatTransferModel::HeatTransferModel(CloudType& owner) : dict_(dictionary::null), owner_(owner), - coeffDict_(dictionary::null) + coeffDict_(dictionary::null), + BirdCorrection_(false) {} @@ -47,7 +48,8 @@ Foam::HeatTransferModel::HeatTransferModel : dict_(dict), owner_(owner), - coeffDict_(dict.subDict(type + "Coeffs")) + coeffDict_(dict.subDict(type + "Coeffs")), + BirdCorrection_(coeffDict_.lookup("BirdCorrection")) {} @@ -81,6 +83,13 @@ const Foam::dictionary& Foam::HeatTransferModel::coeffDict() const } +template +const Foam::Switch& Foam::HeatTransferModel::BirdCorrection() const +{ + return BirdCorrection_; +} + + template Foam::scalar Foam::HeatTransferModel::htc ( @@ -93,7 +102,18 @@ Foam::scalar Foam::HeatTransferModel::htc { const scalar Nu = this->Nu(Re, Pr); - return Nu*kappa/dp; + scalar htc = Nu*kappa/dp; + + if (BirdCorrection_ && (mag(htc) > ROOTVSMALL) && (mag(NCpW) > ROOTVSMALL)) + { + const scalar phit = min(NCpW/htc, 50); + if (phit > 0.001) + { + htc *= phit/(exp(phit) - 1.0); + } + } + + return htc; } diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H index 44cf7c3928..1f9015800c 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H @@ -64,6 +64,9 @@ class HeatTransferModel //- The coefficients dictionary const dictionary coeffDict_; + //- Apply Bird's correction to the htc + const Switch BirdCorrection_; + public: @@ -110,6 +113,8 @@ public: ); + // Member Functions + // Access //- Return the cloud dictionary @@ -121,12 +126,15 @@ public: //- Return the owner cloud object const CloudType& owner() const; - - // Member Functions + //- Return the Bird htc correction flag + const Switch& BirdCorrection() const; //- Flag to indicate whether model activates heat transfer model virtual bool active() const = 0; + + // Evaluation + //- Nusselt number virtual scalar Nu ( @@ -134,9 +142,6 @@ public: const scalar Pr ) const = 0; - //- Prandtl number - virtual scalar Pr() const = 0; - //- Return heat transfer coefficient virtual scalar htc ( diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.C index 8e9b6e9379..5555bb942a 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.C +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.C @@ -35,8 +35,7 @@ Foam::RanzMarshall::RanzMarshall CloudType& cloud ) : - HeatTransferModel(dict, cloud, typeName), - Pr_(dimensionedScalar(this->coeffDict().lookup("Pr")).value()) + HeatTransferModel(dict, cloud, typeName) {} @@ -63,14 +62,7 @@ Foam::scalar Foam::RanzMarshall::Nu const scalar Pr ) const { - return 2.0 + 0.6*pow(Re, 0.5)*pow(Pr, 0.333); -} - - -template -Foam::scalar Foam::RanzMarshall::Pr() const -{ - return Pr_; + return 2.0 + 0.6*sqrt(Re)*cbrt(Pr); } diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.H index f010160c1f..e30c51cef4 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshall/RanzMarshall.H @@ -40,7 +40,7 @@ Description namespace Foam { /*---------------------------------------------------------------------------*\ - Class RanzMarshall Declaration + Class RanzMarshall Declaration \*---------------------------------------------------------------------------*/ template @@ -48,11 +48,6 @@ class RanzMarshall : public HeatTransferModel { - // Private data - - // Prandtl number - const scalar Pr_; - public: @@ -76,18 +71,23 @@ public: // Member Functions - //- Flag to indicate whether model activates heat transfer model - virtual bool active() const; + // Access - //- Nusselt number - virtual scalar Nu - ( - const scalar Re, - const scalar Pr - ) const; + //- Flag to indicate whether model activates heat transfer model + virtual bool active() const; - //- Prandtl number - virtual scalar Pr() const; + //- Return the Bird correction flag + const Switch& BirdCorrection() const; + + + // Evaluation + + //- Nusselt number + virtual scalar Nu + ( + const scalar Re, + const scalar Pr + ) const; }; diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.C b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.C deleted file mode 100644 index 9ea771fcc1..0000000000 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.C +++ /dev/null @@ -1,79 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -\*---------------------------------------------------------------------------*/ - -#include "RanzMarshallBirdCorrection.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template -Foam::RanzMarshallBirdCorrection::RanzMarshallBirdCorrection -( - const dictionary& dict, - CloudType& cloud -) -: - RanzMarshall(dict, cloud) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -Foam::RanzMarshallBirdCorrection::~RanzMarshallBirdCorrection() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -Foam::scalar Foam::RanzMarshallBirdCorrection::htc -( - const scalar dp, - const scalar Re, - const scalar Pr, - const scalar kappa, - const scalar NCpW -) const -{ - scalar htc = RanzMarshall::htc(dp, Re, Pr, kappa, NCpW); - - // Bird correction - if (mag(htc) > ROOTVSMALL && mag(NCpW) > ROOTVSMALL) - { - const scalar phit = min(NCpW/htc, 50); - scalar fBird = 1.0; - if (phit > 0.001) - { - fBird = phit/(exp(phit) - 1.0); - } - htc *= fBird; - } - - return htc; -} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.H deleted file mode 100644 index e8efca9f58..0000000000 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/RanzMarshallBirdCorrection/RanzMarshallBirdCorrection.H +++ /dev/null @@ -1,101 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd. - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2 of the License, or (at your - option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM; if not, write to the Free Software Foundation, - Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -Class - Foam::RanzMarshallBirdCorrection - -Description - The Ranz-Marshall correlation for heat transfer with the Bird correction - to account for the local shielding effect due to emitted species. - -\*---------------------------------------------------------------------------*/ - -#ifndef RanzMarshallBirdCorrection_H -#define RanzMarshallBirdCorrection_H - -#include "RanzMarshall.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -/*---------------------------------------------------------------------------*\ - Class RanzMarshallBirdCorrection Declaration -\*---------------------------------------------------------------------------*/ - -template -class RanzMarshallBirdCorrection -: - public RanzMarshall -{ - -public: - - //- Runtime type information - TypeName("RanzMarshallBirdCorrection"); - - - // Constructors - - //- Construct from dictionary - RanzMarshallBirdCorrection - ( - const dictionary& dict, - CloudType& cloud - ); - - - //- Destructor - virtual ~RanzMarshallBirdCorrection(); - - - // Member Functions - - //- Return heat transfer coefficient - virtual scalar htc - ( - const scalar dp, - const scalar Re, - const scalar Pr, - const scalar kappa, - const scalar NCpW - ) const; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "RanzMarshallBirdCorrection.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties index 05909b3b58..f270546201 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/coalCloud1Properties @@ -23,7 +23,7 @@ DispersionModel StochasticDispersionRAS; PatchInteractionModel StandardWallInteraction; -HeatTransferModel RanzMarshallBirdCorrection; +HeatTransferModel RanzMarshall; CompositionModel SingleMixtureFraction; @@ -54,7 +54,7 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 4187; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; - Pr Pr [ 0 0 0 0 0 ] 1.0; + Pr Pr [ 0 0 0 0 0 ] 0.7; Tvap Tvap [ 0 0 0 1 0 ] 400; Tbp Tvap [ 0 0 0 1 0 ] 400; LDevol LDevol [ 0 0 0 0 0 ] 0; @@ -113,7 +113,7 @@ StandardWallInteractionCoeffs RanzMarshallCoeffs { - Pr Pr [ 0 0 0 0 0 ] 0.7; + BirdCorrection true; } SingleMixtureFractionCoeffs diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties index 41d8fe294d..a17be1e36f 100644 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/limestoneCloud1Properties @@ -45,7 +45,7 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 900; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; - Pr Pr [ 0 0 0 0 0 ] 1.0; + Pr Pr [ 0 0 0 0 0 ] 0.7; } interpolationSchemes @@ -98,7 +98,7 @@ StandardWallInteractionCoeffs RanzMarshallCoeffs { - Pr Pr [ 0 0 0 0 0 ] 0.7; + BirdCorrection false; } diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties index 434f87c8c1..5c99dbf554 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/reactingCloud1Properties @@ -50,6 +50,7 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 4100; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; + Pr Pr [ 0 0 0 0 0 ] 0.7; Tvap Tvap [ 0 0 0 1 0 ] 273; Tbp Tvap [ 0 0 0 1 0 ] 373; constantVolume false; @@ -132,7 +133,7 @@ LocalInteractionCoeffs RanzMarshallCoeffs { - Pr Pr [ 0 0 0 0 0 ] 0.7; + BirdCorrection true; } SinglePhaseMixtureCoeffs diff --git a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties index 9e5ec5ff8d..95f4df9ceb 100644 --- a/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties +++ b/tutorials/lagrangian/reactingParcelFoam/evaporationTest/constant/reactingCloud1Properties @@ -50,6 +50,7 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 4187; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; + Pr Pr [ 0 0 0 0 0 ] 0.7; Tvap Tvap [ 0 0 0 1 0 ] 273; Tbp Tvap [ 0 0 0 1 0 ] 373; constantVolume false; @@ -104,7 +105,7 @@ StandardWallInteractionCoeffs RanzMarshallCoeffs { - Pr Pr [ 0 0 0 0 0 ] 0.7; + BirdCorrection true; } SinglePhaseMixtureCoeffs diff --git a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties index 4fb16f370e..67823f6aab 100644 --- a/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties +++ b/tutorials/lagrangian/rhoPisoTwinParcelFoam/simplifiedSiwek/constant/thermoCloud1Properties @@ -45,6 +45,7 @@ constantProperties cp0 cp0 [ 0 2 -2 -1 0 ] 900; epsilon0 epsilon0 [ 0 0 0 0 0 ] 1; f0 f0 [ 0 0 0 0 0 ] 0.5; + Pr Pr [ 0 0 0 0 0 ] 0.7; } interpolationSchemes @@ -97,7 +98,7 @@ StandardWallInteractionCoeffs RanzMarshallCoeffs { - Pr Pr [ 0 0 0 0 0 ] 0.7; + BirdCorrection false; } From aae034528384c870b4fc44c4cff9cac9e6490c6c Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 2 Sep 2009 11:15:02 +0100 Subject: [PATCH 05/12] code tidying --- .../Templates/ThermoCloud/ThermoCloudI.H | 4 ++- .../KinematicParcel/KinematicParcel.C | 2 +- .../KinematicParcel/KinematicParcel.H | 9 ++++--- .../KinematicParcel/KinematicParcelI.H | 11 +++++--- .../ReactingMultiphaseParcel.C | 8 +++--- .../Templates/ReactingParcel/ReactingParcel.C | 7 +++-- .../Templates/ThermoParcel/ThermoParcel.C | 27 ++++++------------- .../ConeInjection/ConeInjection.C | 6 +++-- .../ConeInjectionMP/ConeInjectionMP.C | 6 +++-- .../FieldActivatedInjection.C | 6 ++--- .../InjectionModel/InjectionModel.C | 9 ++++--- .../ManualInjection/ManualInjection.C | 4 ++- .../LiquidEvaporation/LiquidEvaporation.C | 4 ++- 13 files changed, 55 insertions(+), 48 deletions(-) diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index d99c35dcfb..f537f6283a 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -26,6 +26,8 @@ License #include "physicoChemicalConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template @@ -229,7 +231,7 @@ Foam::ThermoCloud::Ep() const Ep[cellI] += p.nParticle()*p.areaP()*pow4(p.T()); } - Ep *= epsilon*constant::physicoChemical::sigma.value()/V; + Ep *= epsilon*physicoChemical::sigma.value()/V; } return tEp; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index cb301d8210..a895e9df10 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -102,7 +102,7 @@ void Foam::KinematicParcel::calc const scalar mass0 = mass(); // Reynolds number - const scalar Re = this->Re(U0, d0, muc_); + const scalar Re = this->Re(U0, d0, rhoc_, muc_); // Sources diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H index 29979d106d..973c97a2d8 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.H @@ -389,12 +389,13 @@ public: //- Surface area for given diameter inline scalar areaS(const scalar d) const; - //- Reynolds number - particle properties input + //- Reynolds number inline scalar Re ( - const vector& U, - const scalar d, - const scalar mu + const vector& U, // particle velocity + const scalar d, // particle diameter + const scalar rhoc, // carrier density + const scalar muc // carrier dynamic viscosity ) const; diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H index d847ac38e0..84ccbdec5e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelI.H @@ -26,6 +26,8 @@ License #include "mathConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template @@ -351,7 +353,7 @@ template inline Foam::scalar Foam::KinematicParcel::volume(const scalar d) const { - return constant::math::pi/6.0*pow3(d); + return math::pi/6.0*pow3(d); } @@ -381,7 +383,7 @@ template inline Foam::scalar Foam::KinematicParcel::areaS(const scalar d) const { - return constant::math::pi*d*d; + return math::pi*d*d; } @@ -391,10 +393,11 @@ Foam::KinematicParcel::Re ( const vector& U, const scalar d, - const scalar mu + const scalar rhoc, + const scalar muc ) const { - return rhoc_*mag(U - Uc_)*d/mu; + return rhoc*mag(U - Uc_)*d/muc; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 31d8e9b2d6..c035ecf2dc 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -27,6 +27,8 @@ License #include "ReactingMultiphaseParcel.H" #include "mathConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // template @@ -214,7 +216,7 @@ void Foam::ReactingMultiphaseParcel::calc calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa); // Reynolds number - scalar Re = this->Re(U0, d0, mus); + scalar Re = this->Re(U0, d0, rhos, mus); // Sources @@ -495,7 +497,7 @@ void Foam::ReactingMultiphaseParcel::calc } else { - this->d_ = cbrt(mass1/this->rho_*6.0/constant::math::pi); + this->d_ = cbrt(mass1/this->rho_*6.0/math::pi); } } } @@ -642,7 +644,7 @@ void Foam::ReactingMultiphaseParcel::calcSurfaceReactions const scalar hRetentionCoeffMod = (1.0 - xsi*xsi)*td.constProps().hRetentionCoeff(); - Sh += hRetentionCoeffMod *hReaction/dt; + Sh += hRetentionCoeffMod*hReaction/dt; dhsTrans += (1.0 - hRetentionCoeffMod)*hReaction; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index fdc4d91a28..4ec58ce79e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -159,7 +159,7 @@ void Foam::ReactingParcel::correctSurfaceValues rhos = 0; mus = 0; kappa = 0; - scalar cps = 0.0; + scalar cps = 0; scalar sumYiSqrtW = 0; scalar sumYiCbrtW = 0; @@ -233,11 +233,10 @@ void Foam::ReactingParcel::calc // Calc surface values // ~~~~~~~~~~~~~~~~~~~ scalar Ts, rhos, mus, Pr, kappa; - ThermoParcel:: - calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa); + this->calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa); // Reynolds number - scalar Re = this->Re(U0, d0, mus); + scalar Re = this->Re(U0, d0, rhos, mus); // Sources diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 94b71f7d1a..7851841a74 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -133,7 +133,7 @@ void Foam::ThermoParcel::calc calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa); // Reynolds number - scalar Re = this->Re(U0, d0, mus); + scalar Re = this->Re(U0, d0, rhos, mus); // Sources @@ -231,37 +231,26 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer // Calc heat transfer coefficient scalar htc = td.cloud().heatTransfer().htc(d, Re, Pr, kappa, NCpW); - const scalar As = this->areaS(d); - if (mag(htc) < ROOTVSMALL && !td.cloud().radiation()) { return T + dt*Sh/(this->volume(d)*rho*cp); } - scalar ap; - scalar bp; - + const scalar As = this->areaS(d); + scalar ap = Tc_ + Sh/As/htc; + scalar bp = 6.0*(Sh/As + htc*(Tc_ - T)); if (td.cloud().radiation()) { const scalarField& G = td.cloud().mesh().objectRegistry::lookupObject("G"); + const scalar Gc = G[cellI]; const scalar sigma = physicoChemical::sigma.value(); const scalar epsilon = td.constProps().epsilon0(); - ap = - (Sh/As + htc*Tc_ + epsilon*G[cellI]/4.0) - /(htc + epsilon*sigma*pow3(T)); - - bp = - 6.0 - *(Sh/As + htc*(Tc_ - T) + epsilon*(G[cellI]/4.0 - sigma*pow4(T))) - /(rho*d*cp*(ap - T)); - } - else - { - ap = Tc_ + Sh/As/htc; - bp = 6.0*(Sh/As + htc*(Tc_ - T))/(rho*d*cp*(ap - T)); + ap = (ap + epsilon*Gc/(4.0*htc))/(1.0 + epsilon*sigma*pow3(T)/htc); + bp += 6.0*(epsilon*(Gc/4.0 - sigma*pow4(T))); } + bp /= rho*d*cp*(ap - T); // Integrate to find the new parcel temperature IntegrationScheme::integrationResult Tres = diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C index a6297af086..dd14fe9240 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjection/ConeInjection.C @@ -28,6 +28,8 @@ License #include "DataEntry.H" #include "mathConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template @@ -201,7 +203,7 @@ void Foam::ConeInjection::setProperties ) { // set particle velocity - const scalar deg2Rad = constant::math::pi/180.0; + const scalar deg2Rad = math::pi/180.0; scalar t = time - this->SOI_; scalar ti = thetaInner_().value(t); @@ -211,7 +213,7 @@ void Foam::ConeInjection::setProperties coneAngle *= deg2Rad; scalar alpha = sin(coneAngle); scalar dcorr = cos(coneAngle); - scalar beta = constant::math::twoPi*this->owner().rndGen().scalar01(); + scalar beta = math::twoPi*this->owner().rndGen().scalar01(); vector normal = alpha*(tanVec1_*cos(beta) + tanVec2_*sin(beta)); vector dirVec = dcorr*direction_; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C index 94a58b41c4..e8eb092a39 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ConeInjectionMP/ConeInjectionMP.C @@ -28,6 +28,8 @@ License #include "DataEntry.H" #include "mathConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template @@ -247,7 +249,7 @@ void Foam::ConeInjectionMP::setProperties // set particle velocity const label i = parcelI%positions_.size(); - const scalar deg2Rad = constant::math::pi/180.0; + const scalar deg2Rad = math::pi/180.0; scalar t = time - this->SOI_; scalar ti = thetaInner_().value(t); @@ -257,7 +259,7 @@ void Foam::ConeInjectionMP::setProperties coneAngle *= deg2Rad; scalar alpha = sin(coneAngle); scalar dcorr = cos(coneAngle); - scalar beta = constant::math::twoPi*this->owner().rndGen().scalar01(); + scalar beta = math::twoPi*this->owner().rndGen().scalar01(); vector normal = alpha*(tanVec1_[i]*cos(beta) + tanVec2_[i]*sin(beta)); vector dirVec = dcorr*axes_[i]; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C index d10171de3d..7e8fc31e18 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/FieldActivatedInjection/FieldActivatedInjection.C @@ -28,6 +28,8 @@ License #include "volFields.H" #include "mathConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template @@ -128,9 +130,7 @@ Foam::FieldActivatedInjection::FieldActivatedInjection // Determine total volume of particles to inject this->volumeTotal_ = - nParcelsPerInjector_ - *sum(pow3(diameters_)) - *constant::math::pi/6.0; + nParcelsPerInjector_*sum(pow3(diameters_))*math::pi/6.0; // Set/cache the injector cells forAll(positions_, i) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index ccb56a4767..7f5f3e6c47 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -28,6 +28,8 @@ License #include "mathConstants.H" #include "meshTools.H" +using namespace Foam::constant; + // * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * // template @@ -195,9 +197,10 @@ Foam::scalar Foam::InjectionModel::setNumberOfParticles { case pbMass: { - nP = volume/volumeTotal_ - *massTotal_/rho - /(parcels*constant::math::pi/6.0*pow3(diameter)); + nP = + volume/volumeTotal_ + *massTotal_/rho + /(parcels*math::pi/6.0*pow3(diameter)); break; } case pbNumber: diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C index d0018efbd6..8ebf75af0b 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/ManualInjection/ManualInjection.C @@ -27,6 +27,8 @@ License #include "ManualInjection.H" #include "mathConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template @@ -106,7 +108,7 @@ Foam::ManualInjection::ManualInjection } // Determine volume of particles to inject - this->volumeTotal_ = sum(pow3(diameters_))*constant::math::pi/6.0; + this->volumeTotal_ = sum(pow3(diameters_))*math::pi/6.0; } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index ae1ee89074..322ca30284 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -28,6 +28,8 @@ License #include "specie.H" #include "mathConstants.H" +using namespace Foam::constant; + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // template @@ -148,7 +150,7 @@ void Foam::LiquidEvaporation::calculate scalarField Xc = calcXc(cellI); // droplet surface area - scalar A = constant::math::pi*sqr(d); + scalar A = math::pi*sqr(d); // calculate mass transfer of each specie in liquid forAll(activeLiquids_, i) From 5d1239146151a87e0ea545dcc54961dad6625740 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 2 Sep 2009 14:51:24 +0100 Subject: [PATCH 06/12] bail-out criterion was incorrect --- .../hierarchGeomDecomp/hierarchGeomDecomp.C | 51 +++++++------------ 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C b/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C index bde1181c09..4ee04a7cdf 100644 --- a/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C +++ b/src/decompositionMethods/decompositionMethods/hierarchGeomDecomp/hierarchGeomDecomp.C @@ -198,9 +198,7 @@ void Foam::hierarchGeomDecomp::findBinary label high = values.size(); // Safeguards to avoid infinite loop. - label lowPrev = -1; - label midPrev = -1; - label highPrev = -1; + scalar midValuePrev = VGREAT; while (true) { @@ -208,10 +206,10 @@ void Foam::hierarchGeomDecomp::findBinary if (debug) { - Pout<< "low:" << low << " lowValue:" << lowValue + Pout<< " low:" << low << " lowValue:" << lowValue << " high:" << high << " highValue:" << highValue - << " mid:" << mid << " midValue:" << midValue << nl - << "globalSize:" << size << " wantedSize:" << wantedSize + << " mid:" << mid << " midValue:" << midValue << endl + << " globalSize:" << size << " wantedSize:" << wantedSize << " sizeTol:" << sizeTol << endl; } @@ -235,10 +233,7 @@ void Foam::hierarchGeomDecomp::findBinary mid = findLower(values, midValue, low, high); // Safeguard if same as previous. - bool hasNotChanged = - (mid == midPrev) - && (low == lowPrev) - && (high == highPrev); + bool hasNotChanged = (mag(midValue-midValuePrev) < SMALL); if (returnReduce(hasNotChanged, andOp())) { @@ -248,9 +243,7 @@ void Foam::hierarchGeomDecomp::findBinary break; } - midPrev = mid; - lowPrev = low; - highPrev = high; + midValuePrev = midValue; } } @@ -280,9 +273,7 @@ void Foam::hierarchGeomDecomp::findBinary label high = values.size(); // Safeguards to avoid infinite loop. - label lowPrev = -1; - label midPrev = -1; - label highPrev = -1; + scalar midValuePrev = VGREAT; while (true) { @@ -294,10 +285,10 @@ void Foam::hierarchGeomDecomp::findBinary if (debug) { - Pout<< "low:" << low << " lowValue:" << lowValue + Pout<< " low:" << low << " lowValue:" << lowValue << " high:" << high << " highValue:" << highValue - << " mid:" << mid << " midValue:" << midValue << nl - << "globalSize:" << weightedSize + << " mid:" << mid << " midValue:" << midValue << endl + << " globalSize:" << weightedSize << " wantedSize:" << wantedSize << " sizeTol:" << sizeTol << endl; } @@ -322,10 +313,7 @@ void Foam::hierarchGeomDecomp::findBinary mid = findLower(values, midValue, low, high); // Safeguard if same as previous. - bool hasNotChanged = - (mid == midPrev) - && (low == lowPrev) - && (high == highPrev); + bool hasNotChanged = (mag(midValue-midValuePrev) < SMALL); if (returnReduce(hasNotChanged, andOp())) { @@ -335,9 +323,7 @@ void Foam::hierarchGeomDecomp::findBinary break; } - midPrev = mid; - lowPrev = low; - highPrev = high; + midValuePrev = midValue; } } @@ -460,11 +446,11 @@ void Foam::hierarchGeomDecomp::sortComponent if (debug) { Pout<< "For component " << compI << ", bin " << bin - << " copying" << nl + << " copying" << endl << "from " << leftCoord << " at local index " - << leftIndex << nl + << leftIndex << endl << "to " << rightCoord << " localSize:" - << localSize << nl + << localSize << endl << endl; } @@ -643,11 +629,11 @@ void Foam::hierarchGeomDecomp::sortComponent if (debug) { Pout<< "For component " << compI << ", bin " << bin - << " copying" << nl + << " copying" << endl << "from " << leftCoord << " at local index " - << leftIndex << nl + << leftIndex << endl << "to " << rightCoord << " localSize:" - << localSize << nl + << localSize << endl << endl; } @@ -788,7 +774,6 @@ Foam::labelList Foam::hierarchGeomDecomp::decompose pointField rotatedPoints = rotDelta_ & points; - // Calculate tolerance of cell distribution. For large cases finding // distibution to the cell exact would cause too many iterations so allow // some slack. From 6dc2e629466597f96bcadf4c4122d124a630dfe8 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 2 Sep 2009 14:51:42 +0100 Subject: [PATCH 07/12] do not map demand driven geometric data --- .../mesh/manipulation/splitMeshRegions/splitMeshRegions.C | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 1016794140..dfc657fe8f 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -1655,6 +1655,9 @@ int main(int argc, char *argv[]) Info<< endl; + // Remove any demand-driven fields ('S', 'V' etc) + mesh.clearOut(); + if (cellRegion.nRegions() == 1) { From 0a24060ac3ee15a394481337c33b1a1bbdd74b03 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 2 Sep 2009 15:22:40 +0100 Subject: [PATCH 08/12] superfluous function --- .../polyTopoChange/addPatchCellLayer.C | 28 +------------------ .../polyTopoChange/addPatchCellLayer.H | 9 ------ 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C index 1a725f0ebf..49b676b4bd 100644 --- a/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C +++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/addPatchCellLayer.C @@ -628,7 +628,7 @@ void Foam::addPatchCellLayer::setRefinement DynamicList