From 42f82562b626b9fa804a8c1417f880f51fd553d7 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 27 Oct 2009 16:02:21 +0000 Subject: [PATCH 1/9] added weighted average option --- .../field/fieldValues/face/faceSource.C | 61 ++++++++++++++----- .../field/fieldValues/face/faceSource.H | 19 ++++-- .../fieldValues/face/faceSourceTemplates.C | 41 +++++++++++++ .../field/fieldValues/fieldValue/fieldValue.H | 2 +- 4 files changed, 104 insertions(+), 19 deletions(-) diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.C index 76c1ac9515..710e346ed5 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.C +++ b/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.C @@ -50,10 +50,13 @@ namespace Foam fieldValues::faceSource::sourceTypeNames_; template<> - const char* NamedEnum:: - names[] = {"none", "sum", "areaAverage", "areaIntegrate"}; + const char* NamedEnum:: + names[] = + { + "none", "sum", "areaAverage", "areaIntegrate", "weightedAverage" + }; - const NamedEnum + const NamedEnum fieldValues::faceSource::operationTypeNames_; } @@ -68,7 +71,9 @@ void Foam::fieldValues::faceSource::setFaceZoneFaces() if (zoneId < 0) { FatalErrorIn("faceSource::faceSource::setFaceZoneFaces()") - << "Unknown face zone name: " << sourceName_ + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl + << " Unknown face zone name: " << sourceName_ << ". Valid face zones are: " << mesh().faceZones().names() << nl << exit(FatalError); } @@ -164,7 +169,9 @@ void Foam::fieldValues::faceSource::setPatchFaces() if (patchId < 0) { FatalErrorIn("faceSource::constructFaceAddressing()") - << "Unknown patch name: " << sourceName_ + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl + << " Unknown patch name: " << sourceName_ << ". Valid patch names are: " << mesh().boundaryMesh().names() << nl << exit(FatalError); @@ -197,7 +204,7 @@ void Foam::fieldValues::faceSource::setPatchFaces() // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // -void Foam::fieldValues::faceSource::initialise() +void Foam::fieldValues::faceSource::initialise(const dictionary& dict) { switch (source_) { @@ -214,15 +221,40 @@ void Foam::fieldValues::faceSource::initialise() default: { FatalErrorIn("faceSource::constructFaceAddressing()") - << "Unknown source type. Valid source types are:" + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" + << nl << " Unknown source type. Valid source types are:" << sourceTypeNames_ << nl << exit(FatalError); } } Info<< type() << " " << name_ << ":" << nl - << " total faces = " << faceId_.size() << nl - << " total area = " << sum(filterField(mesh().magSf())) - << nl << endl; + << " total faces = " << faceId_.size() << nl + << " total area = " << sum(filterField(mesh().magSf())) << nl; + + if (operation_ == opWeightedAverage) + { + dict.lookup("weightField") >> weightFieldName_; + if + ( + obr().foundObject(weightFieldName_) + || obr().foundObject(weightFieldName_) + ) + { + Info<< " weight field = " << weightFieldName_; + } + else + { + FatalErrorIn("faceSource::constructFaceAddressing()") + << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" + << nl << " Weight field " << weightFieldName_ + << " must be either a " << volScalarField::typeName << " or " + << surfaceScalarField::typeName << nl << exit(FatalError); + } + } + + Info<< nl << endl; } @@ -302,12 +334,13 @@ Foam::fieldValues::faceSource::faceSource faceId_(), facePatchId_(), flipMap_(), - outputFilePtr_(NULL) + outputFilePtr_(NULL), + weightFieldName_("undefinedWeightedFieldName") { - initialise(); - if (active_) { + initialise(dict); + // Create the output file if not already created makeFile(); } @@ -327,7 +360,7 @@ void Foam::fieldValues::faceSource::read(const dictionary& dict) if (active_) { fieldValue::read(dict); - initialise(); + initialise(dict); } } diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.H index fa89fcdd6c..3509d733cd 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.H +++ b/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.H @@ -39,7 +39,7 @@ Description valueOutput true; // Write values at run-time output times? source faceZone; // Type of face source: faceZone, patch sourceName f0; - operation sum; // none, sum, areaAverage, areaIntegrate + operation sum; fields ( p @@ -48,6 +48,13 @@ Description ); } + where operation is one of: + - none + - sum + - areaAverage + - areaIntegrate + - weightedAverage + SourceFiles faceSource.C @@ -100,11 +107,12 @@ public: opNone, opSum, opAreaAverage, - opAreaIntegrate + opAreaIntegrate, + opWeightedAverage }; //- Operation type names - static const NamedEnum operationTypeNames_; + static const NamedEnum operationTypeNames_; private: @@ -143,11 +151,14 @@ protected: //- Output file pointer autoPtr outputFilePtr_; + //- Weight field name - only used for opWeightedAverage mode + word weightFieldName_; + // Protected member functions //- Initialise, e.g. face addressing - void initialise(); + void initialise(const dictionary& dict); //- Insert field values into values list template diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/face/faceSourceTemplates.C index ced2ee82ee..d7609573a7 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/face/faceSourceTemplates.C +++ b/src/postProcessing/functionObjects/field/fieldValues/face/faceSourceTemplates.C @@ -129,6 +129,47 @@ Type Foam::fieldValues::faceSource::processValues result = sum(values*filterField(mesh().magSf())); break; } + case opWeightedAverage: + { + if (mesh().foundObject(weightFieldName_)) + { + tmp wField = + filterField + ( + mesh().lookupObject(weightFieldName_) + ); + result = sum(values*wField())/sum(wField()); + } + else if (mesh().foundObject(weightFieldName_)) + { + tmp wField = + filterField + ( + mesh().lookupObject + ( + weightFieldName_ + ) + ); + result = sum(values*wField())/sum(wField()); + } + else + { + FatalErrorIn + ( + "fieldValues::faceSource::processValues" + "(" + "List&" + ") const" + ) << type() << " " << name_ << ": " + << sourceTypeNames_[source_] << "(" << sourceName_ << "):" + << nl + << " Weight field " << weightFieldName_ + << " must be either a " << volScalarField::typeName + << " or " << surfaceScalarField::typeName << nl + << abort(FatalError); + } + break; + } default: { // Do nothing diff --git a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H index cdedaae131..3d862b1f6b 100644 --- a/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H +++ b/src/postProcessing/functionObjects/field/fieldValues/fieldValue/fieldValue.H @@ -137,7 +137,7 @@ public: //- Return the output field values flag const Switch& valueOutput() const; - //- Helper funvction to return the reference to the mesh + //- Helper function to return the reference to the mesh const fvMesh& mesh() const; From 6b289c32fd8fc2fbd173498195dfed832a38db0c Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Oct 2009 12:21:28 +0000 Subject: [PATCH 2/9] added check to ensure that the inert specie exists in available specie list --- .../solvers/combustion/dieselEngineFoam/createFields.H | 8 ++++++++ .../solvers/lagrangian/coalChemistryFoam/createFields.H | 8 ++++++++ .../porousExplicitSourceReactingParcelFoam/createFields.H | 8 ++++++++ .../solvers/lagrangian/reactingParcelFoam/createFields.H | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/applications/solvers/combustion/dieselEngineFoam/createFields.H b/applications/solvers/combustion/dieselEngineFoam/createFields.H index 9d9229cc3c..6987608006 100644 --- a/applications/solvers/combustion/dieselEngineFoam/createFields.H +++ b/applications/solvers/combustion/dieselEngineFoam/createFields.H @@ -13,6 +13,14 @@ PtrList& Y = composition.Y(); word inertSpecie(thermo.lookup("inertSpecie")); +if (!composition.contains(inertSpecie)) +{ + FatalErrorIn(args.executable()) + << "Specified inert specie '" << inertSpecie << "' not found in " + << "species list. Available species:" << composition.species() + << exit(FatalError); +} + volScalarField rho ( IOobject diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index bba39fe862..14d6f6f229 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -13,6 +13,14 @@ word inertSpecie(thermo.lookup("inertSpecie")); + if (!composition.contains(inertSpecie)) + { + FatalErrorIn(args.executable()) + << "Specified inert specie '" << inertSpecie << "' not found in " + << "species list. Available species:" << composition.species() + << exit(FatalError); + } + volScalarField& p = thermo.p(); volScalarField& h = thermo.h(); const volScalarField& T = thermo.T(); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H index a3054db0f5..3d6c5500ea 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createFields.H @@ -13,6 +13,14 @@ word inertSpecie(thermo.lookup("inertSpecie")); + if (!composition.contains(inertSpecie)) + { + FatalErrorIn(args.executable()) + << "Specified inert specie '" << inertSpecie << "' not found in " + << "species list. Available species:" << composition.species() + << exit(FatalError); + } + volScalarField& p = thermo.p(); volScalarField& h = thermo.h(); const volScalarField& T = thermo.T(); diff --git a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H index ec820fa5e3..359599a61f 100644 --- a/applications/solvers/lagrangian/reactingParcelFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFoam/createFields.H @@ -13,6 +13,14 @@ word inertSpecie(thermo.lookup("inertSpecie")); + if (!composition.contains(inertSpecie)) + { + FatalErrorIn(args.executable()) + << "Specified inert specie '" << inertSpecie << "' not found in " + << "species list. Available species:" << composition.species() + << exit(FatalError); + } + volScalarField& p = thermo.p(); volScalarField& h = thermo.h(); const volScalarField& T = thermo.T(); From 43433af30f371d8f6ef62c0837e53eb214f23acb Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Oct 2009 18:35:47 +0000 Subject: [PATCH 3/9] limiting min particle temp to constProps.TMin() --- .../parcels/Templates/ThermoParcel/ThermoParcel.C | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 7851841a74..a87342c6fe 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -233,7 +233,7 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer if (mag(htc) < ROOTVSMALL && !td.cloud().radiation()) { - return T + dt*Sh/(this->volume(d)*rho*cp); + return max(T + dt*Sh/(this->volume(d)*rho*cp), td.constProps().TMin()); } const scalar As = this->areaS(d); @@ -256,9 +256,11 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer IntegrationScheme::integrationResult Tres = td.cloud().TIntegrator().integrate(T, dt, ap, bp); - dhsTrans += dt*htc*As*(Tres.average() - Tc_); + scalar Tnew = max(Tres.value(), td.constProps().TMin()); - return Tres.value(); + dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_); + + return Tnew; } From f299ba1512aa811ca8e5dbed4ae1cdf480887a13 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 28 Oct 2009 18:43:58 +0000 Subject: [PATCH 4/9] minor update --- .../parcels/Templates/ReactingParcel/ReactingParcel.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index cadaed0d36..6729cab4c2 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -121,7 +121,7 @@ void Foam::ReactingParcel::correctSurfaceValues return; } - // Far field gas molar fractions + // Far field carrier molar fractions scalarField Xinf(Y_.size()); forAll(Xinf, i) @@ -135,7 +135,7 @@ void Foam::ReactingParcel::correctSurfaceValues // 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 + // Surface carrier total molar concentration const scalar CsTot = pc_/(specie::RR*this->T_); // Surface carrier composition (molar fraction) @@ -171,10 +171,10 @@ void Foam::ReactingParcel::correctSurfaceValues 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); + cps += Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].Cp(T); sumYiSqrtW += Ys[i]*sqrtW; sumYiCbrtW += Ys[i]*cbrtW; @@ -417,7 +417,7 @@ void Foam::ReactingParcel::calcPhaseChange const scalarField& YComponents, scalarField& dMassPC, scalar& Sh, - scalar& dhsTrans, + scalar& dhsTrans, // TODO: not used scalar& N, scalar& NCpW, scalarField& Cs From 313fa589012c0849ab293093484505cbf4f4fff8 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Oct 2009 10:50:20 +0000 Subject: [PATCH 5/9] bugfix: removed dh offset for poly copy with name constructor --- .../specie/thermo/hPolynomial/hPolynomialThermoI.H | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H index f575e970b4..21e2171ec0 100644 --- a/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H +++ b/src/thermophysicalModels/specie/thermo/hPolynomial/hPolynomialThermoI.H @@ -63,10 +63,7 @@ inline Foam::hPolynomialThermo::hPolynomialThermo cpPolynomial_(pt.cpPolynomial_), dhPolynomial_(pt.dhPolynomial_), dsPolynomial_(pt.dsPolynomial_) -{ - // Offset dh poly so that it is relative to the enthalpy at Tstd - dhPolynomial_[0] -= dhPolynomial_.evaluate(specie::Tstd); -} +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // From 4387f7be17cb9fed77bc3e372a9cb04a5d38d727 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Oct 2009 10:56:48 +0000 Subject: [PATCH 6/9] code structuring --- src/postProcessing/functionObjects/field/Make/files | 8 ++++---- .../field/fieldValues/{cell => cellSource}/IOcellSource.H | 0 .../field/fieldValues/{cell => cellSource}/cellSource.C | 0 .../field/fieldValues/{cell => cellSource}/cellSource.H | 0 .../{cell => cellSource}/cellSourceFunctionObject.C | 0 .../{cell => cellSource}/cellSourceFunctionObject.H | 0 .../field/fieldValues/{cell => cellSource}/cellSourceI.H | 0 .../{cell => cellSource}/cellSourceTemplates.C | 0 .../field/fieldValues/{face => faceSource}/IOfaceSource.H | 0 .../field/fieldValues/{face => faceSource}/faceSource.C | 0 .../field/fieldValues/{face => faceSource}/faceSource.H | 0 .../{face => faceSource}/faceSourceFunctionObject.C | 0 .../{face => faceSource}/faceSourceFunctionObject.H | 0 .../field/fieldValues/{face => faceSource}/faceSourceI.H | 0 .../{face => faceSource}/faceSourceTemplates.C | 0 15 files changed, 4 insertions(+), 4 deletions(-) rename src/postProcessing/functionObjects/field/fieldValues/{cell => cellSource}/IOcellSource.H (100%) rename src/postProcessing/functionObjects/field/fieldValues/{cell => cellSource}/cellSource.C (100%) rename src/postProcessing/functionObjects/field/fieldValues/{cell => cellSource}/cellSource.H (100%) rename src/postProcessing/functionObjects/field/fieldValues/{cell => cellSource}/cellSourceFunctionObject.C (100%) rename src/postProcessing/functionObjects/field/fieldValues/{cell => cellSource}/cellSourceFunctionObject.H (100%) rename src/postProcessing/functionObjects/field/fieldValues/{cell => cellSource}/cellSourceI.H (100%) rename src/postProcessing/functionObjects/field/fieldValues/{cell => cellSource}/cellSourceTemplates.C (100%) rename src/postProcessing/functionObjects/field/fieldValues/{face => faceSource}/IOfaceSource.H (100%) rename src/postProcessing/functionObjects/field/fieldValues/{face => faceSource}/faceSource.C (100%) rename src/postProcessing/functionObjects/field/fieldValues/{face => faceSource}/faceSource.H (100%) rename src/postProcessing/functionObjects/field/fieldValues/{face => faceSource}/faceSourceFunctionObject.C (100%) rename src/postProcessing/functionObjects/field/fieldValues/{face => faceSource}/faceSourceFunctionObject.H (100%) rename src/postProcessing/functionObjects/field/fieldValues/{face => faceSource}/faceSourceI.H (100%) rename src/postProcessing/functionObjects/field/fieldValues/{face => faceSource}/faceSourceTemplates.C (100%) diff --git a/src/postProcessing/functionObjects/field/Make/files b/src/postProcessing/functionObjects/field/Make/files index e950e4d4d5..6195b98a41 100644 --- a/src/postProcessing/functionObjects/field/Make/files +++ b/src/postProcessing/functionObjects/field/Make/files @@ -7,10 +7,10 @@ fieldMinMax/fieldMinMax.C fieldMinMax/fieldMinMaxFunctionObject.C fieldValues/fieldValue/fieldValue.C -fieldValues/face/faceSource.C -fieldValues/face/faceSourceFunctionObject.C -fieldValues/cell/cellSource.C -fieldValues/cell/cellSourceFunctionObject.C +fieldValues/faceSource/faceSource.C +fieldValues/faceSource/faceSourceFunctionObject.C +fieldValues/cellSource/cellSource.C +fieldValues/cellSource/cellSourceFunctionObject.C streamLine/streamLine.C streamLine/streamLineParticle.C diff --git a/src/postProcessing/functionObjects/field/fieldValues/cell/IOcellSource.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/IOcellSource.H similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/cell/IOcellSource.H rename to src/postProcessing/functionObjects/field/fieldValues/cellSource/IOcellSource.H diff --git a/src/postProcessing/functionObjects/field/fieldValues/cell/cellSource.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/cell/cellSource.C rename to src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.C diff --git a/src/postProcessing/functionObjects/field/fieldValues/cell/cellSource.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/cell/cellSource.H rename to src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSource.H diff --git a/src/postProcessing/functionObjects/field/fieldValues/cell/cellSourceFunctionObject.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceFunctionObject.C similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/cell/cellSourceFunctionObject.C rename to src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceFunctionObject.C diff --git a/src/postProcessing/functionObjects/field/fieldValues/cell/cellSourceFunctionObject.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceFunctionObject.H similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/cell/cellSourceFunctionObject.H rename to src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceFunctionObject.H diff --git a/src/postProcessing/functionObjects/field/fieldValues/cell/cellSourceI.H b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceI.H similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/cell/cellSourceI.H rename to src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceI.H diff --git a/src/postProcessing/functionObjects/field/fieldValues/cell/cellSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/cell/cellSourceTemplates.C rename to src/postProcessing/functionObjects/field/fieldValues/cellSource/cellSourceTemplates.C diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/IOfaceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/IOfaceSource.H similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/face/IOfaceSource.H rename to src/postProcessing/functionObjects/field/fieldValues/faceSource/IOfaceSource.H diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/face/faceSource.C rename to src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.C diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSource.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/face/faceSource.H rename to src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSource.H diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSourceFunctionObject.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceFunctionObject.C similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/face/faceSourceFunctionObject.C rename to src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceFunctionObject.C diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSourceFunctionObject.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceFunctionObject.H similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/face/faceSourceFunctionObject.H rename to src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceFunctionObject.H diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSourceI.H b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceI.H similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/face/faceSourceI.H rename to src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceI.H diff --git a/src/postProcessing/functionObjects/field/fieldValues/face/faceSourceTemplates.C b/src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C similarity index 100% rename from src/postProcessing/functionObjects/field/fieldValues/face/faceSourceTemplates.C rename to src/postProcessing/functionObjects/field/fieldValues/faceSource/faceSourceTemplates.C From 270db50f3c10018a744a38e1bd2847f4664e03a7 Mon Sep 17 00:00:00 2001 From: graham Date: Thu, 29 Oct 2009 11:59:15 +0000 Subject: [PATCH 7/9] Folder called 0.orig was missed from commit as caught by .gitignore. Now 0.org. --- .../interDyMFoam/ras/floatingObject/0.org/U | 42 +++++++++++++++ .../ras/floatingObject/0.org/alpha1 | 41 +++++++++++++++ .../ras/floatingObject/0.org/epsilon | 49 ++++++++++++++++++ .../interDyMFoam/ras/floatingObject/0.org/k | 43 ++++++++++++++++ .../interDyMFoam/ras/floatingObject/0.org/nut | 48 +++++++++++++++++ .../interDyMFoam/ras/floatingObject/0.org/p | 46 +++++++++++++++++ .../floatingObject/0.org/pointDisplacement | 51 +++++++++++++++++++ .../interDyMFoam/ras/floatingObject/Allrun | 2 +- 8 files changed, 321 insertions(+), 1 deletion(-) create mode 100644 tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/U create mode 100644 tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/alpha1 create mode 100644 tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/epsilon create mode 100644 tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/k create mode 100644 tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/nut create mode 100644 tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p create mode 100644 tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/pointDisplacement diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/U b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/U new file mode 100644 index 0000000000..2eee81b3a0 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/U @@ -0,0 +1,42 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format binary; + class volVectorField; + location "0"; + object U; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 -1 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + stationaryWalls + { + type fixedValue; + value uniform (0 0 0); + } + atmosphere + { + type pressureInletOutletVelocity; + value uniform (0 0 0); + } + floatingObject + { + type movingWallVelocity; + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/alpha1 b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/alpha1 new file mode 100644 index 0000000000..8b3768458d --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/alpha1 @@ -0,0 +1,41 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object alpha1; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 0 0 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + stationaryWalls + { + type zeroGradient; + } + atmosphere + { + type inletOutlet; + inletValue uniform 0; + value uniform 0; + } + floatingObject + { + type zeroGradient; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/epsilon b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/epsilon new file mode 100644 index 0000000000..849d3713a5 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/epsilon @@ -0,0 +1,49 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object epsilon; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -3 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + stationaryWalls + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.1; + } + atmosphere + { + type inletOutlet; + inletValue uniform 0.1; + value uniform 0.1; + } + floatingObject + { + type epsilonWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0.1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/k b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/k new file mode 100644 index 0000000000..84563be30c --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/k @@ -0,0 +1,43 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object k; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -2 0 0 0 0]; + +internalField uniform 0.1; + +boundaryField +{ + stationaryWalls + { + type kqRWallFunction; + value uniform 0.1; + } + atmosphere + { + type inletOutlet; + inletValue uniform 0.1; + value uniform 0.1; + } + floatingObject + { + type kqRWallFunction; + value uniform 0.1; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/nut b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/nut new file mode 100644 index 0000000000..a86c3e35e0 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/nut @@ -0,0 +1,48 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + location "0"; + object nut; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 2 -1 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + stationaryWalls + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } + atmosphere + { + type calculated; + value uniform 0; + } + floatingObject + { + type nutkWallFunction; + Cmu 0.09; + kappa 0.41; + E 9.8; + value uniform 0; + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p new file mode 100644 index 0000000000..b512720556 --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/p @@ -0,0 +1,46 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: http://www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class volScalarField; + object pd; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [1 -1 -2 0 0 0 0]; + +internalField uniform 0; + +boundaryField +{ + stationaryWalls + { + type buoyantPressure; + value uniform 0; + } + atmosphere + { + type totalPressure; + p0 uniform 0; + U U; + phi phi; + rho rho; + psi none; + gamma 1; + value uniform 0; + } + floatingObject + { + type buoyantPressure; + value uniform 0; + } +} + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/pointDisplacement b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/pointDisplacement new file mode 100644 index 0000000000..711e09e22d --- /dev/null +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/0.org/pointDisplacement @@ -0,0 +1,51 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.6 | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class pointVectorField; + location "0.01"; + object pointDisplacement; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +dimensions [0 1 0 0 0 0 0]; + +internalField uniform (0 0 0); + +boundaryField +{ + stationaryWalls + { + type fixedValue; + value uniform (0 0 0); + } + atmosphere + { + type fixedValue; + value uniform (0 0 0); + } + floatingObject + { + type sixDoFRigidBodyDisplacement; + centreOfMass (0.5 0.5 0.5); + momentOfInertia (0.08622222 0.8622222 0.144); + mass 9.6; + rhoInf 1; + Q (1 0 0 0 1 0 0 0 1); + v (0 0 0); + a (0 0 0); + pi (0 0 0); + tau (0 0 0); + value uniform (0 0 0); + } +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/interDyMFoam/ras/floatingObject/Allrun b/tutorials/multiphase/interDyMFoam/ras/floatingObject/Allrun index 1bece85bd9..7c7ab52940 100755 --- a/tutorials/multiphase/interDyMFoam/ras/floatingObject/Allrun +++ b/tutorials/multiphase/interDyMFoam/ras/floatingObject/Allrun @@ -20,7 +20,7 @@ makeMeshByCellSet() runApplication blockMesh makeMeshByCellSet 1 2 runApplication subsetMesh -overwrite c0 -patch floatingObject -cp -r 0.orig 0 > /dev/null 2>&1 +cp -r 0.org 0 > /dev/null 2>&1 runApplication setFields runApplication $application From 555c1ea30d8c497a7e7ac8ee530dd1042509f86e Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 29 Oct 2009 14:28:57 +0000 Subject: [PATCH 8/9] minor cosmetics --- applications/solvers/lagrangian/coalChemistryFoam/YEqn.H | 2 +- .../lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H | 2 +- applications/solvers/lagrangian/reactingParcelFoam/YEqn.H | 2 +- src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H index 5c84cfdb3f..abe03f60c0 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H @@ -14,7 +14,7 @@ tmp > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i > mvConvection label inertIndex = -1; volScalarField Yt = 0.0*Y[0]; - for (label i=0; i::janafThermo template inline void Foam::janafThermo::checkT(const scalar T) const { - if (T < Tlow_ || T > Thigh_) + if (T < Tlow_ || T > Thigh_) { FatalErrorIn ( From 0054d8d2941244dc9d23473aba11eb4ec12b07ec Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 30 Oct 2009 10:02:21 +0000 Subject: [PATCH 9/9] do not remove tangential component on pure rebound --- .../Kinematic/PatchInteractionModel/Rebound/Rebound.C | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C index 44d8915497..7c62bfda6e 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/Rebound/Rebound.C @@ -71,15 +71,12 @@ bool Foam::Rebound::correct nw /= mag(nw); scalar Un = U & nw; - vector Ut = U - Un*nw; if (Un > 0.0) { U -= UFactor_*2.0*Un*nw; } - U -= Ut; - return true; }