diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H index 5e919efcc440848a1fbf9454698022e1ef2bdc98..5cd98cd9d63c5d7e1cdbe18557253e9fe7046ab3 100644 --- a/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H +++ b/applications/solvers/combustion/PDRFoam/PDRModels/turbulence/PDRkEpsilon/PDRkEpsilon.H @@ -124,11 +124,6 @@ public: // Member Functions - tmp<volScalarField> mut() const - { - return mut_; - } - //- Return the effective diffusivity for k tmp<volScalarField> DkEff() const { @@ -147,41 +142,44 @@ public: ); } - //- Return the effective turbulent thermal diffusivity - tmp<volScalarField> alphaEff() const + //- Return the turbulence viscosity + virtual tmp<volScalarField> mut() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return mut_; + } + + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const + { + return alphat_; } //- Return the turbulence kinetic energy - tmp<volScalarField> k() const + virtual tmp<volScalarField> k() const { return k_; } //- Return the turbulence kinetic energy dissipation rate - tmp<volScalarField> epsilon() const + virtual tmp<volScalarField> epsilon() const { return epsilon_; } //- Return the Reynolds stress tensor - tmp<volSymmTensorField> R() const; + virtual tmp<volSymmTensorField> R() const; //- Return the effective stress tensor including the laminar stress - tmp<volSymmTensorField> devRhoReff() const; + virtual tmp<volSymmTensorField> devRhoReff() const; //- Return the source term for the momentum equation - tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; + virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const; //- Solve the turbulence equations and correct the turbulence viscosity - void correct(); + virtual void correct(); //- Read turbulenceProperties dictionary - bool read(); + virtual bool read(); }; diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc index 7209dc0da8367746ca5eb9a2008258a60bbfef8e..bbeb6c0ebdad592e39ca3d8b4bbc413b50f2bd71 100644 --- a/etc/apps/paraview3/bashrc +++ b/etc/apps/paraview3/bashrc @@ -68,7 +68,7 @@ fi if [ -r $ParaView_DIR ] then export PATH=$ParaView_DIR/bin:$PATH - export PV_PLUGIN_PATH=$FOAM_LIBBIN + export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview fi unset cmake ParaView_PYTHON_DIR diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc index 9160edf0f89918b2294b404c9bf12395c0ccc213..33c863215ecca5118d4eb1b249264731919bc623 100644 --- a/etc/apps/paraview3/cshrc +++ b/etc/apps/paraview3/cshrc @@ -62,7 +62,7 @@ endif if ( -r $ParaView_INST_DIR ) then set path=($ParaView_DIR/bin $path) - setenv PV_PLUGIN_PATH $FOAM_LIBBIN + setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview endif unset cmake paraviewMajor paraviewPython diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H index f02475a316fea3f5882ead651d7dbb52dc40600e..3a8d69c2ef8913594261d5ce256680f86d665325 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H @@ -42,13 +42,31 @@ Description namespace Foam { - typedef ReactingMultiphaseCloud<BasicReactingParcel<constGasThermoPhysics> > + typedef ReactingMultiphaseCloud + < + BasicReactingMultiphaseParcel + < + constGasThermoPhysics + > + > constThermoReactingMultiphaseCloud; - typedef ReactingMultiphaseCloud<BasicReactingParcel<gasThermoPhysics> > + typedef ReactingMultiphaseCloud + < + BasicReactingMultiphaseParcel + < + gasThermoPhysics + > + > thermoReactingMultiphaseCloud; - typedef ReactingMultiphaseCloud<BasicReactingParcel<icoPoly8ThermoPhysics> > + typedef ReactingMultiphaseCloud + < + BasicReactingMultiphaseParcel + < + icoPoly8ThermoPhysics + > + > icoPoly8ThermoReactingMultiphaseCloud; } diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 5c3d3d06856b632567259732526b6344f5907513..c1914e5ed50eb5616717a6fa26ba9b30d3b1e784 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -401,7 +401,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassGas[i] - *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[gid].Hc(); } forAll(YLiquid_, i) { @@ -410,7 +410,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassLiquid[i] - *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[gid].Hc(); } /* // No mapping between solid components and carrier phase @@ -421,7 +421,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassSolid[i] - *td.cloud().mcCarrierThermo().speciesData()[gid].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[gid].Hc(); } */ forAll(dMassSRCarrier, i) @@ -430,7 +430,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc td.cloud().hcTrans()[cellI] += np0 *dMassSRCarrier[i] - *td.cloud().mcCarrierThermo().speciesData()[i].H(T0); + *td.cloud().mcCarrierThermo().speciesData()[i].Hc(); } // Update momentum transfer diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 524b4d00d5d103820851e8ee993c1185fa329935..92525ea2b1d96bb4a375acd4d7c888287d1eb6f5 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -122,7 +122,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues } // Far field carrier molar fractions - scalarField Xinf(Y_.size()); + scalarField Xinf(td.cloud().mcCarrierThermo().speciesData().size()); forAll(Xinf, i) { diff --git a/src/postProcessing/functionObjects/field/fieldAverage/controlDict b/src/postProcessing/functionObjects/field/fieldAverage/controlDict index 0132aa91ddc1efe904f7858375e4d2338c4cd8f6..3e186c89e28703360e1939b53039023ea506c2cf 100644 --- a/src/postProcessing/functionObjects/field/fieldAverage/controlDict +++ b/src/postProcessing/functionObjects/field/fieldAverage/controlDict @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application oodles; +application XXX; startFrom latestTime; @@ -54,6 +54,12 @@ functions // Where to load it from (if not already in solver) functionObjectLibs ("libfieldAverage.so"); + // Function object enabled flag + enabled true; + + // When to output the average fields + outputControl outputTime; + // Fields to be averaged - runTime modifiable fields ( diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C index b94b687ba13ca8bad30ccfcd924eb404ee5b67ba..239aa4342d4c11c1dbe118387398b93eeba5c2a4 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C @@ -46,10 +46,13 @@ namespace Foam fieldValues::cellSource::sourceTypeNames_; template<> - const char* NamedEnum<fieldValues::cellSource::operationType, 4>:: - names[] = {"none", "sum", "volAverage", "volIntegrate"}; + const char* NamedEnum<fieldValues::cellSource::operationType, 5>:: + names[] = + { + "none", "sum", "volAverage", "volIntegrate", "weightedAverage" + }; - const NamedEnum<fieldValues::cellSource::operationType, 4> + const NamedEnum<fieldValues::cellSource::operationType, 5> fieldValues::cellSource::operationTypeNames_; } @@ -93,7 +96,7 @@ void Foam::fieldValues::cellSource::setCellZoneCells() // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void Foam::fieldValues::cellSource::initialise() +void Foam::fieldValues::cellSource::initialise(const dictionary& dict) { switch (source_) { @@ -104,7 +107,7 @@ void Foam::fieldValues::cellSource::initialise() } default: { - FatalErrorIn("cellSource::constructCellAddressing()") + FatalErrorIn("cellSource::initialise()") << "Unknown source type. Valid source types are:" << sourceTypeNames_ << nl << exit(FatalError); } @@ -114,6 +117,29 @@ void Foam::fieldValues::cellSource::initialise() << " total cells = " << cellId_.size() << nl << " total volume = " << sum(filterField(mesh().V())) << nl << endl; + + if (operation_ == opWeightedAverage) + { + dict.lookup("weightField") >> weightFieldName_; + if + ( + obr().foundObject<volScalarField>(weightFieldName_) + ) + { + Info<< " weight field = " << weightFieldName_; + } + else + { + FatalErrorIn("cellSource::initialise()") + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" + << nl << " Weight field " << weightFieldName_ + << " must be a " << volScalarField::typeName + << nl << exit(FatalError); + } + } + + Info<< nl << endl; } @@ -172,7 +198,7 @@ void Foam::fieldValues::cellSource::read(const dictionary& dict) if (active_) { // no additional info to read - initialise(); + initialise(dict); } } @@ -183,9 +209,12 @@ void Foam::fieldValues::cellSource::write() if (active_) { - outputFilePtr_() - << obr_.time().value() << tab - << sum(filterField(mesh().V())); + if (Pstream::master()) + { + outputFilePtr_() + << obr_.time().value() << tab + << sum(filterField(mesh().V())); + } forAll(fields_, i) { @@ -196,7 +225,10 @@ void Foam::fieldValues::cellSource::write() writeValues<tensor>(fields_[i]); } - outputFilePtr_()<< endl; + if (Pstream::master()) + { + outputFilePtr_()<< endl; + } if (log_) { diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H index 89cc9ad0103807883d0d8ab396f19c2c81b4fc79..a8d04f7d9a616ae8c7b6842468d43e7dbdd1ba40 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H @@ -39,7 +39,7 @@ Description valueOutput true; // Write values at run-time output times? source cellZone; // Type of cell source sourceName c0; - operation volAverage; // none, sum, volAverage, volIntegrate + operation volAverage; fields ( p @@ -47,6 +47,13 @@ Description ); } + where operation is one of: + - none + - sum + - volAverage + - volIntegrate + - weightedAverage + SourceFiles cellSource.C @@ -96,11 +103,12 @@ public: opNone, opSum, opVolAverage, - opVolIntegrate + opVolIntegrate, + opWeightedAverage }; //- Operation type names - static const NamedEnum<operationType, 4> operationTypeNames_; + static const NamedEnum<operationType, 5> operationTypeNames_; private: @@ -127,23 +135,34 @@ protected: //- Local list of cell IDs labelList cellId_; + //- Weight field name - only used for opWeightedAverage mode + word weightFieldName_; + // Protected member functions //- Initialise, e.g. cell addressing - void initialise(); + void initialise(const dictionary& dict); + + //- Return true if the field name is valid + template<class Type> + bool validField(const word& fieldName) const; //- Insert field values into values list template<class Type> - bool setFieldValues + tmp<Field<Type> > setFieldValues ( - const word& fieldName, - List<Type>& values + const word& fieldName ) const; //- Apply the 'operation' to the values template<class Type> - Type processValues(const List<Type>& values) const; + Type processValues + ( + const Field<Type>& values, + const scalarField& V, + const scalarField& weightField + ) const; //- Output file header information virtual void writeFileHeader(); diff --git a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C index fe495fcca6bb78ba0f0d6ef7214e10775a1bd424..41c5e70d26cc0e6b787c9b55c0d4558cc2b4f246 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C @@ -27,27 +27,16 @@ License #include "cellSource.H" #include "volFields.H" #include "IOList.H" -#include "ListListOps.H" // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template<class Type> -bool Foam::fieldValues::cellSource::setFieldValues -( - const word& fieldName, - List<Type>& values -) const +bool Foam::fieldValues::cellSource::validField(const word& fieldName) const { - values.setSize(cellId_.size(), pTraits<Type>::zero); - typedef GeometricField<Type, fvPatchField, volMesh> vf; if (obr_.foundObject<vf>(fieldName)) { - const vf& field = obr_.lookupObject<vf>(fieldName); - - values = UIndirectList<Type>(field, cellId_); - return true; } @@ -55,10 +44,29 @@ bool Foam::fieldValues::cellSource::setFieldValues } +template<class Type> +Foam::tmp<Foam::Field<Type> > Foam::fieldValues::cellSource::setFieldValues +( + const word& fieldName +) const +{ + typedef GeometricField<Type, fvPatchField, volMesh> vf; + + if (obr_.foundObject<vf>(fieldName)) + { + return filterField(obr_.lookupObject<vf>(fieldName)); + } + + return tmp<Field<Type> >(new Field<Type>(0.0)); +} + + template<class Type> Type Foam::fieldValues::cellSource::processValues ( - const List<Type>& values + const Field<Type>& values, + const scalarField& V, + const scalarField& weightField ) const { Type result = pTraits<Type>::zero; @@ -71,13 +79,17 @@ Type Foam::fieldValues::cellSource::processValues } case opVolAverage: { - tmp<scalarField> V = filterField(mesh().V()); - result = sum(values*V())/sum(V()); + result = sum(values*V)/sum(V); break; } case opVolIntegrate: { - result = sum(values*filterField(mesh().V())); + result = sum(values*V); + break; + } + case opWeightedAverage: + { + result = sum(values*weightField)/sum(weightField); break; } default: @@ -95,25 +107,20 @@ Type Foam::fieldValues::cellSource::processValues template<class Type> bool Foam::fieldValues::cellSource::writeValues(const word& fieldName) { - List<List<Type> > allValues(Pstream::nProcs()); - - bool validField = - setFieldValues<Type>(fieldName, allValues[Pstream::myProcNo()]); + const bool ok = validField<Type>(fieldName); - if (validField) + if (ok) { - Pstream::gatherList(allValues); + Field<Type> values = combineFields(setFieldValues<Type>(fieldName)); + + scalarField V = combineFields(filterField(mesh().V())); + + scalarField weightField = + combineFields(setFieldValues<scalar>(weightFieldName_)); if (Pstream::master()) { - List<Type> values = - ListListOps::combine<List<Type> > - ( - allValues, - accessOp<List<Type> >() - ); - - Type result = processValues(values); + Type result = processValues(values, V, weightField); if (valueOutput_) { @@ -144,7 +151,7 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName) } } - return validField; + return ok; } diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C index b609f4310ab9c711d44b19dbf48bb67419146e0e..e84fe07402fabd8e73589b497893eb87d7ba67b2 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C @@ -220,7 +220,7 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict) } default: { - FatalErrorIn("faceSource::constructFaceAddressing()") + FatalErrorIn("faceSource::initiliase()") << type() << " " << name_ << ": " << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl << " Unknown source type. Valid source types are:" @@ -245,7 +245,7 @@ void Foam::fieldValues::faceSource::initialise(const dictionary& dict) } else { - FatalErrorIn("faceSource::constructFaceAddressing()") + FatalErrorIn("faceSource::initialise()") << type() << " " << name_ << ": " << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl << " Weight field " << weightFieldName_ @@ -326,9 +326,12 @@ void Foam::fieldValues::faceSource::write() if (active_) { - outputFilePtr_() - << obr_.time().value() << tab - << sum(filterField(mesh().magSf())); + if (Pstream::master()) + { + outputFilePtr_() + << obr_.time().value() << tab + << sum(filterField(mesh().magSf())); + } forAll(fields_, i) { @@ -339,7 +342,10 @@ void Foam::fieldValues::faceSource::write() writeValues<tensor>(fields_[i]); } - outputFilePtr_()<< endl; + if (Pstream::master()) + { + outputFilePtr_()<< endl; + } if (log_) { @@ -350,4 +356,3 @@ void Foam::fieldValues::faceSource::write() // ************************************************************************* // - diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H index e8e2634b12855625003e8d27454aa16ccd0a836d..8ef65d870b717b31423ec919d89cfa61f515ee04 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H @@ -153,17 +153,22 @@ protected: //- Initialise, e.g. face addressing void initialise(const dictionary& dict); - //- Insert field values into values list + //- Return true if the field name is valid template<class Type> - bool setFieldValues - ( - const word& fieldName, - List<Type>& values - ) const; + bool validField(const word& fieldName) const; + + //- Return field values by looking up field name + template<class Type> + tmp<Field<Type> > setFieldValues(const word& fieldName) const; //- Apply the 'operation' to the values template<class Type> - Type processValues(const List<Type>& values) const; + Type processValues + ( + const Field<Type>& values, + const scalarField& magSf, + const scalarField& weightField + ) const; //- Output file header information virtual void writeFileHeader(); diff --git a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C index d7609573a72cb18d4b7cbeb6c0cee65e67459654..a257384a5060f30ab7aa98e5a7f81aa81fb161f2 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C @@ -33,81 +33,52 @@ License // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // template<class Type> -bool Foam::fieldValues::faceSource::setFieldValues -( - const word& fieldName, - List<Type>& values -) const +bool Foam::fieldValues::faceSource::validField(const word& fieldName) const { - values.setSize(faceId_.size(), pTraits<Type>::zero); - typedef GeometricField<Type, fvsPatchField, surfaceMesh> sf; typedef GeometricField<Type, fvPatchField, volMesh> vf; if (obr_.foundObject<sf>(fieldName)) { - const sf& field = obr_.lookupObject<sf>(fieldName); - - forAll(values, i) - { - label faceI = faceId_[i]; - label patchI = facePatchId_[i]; - if (patchI >= 0) - { - values[i] = field.boundaryField()[patchI][faceI]; - } - else - { - values[i] = field[faceI]; - } - - values[i] *= flipMap_[i]; - } - return true; } else if (obr_.foundObject<vf>(fieldName)) { - const vf& field = obr_.lookupObject<vf>(fieldName); + return true; + } - forAll(values, i) - { - label faceI = faceId_[i]; - label patchI = facePatchId_[i]; - if (patchI >= 0) - { - values[i] = field.boundaryField()[patchI][faceI]; - } - else - { - FatalErrorIn - ( - "fieldValues::faceSource::setFieldValues" - "(" - "const word&, " - "List<Type>&" - ") const" - ) << type() << " " << name_ << ": " - << sourceTypeNames_[source_] << "(" << sourceName_ << "):" - << nl - << " Unable to process internal faces for volume field " - << fieldName << nl << abort(FatalError); - } + return false; +} - values[i] *= flipMap_[i]; - } - return true; +template<class Type> +Foam::tmp<Foam::Field<Type> > Foam::fieldValues::faceSource::setFieldValues +( + const word& fieldName +) const +{ + typedef GeometricField<Type, fvsPatchField, surfaceMesh> sf; + typedef GeometricField<Type, fvPatchField, volMesh> vf; + + if (obr_.foundObject<sf>(fieldName)) + { + return filterField(obr_.lookupObject<sf>(fieldName)); + } + else if (obr_.foundObject<vf>(fieldName)) + { + return filterField(obr_.lookupObject<vf>(fieldName)); } - return false; + return tmp<Field<Type> >(new Field<Type>(0.0)); } template<class Type> Type Foam::fieldValues::faceSource::processValues ( - const List<Type>& values + const Field<Type>& values, + const scalarField& magSf, + const scalarField& weightField ) const { Type result = pTraits<Type>::zero; @@ -120,54 +91,17 @@ Type Foam::fieldValues::faceSource::processValues } case opAreaAverage: { - tmp<scalarField> magSf = filterField(mesh().magSf()); - result = sum(values*magSf())/sum(magSf()); + result = sum(values*magSf)/sum(magSf); break; } case opAreaIntegrate: { - result = sum(values*filterField(mesh().magSf())); + result = sum(values*magSf); break; } case opWeightedAverage: { - if (mesh().foundObject<volScalarField>(weightFieldName_)) - { - tmp<scalarField> wField = - filterField - ( - mesh().lookupObject<volScalarField>(weightFieldName_) - ); - result = sum(values*wField())/sum(wField()); - } - else if (mesh().foundObject<surfaceScalarField>(weightFieldName_)) - { - tmp<scalarField> wField = - filterField - ( - mesh().lookupObject<surfaceScalarField> - ( - weightFieldName_ - ) - ); - result = sum(values*wField())/sum(wField()); - } - else - { - FatalErrorIn - ( - "fieldValues::faceSource::processValues" - "(" - "List<Type>&" - ") const" - ) << type() << " " << name_ << ": " - << sourceTypeNames_[source_] << "(" << sourceName_ << "):" - << nl - << " Weight field " << weightFieldName_ - << " must be either a " << volScalarField::typeName - << " or " << surfaceScalarField::typeName << nl - << abort(FatalError); - } + result = sum(values*weightField)/sum(weightField); break; } default: @@ -185,25 +119,20 @@ Type Foam::fieldValues::faceSource::processValues template<class Type> bool Foam::fieldValues::faceSource::writeValues(const word& fieldName) { - List<List<Type> > allValues(Pstream::nProcs()); + const bool ok = validField<Type>(fieldName); - bool validField = - setFieldValues<Type>(fieldName, allValues[Pstream::myProcNo()]); - - if (validField) + if (ok) { - Pstream::gatherList(allValues); + Field<Type> values = combineFields(setFieldValues<Type>(fieldName)); + + scalarField magSf = combineFields(filterField(mesh().magSf())); + + scalarField weightField = + combineFields(setFieldValues<scalar>(weightFieldName_)); if (Pstream::master()) { - List<Type> values = - ListListOps::combine<List<Type> > - ( - allValues, - accessOp<List<Type> >() - ); - - Type result = processValues(values); + Type result = processValues(values, magSf, weightField); if (valueOutput_) { @@ -222,7 +151,6 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName) ).write(); } - outputFilePtr_()<< tab << result; if (log_) @@ -234,7 +162,7 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName) } } - return validField; + return ok; } diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H index 1b96bb8e41c6171c50ab7b6ee60f093e6e98b9f7..4aa6f41bd7adff7342e75c50de49d3894558ad05 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H @@ -164,6 +164,13 @@ public: //- Execute the at the final time-loop, currently does nothing virtual void end(); + + //- Comnbine fields from all processor domains into single field + template<class Type> + tmp<Field<Type> > combineFields + ( + const tmp<Field<Type> >& field + ) const; }; @@ -177,6 +184,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "fieldValueTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValueTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValueTemplates.C new file mode 100644 index 0000000000000000000000000000000000000000..23c700134f9c84a22e1391121b60adc7fc007032 --- /dev/null +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValueTemplates.C @@ -0,0 +1,66 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-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 "fieldValue.H" +#include "ListListOps.H" +#include "Pstream.H" + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +Foam::tmp<Foam::Field<Type> > Foam::fieldValue::combineFields +( + const tmp<Field<Type> >& field +) const +{ + List<Field<Type> > allValues(Pstream::nProcs()); + + allValues[Pstream::myProcNo()] = field(); + + Pstream::gatherList(allValues); + + if (Pstream::master()) + { + return tmp<Field<Type> > + ( + new Field<Type> + ( + ListListOps::combine<Field<Type> > + ( + allValues, + accessOp<Field<Type> >() + ) + ) + ); + } + else + { + return field(); + } +} + + +// ************************************************************************* // diff --git a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H index 440ec71c5c9b40bb88176ee3f11aeba2af77a208..7f2d3f1f852a68269ef82f6378039a798457b395 100644 --- a/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H +++ b/src/turbulenceModels/compressible/LES/GenEddyVisc/GenEddyVisc.H @@ -126,15 +126,6 @@ public: return alphaSgs_; } - //- Return thermal diffusivity - virtual tmp<volScalarField> alphaEff() const - { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphaSgs_ + alpha()) - ); - } - //- Return the sub-grid stress tensor. virtual tmp<volSymmTensorField> B() const; diff --git a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H index ff71c80b798a20792b90ff3e568197c80e059ce9..e65495225ccf62faa198a1bd17d0dad842e30d03 100644 --- a/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H +++ b/src/turbulenceModels/compressible/LES/GenSGSStress/GenSGSStress.H @@ -127,15 +127,6 @@ public: return alphaSgs_; } - //- Return thermal conductivity - virtual tmp<volScalarField> alphaEff() const - { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphaSgs_ + alpha()) - ); - } - //- Return the sub-grid stress tensor virtual tmp<volSymmTensorField> B() const { diff --git a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H index cf019ea9a8aca9b93a709e94507a74c08a9ef6c1..2cdde6c61eda86c94183ae323944ef04866bdb89 100644 --- a/src/turbulenceModels/compressible/LES/LESModel/LESModel.H +++ b/src/turbulenceModels/compressible/LES/LESModel/LESModel.H @@ -189,12 +189,6 @@ public: } - //- Return the SGS turbulent kinetic energy. - virtual tmp<volScalarField> k() const = 0; - - //- Return the SGS turbulent dissipation. - virtual tmp<volScalarField> epsilon() const = 0; - //- Return the SGS turbulent viscosity virtual tmp<volScalarField> muSgs() const = 0; @@ -210,8 +204,22 @@ public: //- Return the SGS turbulent thermal diffusivity virtual tmp<volScalarField> alphaSgs() const = 0; - //- Return the SGS thermal conductivity. - virtual tmp<volScalarField> alphaEff() const = 0; + //- Return the effective thermal diffusivity + virtual tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphaSgs() + alpha()) + ); + } + + //- Return the effective turbulence thermal diffusivity for a patch + virtual tmp<scalarField> alphaEff(const label patchI) const + { + return + alphaSgs()().boundaryField()[patchI] + + alpha().boundaryField()[patchI]; + } //- Return the sub-grid stress tensor. virtual tmp<volSymmTensorField> B() const = 0; @@ -261,13 +269,13 @@ public: //- Correct Eddy-Viscosity and related properties. // This calls correct(const tmp<volTensorField>& gradU) by supplying // gradU calculated locally. - void correct(); + virtual void correct(); //- Correct Eddy-Viscosity and related properties virtual void correct(const tmp<volTensorField>& gradU); //- Read LESProperties dictionary - virtual bool read() = 0; + virtual bool read(); }; diff --git a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H index e6239ec91bc623240c124f128a8697110a4b6a8c..29d53267a2e41150562bc20a6e0af6817ad900d7 100644 --- a/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/LES/SpalartAllmaras/SpalartAllmaras.H @@ -149,15 +149,6 @@ public: return alphaSgs_; } - //- Return thermal conductivity - virtual tmp<volScalarField> alphaEff() const - { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphaSgs_ + alpha()) - ); - } - //- Return the sub-grid stress tensor. virtual tmp<volSymmTensorField> B() const; diff --git a/src/turbulenceModels/compressible/RAS/LRR/LRR.H b/src/turbulenceModels/compressible/RAS/LRR/LRR.H index 445faebd39e2534e5c6dec9a2123382120f548bc..9ce0eef7bbecc5b164eb64c0f25ace8c95d29324 100644 --- a/src/turbulenceModels/compressible/RAS/LRR/LRR.H +++ b/src/turbulenceModels/compressible/RAS/LRR/LRR.H @@ -153,13 +153,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H index 00db2c304f9d9338575f2de850098349a894ce02..e8c5a331b26a41735e8b8afc19e447d9e6d1a773 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H +++ b/src/turbulenceModels/compressible/RAS/LaunderGibsonRSTM/LaunderGibsonRSTM.H @@ -162,13 +162,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H index b7c972a662c05b473d8b8eb2f80b4e7125593e4f..f9c878607d04a2796e899720bd2946422828f277 100644 --- a/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H +++ b/src/turbulenceModels/compressible/RAS/LaunderSharmaKE/LaunderSharmaKE.H @@ -146,13 +146,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H index cc189f24c80275ba3e7159dde0416339ee1e7ee1..883fa0825a32e106dadd870c853f38ec3319a061 100644 --- a/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H +++ b/src/turbulenceModels/compressible/RAS/RASModel/RASModel.H @@ -265,9 +265,6 @@ public: } - //- Return the turbulence viscosity - virtual tmp<volScalarField> mut() const = 0; - //- Return the effective viscosity virtual tmp<volScalarField> muEff() const { @@ -278,22 +275,21 @@ public: } //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const = 0; - - //- Return the turbulence kinetic energy - virtual tmp<volScalarField> k() const = 0; - - //- Return the turbulence kinetic energy dissipation rate - virtual tmp<volScalarField> epsilon() const = 0; - - //- Return the Reynolds stress tensor - virtual tmp<volSymmTensorField> R() const = 0; - - //- Return the effective stress tensor including the laminar stress - virtual tmp<volSymmTensorField> devRhoReff() const = 0; + virtual tmp<volScalarField> alphaEff() const + { + return tmp<volScalarField> + ( + new volScalarField("alphaEff", alphat() + alpha()) + ); + } - //- Return the source term for the momentum equation - virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const = 0; + //- Return the effective turbulent thermal diffusivity for a patch + virtual tmp<scalarField> alphaEff(const label patchI) const + { + return + alphat()().boundaryField()[patchI] + + alpha().boundaryField()[patchI]; + } //- Return yPlus for the given patch virtual tmp<scalarField> yPlus @@ -303,10 +299,10 @@ public: ) const; //- Solve the turbulence equations and correct the turbulence viscosity - virtual void correct() = 0; + virtual void correct(); //- Read RASProperties dictionary - virtual bool read() = 0; + virtual bool read(); }; diff --git a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H index 1e4301adcd222a32d1dabb714db0e7ece32c8bc6..9d9601eee78caed08225e4dfc9e01b884da6c3e6 100644 --- a/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H +++ b/src/turbulenceModels/compressible/RAS/RNGkEpsilon/RNGkEpsilon.H @@ -142,13 +142,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H index 94e736b9f8a13812727cdf9b974dcf205b6c9697..fdb0c675ee09002db9ada976c9c4b51938612aa4 100644 --- a/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H +++ b/src/turbulenceModels/compressible/RAS/SpalartAllmaras/SpalartAllmaras.H @@ -178,13 +178,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C index 2f54baf7c25ff80c45be84bbb326731628916be4..e8e6234c32b0ae6d035ae9aea3db301d89cb6726 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -37,6 +37,22 @@ namespace Foam namespace compressible { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<> +const char* +NamedEnum<turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, 2>:: +names[] = + { + "power", + "flux" + }; + +const +NamedEnum<turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, 2> + turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // turbulentHeatFluxTemperatureFvPatchScalarField:: @@ -47,8 +63,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(p, iF), - q_(p.size(), 0.0), - rhoName_("rho") + heatSource_(hsPower), + q_(p.size(), 0.0) {} @@ -62,8 +78,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(ptf, p, iF, mapper), - q_(ptf.q_, mapper), - rhoName_(ptf.rhoName_) + heatSource_(ptf.heatSource_), + q_(ptf.q_, mapper) {} @@ -76,8 +92,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(p, iF), - q_("q", dict, p.size()), - rhoName_(dict.lookupOrDefault<word>("rho", "rho")) + heatSource_(heatSourceTypeNames_.read(dict.lookup("heatSource"))), + q_("q", dict, p.size()) { fvPatchField<scalar>::operator=(patchInternalField()); gradient() = 0.0; @@ -91,8 +107,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(thftpsf), - q_(thftpsf.q_), - rhoName_(thftpsf.rhoName_) + heatSource_(thftpsf.heatSource_), + q_(thftpsf.q_) {} @@ -104,8 +120,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(thftpsf, iF), - q_(thftpsf.q_), - rhoName_(thftpsf.rhoName_) + heatSource_(thftpsf.heatSource_), + q_(thftpsf.q_) {} @@ -150,22 +166,39 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() const RASModel& rasModel = db().lookupObject<RASModel>("RASProperties"); - const scalarField alphaEffp = rasModel.alphaEff()().boundaryField()[patchI]; + const scalarField alphaEffp = rasModel.alphaEff(patchI); - const basicThermo& thermo = - db().lookupObject<basicThermo>("thermophysicalProperties"); - -// const scalarField& Tp = thermo.T().boundaryField()[patchI]; const scalarField& Tp = *this; - const scalarField Cpp = thermo.Cp(Tp, patchI); - - const scalarField& rhop = - patch().lookupPatchField<volScalarField, scalar>(rhoName_); - - const scalar Ap = gSum(patch().magSf()); + const scalarField Cpp = rasModel.thermo().Cp(Tp, patchI); - gradient() = q_/(Ap*rhop*Cpp*alphaEffp); + switch (heatSource_) + { + case hsPower: + { + const scalar Ap = gSum(patch().magSf()); + gradient() = q_/(Ap*Cpp*alphaEffp); + break; + } + case hsFlux: + { + gradient() = q_/(Cpp*alphaEffp); + break; + } + default: + { + FatalErrorIn + ( + "turbulentHeatFluxTemperatureFvPatchScalarField" + "(" + "const fvPatch&, " + "const DimensionedField<scalar, volMesh>&, " + "const dictionary&" + ")" + ) << "Unknown heat source type. Valid types are: " + << heatSourceTypeNames_ << nl << exit(FatalError); + } + } fixedGradientFvPatchScalarField::updateCoeffs(); } @@ -177,8 +210,9 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::write ) const { fvPatchScalarField::write(os); + os.writeKeyword("heatSource") << heatSourceTypeNames_[heatSource_] + << token::END_STATEMENT << nl; q_.writeEntry("q", os); - os.writeKeyword("rho") << rhoName_ << token::END_STATEMENT << nl; gradient().writeEntry("gradient", os); writeEntry("value", os); } diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H index f7581102df9f8d328715b7b295548f2e8d051326..7d9e5b7a40a772b6f2f36e932ed34988e62e66d2 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H @@ -26,7 +26,20 @@ Class Foam::turbulentHeatFluxTemperatureFvPatchScalarField Description - Fixed heat flux boundary condition for temperature. + Fixed heat boundary condition to specify temperature gradient. Input + heat source either specified in terms of an absolute power [W], or as a + flux [W/m2]. + + Example usage: + + hotWall + { + type compressible::turbulentHeatFluxTemperature; + heatSource flux; // power [W]; flux [W/m2] + q uniform 10; // heat power or flux + value uniform 300; // initial temperature value + } + SourceFiles turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -38,6 +51,7 @@ SourceFiles #include "fvPatchFields.H" #include "fixedGradientFvPatchFields.H" +#include "NamedEnum.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -47,20 +61,37 @@ namespace compressible { /*---------------------------------------------------------------------------*\ - Class turbulentHeatFluxTemperatureFvPatchScalarField Declaration + Class turbulentHeatFluxTemperatureFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ class turbulentHeatFluxTemperatureFvPatchScalarField : public fixedGradientFvPatchScalarField { -// Private data +public: + + // Data types + + //- Enumeration listing the possible hest source input modes + enum heatSourceType + { + hsPower, + hsFlux + }; + + +private: + + // Private data + + //- Heat source type names + static const NamedEnum<heatSourceType, 2> heatSourceTypeNames_; - //- Heat flux [W] - scalarField q_; + //- Heat source type + heatSourceType heatSource_; - //- Name of density field - word rhoName_; + //- Heat power [W] or flux [W/m2] + scalarField q_; public: diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C index 5c73b8b146f80447c58e1142000b931d6f839d58..cab530edacbe1e4afa342021d5badf64a4ca554c 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C @@ -222,7 +222,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::updateCoeffs() const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; const fvPatchScalarField& hw = - patch().lookupPatchField<volScalarField, scalar>("h"); + rasModel.thermo().h().boundaryField()[patchI]; // Heat flux [W/m2] - lagging alphatw const scalarField qDot = (alphaw + alphatw)*hw.snGrad(); diff --git a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H index 865120d8c6c9c320351bcda9b80c655755d48884..11d8f75a058c20bdb21fefec6dbb48cceea45e8f 100644 --- a/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H +++ b/src/turbulenceModels/compressible/RAS/kEpsilon/kEpsilon.H @@ -138,13 +138,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H index a563557f764cb24dfdba768fe6afe2061f8e1cc4..9806d32493b7ccdf91270fcdd0498aac74a69dc4 100644 --- a/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H +++ b/src/turbulenceModels/compressible/RAS/kOmegaSST/kOmegaSST.H @@ -222,13 +222,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/RAS/laminar/laminar.C b/src/turbulenceModels/compressible/RAS/laminar/laminar.C index 415dedee72b21dfb14b39157875dbb71ba9cc983..cc5666eb6cbc0cbe54051a9f4996bf0354bd8d3b 100644 --- a/src/turbulenceModels/compressible/RAS/laminar/laminar.C +++ b/src/turbulenceModels/compressible/RAS/laminar/laminar.C @@ -78,6 +78,27 @@ tmp<volScalarField> laminar::mut() const } +tmp<volScalarField> laminar::alphat() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("alphat", alpha().dimensions(), 0.0) + ) + ); +} + + tmp<volScalarField> laminar::k() const { return tmp<volScalarField> diff --git a/src/turbulenceModels/compressible/RAS/laminar/laminar.H b/src/turbulenceModels/compressible/RAS/laminar/laminar.H index af1f5e2bb2c379c3ef7936b6033cb23a17893e2b..506799ec983c01e9ba45a4de8d1687cd1ed6e3f0 100644 --- a/src/turbulenceModels/compressible/RAS/laminar/laminar.H +++ b/src/turbulenceModels/compressible/RAS/laminar/laminar.H @@ -89,6 +89,9 @@ public: return tmp<volScalarField>(new volScalarField("muEff", mu())); } + //- Return the turbulence thermal diffusivity, i.e. 0 for laminar flow + virtual tmp<volScalarField> alphat() const; + //- Return the effective turbulent thermal diffusivity, // i.e. the laminar thermal diffusivity virtual tmp<volScalarField> alphaEff() const diff --git a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H index 222ee733a3210374de39e8145036981fe9213c86..1b7d51a9a97a2ea4e0d32a4fb76516fa632536a1 100644 --- a/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H +++ b/src/turbulenceModels/compressible/RAS/realizableKE/realizableKE.H @@ -159,13 +159,10 @@ public: return mut_; } - //- Return the effective turbulent thermal diffusivity - virtual tmp<volScalarField> alphaEff() const + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const { - return tmp<volScalarField> - ( - new volScalarField("alphaEff", alphat_ + alpha()) - ); + return alphat_; } //- Return the turbulence kinetic energy diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C index 4a391c3db5b1d2f4d509a898ab4308e5d2a6cc31..87d450d12d9477e1edb74c351ca9d1bcac01b17d 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.C @@ -96,6 +96,27 @@ tmp<volScalarField> laminar::mut() const } +tmp<volScalarField> laminar::alphat() const +{ + return tmp<volScalarField> + ( + new volScalarField + ( + IOobject + ( + "alphat", + runTime_.timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedScalar("alphat", alpha().dimensions(), 0.0) + ) + ); +} + + tmp<volScalarField> laminar::k() const { return tmp<volScalarField> diff --git a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H index d4379bfb2e28ca939e7f5df7ee9229990ae5c5ee..7645e67379417f3cc0efc1b8a8c3bee1a86fa9b2 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H +++ b/src/turbulenceModels/compressible/turbulenceModel/laminar/laminar.H @@ -99,6 +99,9 @@ public: return tmp<volScalarField>(new volScalarField("muEff", mu())); } + //- Return the turbulence thermal diffusivity, i.e. 0 for laminar flow + virtual tmp<volScalarField> alphat() const; + //- Return the effective turbulent thermal diffusivity, // i.e. the laminar thermal diffusivity virtual tmp<volScalarField> alphaEff() const @@ -106,6 +109,13 @@ public: return tmp<volScalarField>(new volScalarField("alphaEff", alpha())); } + //- Return the effective turbulent thermal diffusivity for a patch, + // i.e. the laminar thermal diffusivity + virtual tmp<scalarField> alphaEff(const label patchI) const + { + return alpha().boundaryField()[patchI]; + } + //- Return the turbulence kinetic energy, i.e. 0 for laminar flow virtual tmp<volScalarField> k() const; diff --git a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H index 97638e5e49cfb054a21812fd7fa94ef06c96ccb9..9a84c01bb832ee9fb6d873dd0ee0be835ed7e5e3 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H +++ b/src/turbulenceModels/compressible/turbulenceModel/turbulenceModel.H @@ -192,9 +192,15 @@ public: //- Return the effective viscosity virtual tmp<volScalarField> muEff() const = 0; - //- Return the effective turbulent thermal diffusivity + //- Return the turbulence thermal diffusivity + virtual tmp<volScalarField> alphat() const = 0; + + //- Return the effective turbulence thermal diffusivity virtual tmp<volScalarField> alphaEff() const = 0; + //- Return the effective turbulence thermal diffusivity for a patch + virtual tmp<scalarField> alphaEff(const label patchI) const = 0; + //- Return the turbulence kinetic energy virtual tmp<volScalarField> k() const = 0; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C index 3ca461698afff2844b2c481b9fb99dce7789b9fc..76639637bab63140c65f999dbe7e9d7aeea73608 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -36,6 +36,22 @@ namespace Foam namespace incompressible { +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +template<> +const char* +NamedEnum<turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, 2>:: +names[] = + { + "power", + "flux" + }; + +const +NamedEnum<turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceType, 2> + turbulentHeatFluxTemperatureFvPatchScalarField::heatSourceTypeNames_; + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // turbulentHeatFluxTemperatureFvPatchScalarField:: @@ -46,6 +62,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(p, iF), + heatSource_(hsPower), q_(p.size(), 0.0), alphaEffName_("undefinedAlphaEff"), CpName_("undefinedCp") @@ -62,6 +79,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(ptf, p, iF, mapper), + heatSource_(ptf.heatSource_), q_(ptf.q_, mapper), alphaEffName_(ptf.alphaEffName_), CpName_(ptf.CpName_) @@ -77,6 +95,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(p, iF), + heatSource_(heatSourceTypeNames_.read(dict.lookup("heatSource"))), q_("q", dict, p.size()), alphaEffName_(dict.lookup("alphaEff")), CpName_(dict.lookup("Cp")) @@ -93,6 +112,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(thftpsf), + heatSource_(thftpsf.heatSource_), q_(thftpsf.q_), alphaEffName_(thftpsf.alphaEffName_), CpName_(thftpsf.CpName_) @@ -107,6 +127,7 @@ turbulentHeatFluxTemperatureFvPatchScalarField ) : fixedGradientFvPatchScalarField(thftpsf, iF), + heatSource_(thftpsf.heatSource_), q_(thftpsf.q_), alphaEffName_(thftpsf.alphaEffName_), CpName_(thftpsf.CpName_) @@ -156,7 +177,33 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() const scalarField& Cpp = patch().lookupPatchField<volScalarField, scalar>(CpName_); - gradient() = q_/(Cpp*alphaEffp); + switch (heatSource_) + { + case hsPower: + { + const scalar Ap = gSum(patch().magSf()); + gradient() = q_/(Ap*Cpp*alphaEffp); + break; + } + case hsFlux: + { + gradient() = q_/(Cpp*alphaEffp); + break; + } + default: + { + FatalErrorIn + ( + "turbulentHeatFluxTemperatureFvPatchScalarField" + "(" + "const fvPatch&, " + "const DimensionedField<scalar, volMesh>&, " + "const dictionary&" + ")" + ) << "Unknown heat source type. Valid types are: " + << heatSourceTypeNames_ << nl << exit(FatalError); + } + } fixedGradientFvPatchScalarField::updateCoeffs(); } @@ -165,6 +212,8 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs() void turbulentHeatFluxTemperatureFvPatchScalarField::write(Ostream& os) const { fixedGradientFvPatchScalarField::write(os); + os.writeKeyword("heatSource") << heatSourceTypeNames_[heatSource_] + << token::END_STATEMENT << nl; q_.writeEntry("q", os); os.writeKeyword("alphaEff") << alphaEffName_ << token::END_STATEMENT << nl; os.writeKeyword("Cp") << CpName_ << token::END_STATEMENT << nl; diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H index 848c9ca403ffbf4e1e703cfee37628efaaf762e5..1ba9a7725396ce1d3db7c54b63cd22505113b724 100644 --- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H +++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.H @@ -26,7 +26,22 @@ Class Foam::turbulentHeatFluxTemperatureFvPatchScalarField Description - Fixed heat flux boundary condition for temperature. + Fixed heat boundary condition to specify temperature gradient. Input + heat source either specified in terms of an absolute power [W], or as a + flux [W/m2]. + + Example usage: + + hotWall + { + type turbulentHeatFluxTemperature; + heatSource flux; // power [W]; flux [W/m2] + q uniform 10; // heat power or flux + alphaEff alphaEff; // alphaEff field name; + // alphaEff in [kg/m/s] + Cp Cp; // Cp field name; Cp in [J/kg/K] + value uniform 300; // initial temperature value + } SourceFiles turbulentHeatFluxTemperatureFvPatchScalarField.C @@ -38,6 +53,7 @@ SourceFiles #include "fvPatchFields.H" #include "fixedGradientFvPatchFields.H" +#include "NamedEnum.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -54,16 +70,37 @@ class turbulentHeatFluxTemperatureFvPatchScalarField : public fixedGradientFvPatchScalarField { -// Private data +public: + + // Data types + + //- Enumeration listing the possible hest source input modes + enum heatSourceType + { + hsPower, + hsFlux + }; + + +private: + + // Private data + + //- Heat source type names + static const NamedEnum<heatSourceType, 2> heatSourceTypeNames_; + + //- Heat source type + heatSourceType heatSource_; - //- Heat flux [W/m2] - scalarField q_; + //- Heat power [W] or flux [W/m2] + // NOTE: to be divided by density, rho, if used in kinematic form + scalarField q_; - //- Name of effective thermal diffusivity field - word alphaEffName_; + //- Name of effective thermal diffusivity field + word alphaEffName_; - //- Name of specific heat capacity field - word CpName_; + //- Name of specific heat capacity field + word CpName_; public: diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T index 76b8877c7e780d42f65a1520dcaba50fa64795d8..18610a300b685b169a045233b2775105e8767351 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T @@ -23,411 +23,7 @@ boundaryField floor { type fixedValue; - value nonuniform List<scalar> -400 -( -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -600 -600 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -600 -600 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -) -; + value uniform 300; } ceiling { diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T.org b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T.org index 76b8877c7e780d42f65a1520dcaba50fa64795d8..18610a300b685b169a045233b2775105e8767351 100644 --- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T.org +++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/0/T.org @@ -23,411 +23,7 @@ boundaryField floor { type fixedValue; - value nonuniform List<scalar> -400 -( -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -600 -600 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -600 -600 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -300 -) -; + value uniform 300; } ceiling { diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/omega b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/omega index f9b551e72ba2b71d778ef4f51db0e50aa213ae31..0538e96fb771270fe8c72901c66df0f48c21cafd 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/omega +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/0/omega @@ -41,7 +41,7 @@ boundaryField type compressible::turbulentMixingLengthFrequencyInlet; mixingLength 0.007; k k; - value uniform 4.5-3; + value uniform 4.5e-3; } outlet {