diff --git a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H index 1361c6441f1ec240207f83fb1af6bc217583c992..15aa4b9300fb6663531a259ba76ba80a8a525526 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/pEqn.H @@ -5,7 +5,7 @@ rho.relax(); U = rAU*UEqn().H(); -if (pimple.nCorrPIMPLE() <= 1) +if (pimple.nCorrPISO() <= 1) { UEqn.clear(); } diff --git a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H index cd10ed78e2fb08b3658da8ec4d9a50143d00e761..cb7ecaa29d7652134db213612e523a8803987ae8 100644 --- a/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H +++ b/applications/solvers/compressible/rhoPimpleFoam/rhoPorousMRFPimpleFoam/pEqn.H @@ -6,7 +6,7 @@ rho.relax(); volScalarField rAU(1.0/UEqn().A()); U = rAU*UEqn().H(); -if (pimple.nCorrPIMPLE() <= 1) +if (pimple.nCorrPISO() <= 1) { UEqn.clear(); } diff --git a/applications/solvers/incompressible/pimpleFoam/Make/options b/applications/solvers/incompressible/pimpleFoam/Make/options index 47d95d97ce91d5c824f02607061a438ec6061073..ecb86aecbcaffd36f52b0478b51c5dbff52ca64d 100644 --- a/applications/solvers/incompressible/pimpleFoam/Make/options +++ b/applications/solvers/incompressible/pimpleFoam/Make/options @@ -2,7 +2,8 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lincompressibleTransportModels \ diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/options b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/options index 47d95d97ce91d5c824f02607061a438ec6061073..ecb86aecbcaffd36f52b0478b51c5dbff52ca64d 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/options +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/Make/options @@ -2,7 +2,8 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/incompressible/turbulenceModel \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lincompressibleTransportModels \ diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C index ba222b5034a75b71caadea7d1184d5085e27836e..7085c5bd351f4957836ef768b7497630abe6112c 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/SRFPimpleFoam.C @@ -37,6 +37,7 @@ Description #include "turbulenceModel.H" #include "pimpleControl.H" #include "SRFModel.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/createFields.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/createFields.H index a6cff20e14249006eca5ae86f7c20745b90e68d0..5895a554429ea70e9f2aac70596632952c50cce5 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/createFields.H +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/createFields.H @@ -70,3 +70,6 @@ volVectorField U ), Urel + SRF->U() ); + + +IObasicSourceList sources(mesh); diff --git a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H index a8ade8c1cab8684c3a5e02f178cb5dcddbb1c79b..df3b09adc642da17702decfcd0e0d33f0296d840 100644 --- a/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/SRFPimpleFoam/pEqn.H @@ -1,7 +1,7 @@ volScalarField rAUrel(1.0/UrelEqn().A()); Urel = rAUrel*UrelEqn().H(); -if (pimple.nCorrPIMPLE() <= 1) +if (pimple.nCorrPISO() <= 1) { UrelEqn.clear(); } diff --git a/applications/solvers/incompressible/pimpleFoam/UEqn.H b/applications/solvers/incompressible/pimpleFoam/UEqn.H index 08c06d3f4615158b864d6a087d2e701033a5b2fe..4d5a99c8009ab76c0679fc25f2ca236b346a9bda 100644 --- a/applications/solvers/incompressible/pimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/UEqn.H @@ -7,6 +7,8 @@ tmp<fvVectorMatrix> UEqn + turbulence->divDevReff(U) ); +sources.apply(UEqn()); + UEqn().relax(); volScalarField rAU(1.0/UEqn().A()); diff --git a/applications/solvers/incompressible/pimpleFoam/createFields.H b/applications/solvers/incompressible/pimpleFoam/createFields.H index e4127150c0d8f3ffba6326ab3edd187434f94c98..bb4366cdd79583acb0121b50362d881431b3e850 100644 --- a/applications/solvers/incompressible/pimpleFoam/createFields.H +++ b/applications/solvers/incompressible/pimpleFoam/createFields.H @@ -40,3 +40,6 @@ autoPtr<incompressible::turbulenceModel> turbulence ( incompressible::turbulenceModel::New(U, phi, laminarTransport) ); + + +IObasicSourceList sources(mesh); diff --git a/applications/solvers/incompressible/pimpleFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pEqn.H index 2d6b37db6737acb05329b4d93c1dfc8f77829d8e..61acd7d69788d444525800cbce5ccf778af0e461 100644 --- a/applications/solvers/incompressible/pimpleFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pEqn.H @@ -1,6 +1,6 @@ U = rAU*UEqn().H(); -if (pimple.nCorrPIMPLE() <= 1) +if (pimple.nCorrPISO() <= 1) { UEqn.clear(); } diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H index 16b3bd977d07b6979d2cb84e5f12100cc8910921..701a3ff7330bdb62b8a2faedf2e017cd6d6f5daa 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/createFields.H @@ -56,3 +56,6 @@ runTime.deltaT(), zeroGradientFvPatchScalarField::typeName ); + + + IObasicSourceList sources(mesh); diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H index 5986a92adf0b74ea25127b435915b18af0cc3fe2..aeef26a83770ff7e235bf60f7ae15c0bd82417cb 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pEqn.H @@ -1,6 +1,6 @@ U = rAU*UEqn().H(); -if (pimple.nCorrPIMPLE() <= 1) +if (pimple.nCorrPISO() <= 1) { UEqn.clear(); } diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C index b2b0c48c13db92e9573b007ecb23409cbfde0605..03299b71bb767c1b6eb0ac2033145451bd224133 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleDyMFoam/pimpleDyMFoam.C @@ -37,6 +37,7 @@ Description #include "turbulenceModel.H" #include "dynamicFvMesh.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C index da5e2974c9bbe06c343af015aafee1488cfde034..8d581934fb2fb15fcacc52964ddf0493f80abef4 100644 --- a/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C +++ b/applications/solvers/incompressible/pimpleFoam/pimpleFoam.C @@ -36,6 +36,7 @@ Description #include "singlePhaseTransportModel.H" #include "turbulenceModel.H" #include "pimpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/simpleFoam/Allwmake b/applications/solvers/incompressible/simpleFoam/Allwmake index 79109c8f0430f95c703381228de79c026aa28d50..c73703955a90a1ac95d2b9cd909fdcc599d2e56b 100755 --- a/applications/solvers/incompressible/simpleFoam/Allwmake +++ b/applications/solvers/incompressible/simpleFoam/Allwmake @@ -6,7 +6,6 @@ wmake wmake SRFSimpleFoam wmake MRFSimpleFoam -wmake windSimpleFoam wmake porousSimpleFoam # ----------------------------------------------------------------- end-of-file diff --git a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/MRFSimpleFoam.C b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/MRFSimpleFoam.C index c0cc824b496a8cba70b138616ee08b33cfcb57da..0916d852ef7b0a1da4d586b775ef1f7a7e33d4dc 100644 --- a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/MRFSimpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/MRFSimpleFoam.C @@ -35,6 +35,7 @@ Description #include "RASModel.H" #include "MRFZones.H" #include "simpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/Make/options index 81310cc2e0a0ad38efd2c3dd77c2e8ba30e82181..057788a4837eda6718d27be47c366cc9309386ec 100644 --- a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/Make/options +++ b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/Make/options @@ -4,9 +4,11 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lincompressibleRASModels \ -lincompressibleTransportModels \ - -lfiniteVolume + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H index 27d50944ce6ef5083eabd1d95057836dfae4751d..dd23e3d221d94723f79bb34bbbfb2773ebf7417c 100644 --- a/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/simpleFoam/MRFSimpleFoam/UEqn.H @@ -3,10 +3,13 @@ tmp<fvVectorMatrix> UEqn ( fvm::div(phi, U) - + turbulence->divDevReff(U) + + turbulence->divDevReff(U) ); + mrfZones.addCoriolis(UEqn()); + sources.apply(UEqn()); + UEqn().relax(); solve(UEqn() == -fvc::grad(p)); diff --git a/applications/solvers/incompressible/simpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/Make/options index dbc45d38441620ef301c2b2830ae57fd7fb80773..23014d8748694a94f9a0fdd83409a3cfc079360f 100644 --- a/applications/solvers/incompressible/simpleFoam/Make/options +++ b/applications/solvers/incompressible/simpleFoam/Make/options @@ -3,10 +3,12 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/transportModels \ -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lincompressibleTurbulenceModel \ -lincompressibleRASModels \ -lincompressibleTransportModels \ - -lfiniteVolume + -lfiniteVolume \ + -lmeshTools diff --git a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/options index 66a349da05016555c33b72e1aaa14ac5b9e2d8e4..7f0cca618ce75442bd06331496f4fcc5d47499f2 100644 --- a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/options +++ b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/Make/options @@ -4,7 +4,8 @@ EXE_INC = \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel + -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ + -I$(LIB_SRC)/meshTools/lnInclude EXE_LIBS = \ -lincompressibleRASModels \ diff --git a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C index 7f1fef3946a47abd9349ad19d7a40462d1b29025..3631b154a6fa19a8f968fe9d247ff52dbacbbe45 100644 --- a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/SRFSimpleFoam.C @@ -35,6 +35,7 @@ Description #include "RASModel.H" #include "SRFModel.H" #include "simpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H index 38c64acb7bf35029a024f28ea379b203bb60d6c5..94380de28cd57b1ea12e70615b49624f09c72672 100644 --- a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H +++ b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/UrelEqn.H @@ -7,6 +7,8 @@ + SRF->Su() ); + sources.apply(UrelEqn()); + UrelEqn().relax(); solve(UrelEqn() == -fvc::grad(p)); diff --git a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H index a5d68368ea58b18ffa8498337c4dd1b58f508aef..0df5760babce6bd52ddb0fc41a60480df6e09ab8 100644 --- a/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H +++ b/applications/solvers/incompressible/simpleFoam/SRFSimpleFoam/createFields.H @@ -56,3 +56,5 @@ ( SRF::SRFModel::New(Urel) ); + + IObasicSourceList sources(mesh); diff --git a/applications/solvers/incompressible/simpleFoam/UEqn.H b/applications/solvers/incompressible/simpleFoam/UEqn.H index 0ee8abf0be9c78154b0e6ec7a894a3224ef82a13..df1d53a353b94afec71a9730f4d4eadc8efd9e43 100644 --- a/applications/solvers/incompressible/simpleFoam/UEqn.H +++ b/applications/solvers/incompressible/simpleFoam/UEqn.H @@ -6,6 +6,8 @@ + turbulence->divDevReff(U) ); + sources.apply(UEqn()); + UEqn().relax(); solve(UEqn() == -fvc::grad(p)); diff --git a/applications/solvers/incompressible/simpleFoam/createFields.H b/applications/solvers/incompressible/simpleFoam/createFields.H index 947da10c9d357a84850c37b2ae13f21ae9ab9499..97d40c3f0735ee9e3604f2d46ff79f685391d683 100644 --- a/applications/solvers/incompressible/simpleFoam/createFields.H +++ b/applications/solvers/incompressible/simpleFoam/createFields.H @@ -39,3 +39,5 @@ ( incompressible::RASModel::New(U, phi, laminarTransport) ); + + IObasicSourceList sources(mesh); diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H index a76c6db0fdbcbc27c162515eafab5089b86a0df9..2dd998c4849f2c4f885b67b184d276eb1ae2fe17 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/UEqn.H @@ -6,6 +6,8 @@ + turbulence->divDevReff(U) ); + sources.apply(UEqn()); + UEqn().relax(); // Include the porous media resistance and solve the momentum equation diff --git a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C index d4aaaf596a2ecbe206ee6962a514e3d3779b7ccd..ef10119a9e372f0f8c6023d75c5f14d5bbf3bc41 100644 --- a/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/porousSimpleFoam/porousSimpleFoam.C @@ -35,6 +35,7 @@ Description #include "RASModel.H" #include "porousZones.H" #include "simpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/simpleFoam/simpleFoam.C b/applications/solvers/incompressible/simpleFoam/simpleFoam.C index ebfd10bba2257379ad01e923fe314ef2a7cb1107..3b3d57998d12084811d267880803dea8fca0201d 100644 --- a/applications/solvers/incompressible/simpleFoam/simpleFoam.C +++ b/applications/solvers/incompressible/simpleFoam/simpleFoam.C @@ -33,6 +33,7 @@ Description #include "singlePhaseTransportModel.H" #include "RASModel.H" #include "simpleControl.H" +#include "IObasicSourceList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/Make/files b/applications/solvers/incompressible/simpleFoam/windSimpleFoam/Make/files deleted file mode 100644 index d7fe780806e6b3a4ef18b848716cf281485d2c7a..0000000000000000000000000000000000000000 --- a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -windSimpleFoam.C - -EXE = $(FOAM_APPBIN)/windSimpleFoam diff --git a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/windSimpleFoam/Make/options deleted file mode 100644 index 057788a4837eda6718d27be47c366cc9309386ec..0000000000000000000000000000000000000000 --- a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/Make/options +++ /dev/null @@ -1,14 +0,0 @@ -EXE_INC = \ - -I.. \ - -I$(LIB_SRC)/turbulenceModels \ - -I$(LIB_SRC)/turbulenceModels/incompressible/RAS/RASModel \ - -I$(LIB_SRC)/transportModels \ - -I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude - -EXE_LIBS = \ - -lincompressibleRASModels \ - -lincompressibleTransportModels \ - -lfiniteVolume \ - -lmeshTools diff --git a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/UEqn.H b/applications/solvers/incompressible/simpleFoam/windSimpleFoam/UEqn.H deleted file mode 100644 index 45fc95065b15b4bf90adcfda99bfa5b196352134..0000000000000000000000000000000000000000 --- a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/UEqn.H +++ /dev/null @@ -1,14 +0,0 @@ - // Solve the Momentum equation - - tmp<fvVectorMatrix> UEqn - ( - fvm::div(phi, U) - + turbulence->divDevReff(U) - ); - - // Add resistance on the actuation disks - actuationDisks.addSu(UEqn()); - - UEqn().relax(); - - solve(UEqn() == -fvc::grad(p)); diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C index 23c9e0322930dbc65a00e3c3b65e3450e5d46476..4c368e7cdd63cd73496df281f6aa0c8914b2597e 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/LTSReactingParcelFoam.C @@ -41,7 +41,7 @@ Description #include "rhoChemistryCombustionModel.H" #include "radiationModel.H" #include "porousZones.H" -#include "timeActivatedExplicitSource.H" +#include "IObasicSourceList.H" #include "SLGThermo.H" #include "fvcSmooth.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H index 9664c2a50de0bacb7f90c2fd211eb39a78eb291d..bf6f1418751e4d3e33ecd2b27380a1ddd394623d 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/UEqn.H @@ -7,9 +7,10 @@ == rho.dimensionedInternalField()*g + parcels.SU(U) - + momentumSource.Su() ); + sources.apply(UEqn); + pZones.addResistance(UEqn); if (pimple.momentumPredictor()) diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/YEqn.H index 625c940a663b63f83858861cf894e49bb04d0875..a5ee090d843cd91310283953fd0c517b2ec1b7c3 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/YEqn.H @@ -23,7 +23,7 @@ if (solveSpecies) { volScalarField& Yi = Y[i]; - solve + fvScalarMatrix YEqn ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) @@ -31,10 +31,12 @@ if (solveSpecies) == parcels.SYi(i, Yi) + combustion->R(Yi) - + massSource.Su(i), - mesh.solver("Yi") ); + sources.apply(YEqn); + + YEqn.solve(mesh.solver("Yi")); + Yi.max(0.0); Yt += Yi; } diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/createExplicitSources.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/createExplicitSources.H index 0f2b52e5361a0e7f5882ac4682e9e0a1f2ef257e..b2e5775e589ba78bb004f3469fcc52b6aec2384f 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/createExplicitSources.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/createExplicitSources.H @@ -1,27 +1,2 @@ -Info<< "Creating mass source\n" << endl; -scalarTimeActivatedExplicitSourceList massSource -( - "mass", - mesh, - dimMass/dimTime/dimVolume, - composition.species() -); - - -Info<< "Creating momentum source\n" << endl; -vectorTimeActivatedExplicitSourceList momentumSource -( - "momentum", - mesh, - dimMass*dimVelocity/dimTime/dimVolume, - "U" -); - -Info<< "Creating energy source\n" << endl; -scalarTimeActivatedExplicitSourceList energySource -( - "energy", - mesh, - dimEnergy/dimTime/dimVolume, - "h" -); +Info<< "Creating sources\n" << endl; +IObasicSourceList sources(mesh); diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/hsEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/hsEqn.H index 55bf1d6dd0cdc850c8bd6b3364d51631f0c1106e..c8c634bbd90957f866c73f700bf02f8af63a08ee 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/hsEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/hsEqn.H @@ -8,10 +8,11 @@ DpDt + parcels.Sh(hs) + radiation->Shs(thermo) - + energySource.Su() + combustion->Sh() ); + sources.apply(hsEqn); + hsEqn.solve(); thermo.correct(); diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H index d3aaed21efe1fe9999b4c93fdc8640165f9be751..5dc9058d9ef18d06bb37c4794960de0317ff2ac8 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/pEqn.H @@ -29,9 +29,10 @@ + fvc::div(phi) == parcels.Srho() - + massSource.SuTot() ); + sources.apply(pDDtEqn); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/rhoEqn.H index 97aa5b19294a89f606971cef8fb31e37882d95e2..829ad231e7ceee6fde2a63fd16ead767b353e4a1 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/rhoEqn.H @@ -36,9 +36,10 @@ Description + fvc::div(phi) == parcels.Srho(rho) - + massSource.SuTot() ); + sources.apply(rhoEqn); + rhoEqn.solve(); Info<< "rho min/max = " << min(rho).value() << ", " << max(rho).value() diff --git a/applications/solvers/lagrangian/LTSReactingParcelFoam/timeScales.H b/applications/solvers/lagrangian/LTSReactingParcelFoam/timeScales.H index 8c4b8a38e43c211c5aee0126c3dfb6e258485503..e61e6cdac7f775ce0b285e1492fdb2ebe0e0459f 100644 --- a/applications/solvers/lagrangian/LTSReactingParcelFoam/timeScales.H +++ b/applications/solvers/lagrangian/LTSReactingParcelFoam/timeScales.H @@ -76,7 +76,7 @@ Info<< "Time scales min/max:" << endl; ( DpDt + parcels.hsTrans()/(mesh.V()*runTime.deltaT()) - + energySource.Su() +// + energySource.Su() + combustion->Sh()() ) /rho diff --git a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H index e7f242fa5faab367a98684b9d5d560c781d76a27..2956bf99d8f22b36be5ef7df50f227fc8f944b17 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/UEqn.H @@ -9,6 +9,8 @@ + limestoneParcels.SU(U) ); + sources.apply(UEqn); + UEqn.relax(); if (pimple.momentumPredictor()) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H index e9bd1c6581b842fb1ccc9739d4c8370546d8fdc8..c6abcb4db5b930db2d42a06d266f899b843aa173 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/YEqn.H @@ -32,6 +32,8 @@ tmp<fv::convectionScheme<scalar> > mvConvection + combustion->R(Yi) ); + sources.apply(YiEqn); + YiEqn.relax(); YiEqn.solve(mesh.solver("Yi")); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C index 897f43e3c3efb0cf4260c8d5f7e711b5ea20dcbe..d6c61074e119ace542c4aa729b802cdbb6ea9ae0 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C +++ b/applications/solvers/lagrangian/coalChemistryFoam/coalChemistryFoam.C @@ -40,7 +40,7 @@ Description #include "basicThermoCloud.H" #include "coalCloud.H" #include "psiChemistryCombustionModel.H" -#include "timeActivatedExplicitSource.H" +#include "IObasicSourceList.H" #include "radiationModel.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H index 4d0a2b7408dc36caa486c9369b8ce7e6f31d582d..13e8d94e72431a3242bdecacf0482d7f6f608cd9 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/createFields.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/createFields.H @@ -122,14 +122,8 @@ fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p) ); - Info<< "\nConstructing explicit enthalpy source" << endl; - scalarTimeActivatedExplicitSourceList enthalpySource - ( - "energy", - mesh, - dimEnergy/dimTime/dimVolume, - "hs" - ); + Info<< "\nConstructing sources" << endl; + IObasicSourceList sources(mesh); volScalarField dQ ( diff --git a/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H index 9a4665accdbb10927c30b4d88f230dfb0af7adad..fa9f3a0a44550f5dcbeb67555a8dad4b5d1222ec 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/hsEqn.H @@ -9,10 +9,11 @@ + combustion->Sh() + coalParcels.Sh(hs) + limestoneParcels.Sh(hs) - + enthalpySource.Su() + radiation->Shs(thermo) ); + sources.apply(hsEqn); + hsEqn.relax(); hsEqn.solve(); diff --git a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H index 73e56f07c5d9f2c606eebc75d39d33bf570ed5ed..5ef8472210eb2bcf124585917ad258d39adcfa6f 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/pEqn.H @@ -26,6 +26,8 @@ if (pimple.transonic()) coalParcels.Srho() ); + sources.apply(pEqn); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) @@ -54,6 +56,8 @@ else coalParcels.Srho() ); + sources.apply(pEqn); + pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter()))); if (pimple.finalNonOrthogonalIter()) diff --git a/applications/solvers/lagrangian/coalChemistryFoam/rhoEqn.H b/applications/solvers/lagrangian/coalChemistryFoam/rhoEqn.H index aa20ed2bf59a94b0133e590442bc111145450848..8902cc95a8c960a4ef1925e66cb2150400bed16f 100644 --- a/applications/solvers/lagrangian/coalChemistryFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/coalChemistryFoam/rhoEqn.H @@ -30,13 +30,17 @@ Description \*---------------------------------------------------------------------------*/ { - solve + fvScalarMatrix rhoEqn ( fvm::ddt(rho) + fvc::div(phi) == coalParcels.Srho(rho) ); + + sources.apply(rhoEqn); + + rhoEqn.solve(); } // ************************************************************************* // diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H index e52431f1e883cb473f47fc4fa52f5b6815304ecf..a89058d2b584625ffb51e9395e5c108faa1e8ef8 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/UEqn.H @@ -7,9 +7,10 @@ == rho.dimensionedInternalField()*g + parcels.SU(U) - + momentumSource.Su() ); + sources.apply(UEqn); + pZones.addResistance(UEqn); if (pimple.momentumPredictor()) diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H index 5ef4aaa3a351fa79fd3bfb24ac8144ca112c24c4..8811a5ffe3ae74082b793aee61856a4dc81eb4fa 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/YEqn.H @@ -24,7 +24,7 @@ if (solveSpecies) { volScalarField& Yi = Y[i]; - solve + fvScalarMatrix YiEqn ( fvm::ddt(rho, Yi) + mvConvection->fvmDiv(phi, Yi) @@ -32,10 +32,12 @@ if (solveSpecies) == parcels.SYi(i, Yi) + combustion->R(Yi) - + massSource.Su(i), - mesh.solver("Yi") ); + sources.apply(YiEqn); + + YiEqn.solve(mesh.solver("Yi")); + Yi.max(0.0); Yt += Yi; } diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createExplicitSources.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createExplicitSources.H index 0f2b52e5361a0e7f5882ac4682e9e0a1f2ef257e..b2e5775e589ba78bb004f3469fcc52b6aec2384f 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createExplicitSources.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/createExplicitSources.H @@ -1,27 +1,2 @@ -Info<< "Creating mass source\n" << endl; -scalarTimeActivatedExplicitSourceList massSource -( - "mass", - mesh, - dimMass/dimTime/dimVolume, - composition.species() -); - - -Info<< "Creating momentum source\n" << endl; -vectorTimeActivatedExplicitSourceList momentumSource -( - "momentum", - mesh, - dimMass*dimVelocity/dimTime/dimVolume, - "U" -); - -Info<< "Creating energy source\n" << endl; -scalarTimeActivatedExplicitSourceList energySource -( - "energy", - mesh, - dimEnergy/dimTime/dimVolume, - "h" -); +Info<< "Creating sources\n" << endl; +IObasicSourceList sources(mesh); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H index 0e2c61a9ff1b6e8682403b1d2281963f18506042..d15dd3367ecc0f43a9ac3728e0ac7b77128fd158 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/hsEqn.H @@ -29,7 +29,7 @@ } { - solve + fvScalarMatrix hsEqn ( fvm::ddt(rho, hs) + mvConvection->fvmDiv(phi, hs) @@ -38,10 +38,13 @@ pWork() + parcels.Sh(hs) + radiation->Shs(thermo) - + energySource.Su() + combustion->Sh() ); + sources.apply(hsEqn); + + hsEqn.solve(); + thermo.correct(); radiation->correct(); diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H index b6e69acead325bf7adc337fab4099059a4134be2..581c03e10434def70f53ca66a56e76eb54837f58 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/pEqn.H @@ -29,9 +29,10 @@ + fvc::div(phi) == parcels.Srho() - + massSource.SuTot() ); + sources.apply(pDDtEqn); + while (pimple.correctNonOrthogonal()) { fvScalarMatrix pEqn diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C index 19d7e96d13f4dab7bda58ae383696e7869504e1b..8d97ec99ff21a0a538e37083883afa542179b11e 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/porousExplicitSourceReactingParcelFoam.C @@ -45,7 +45,7 @@ Description #include "rhoChemistryCombustionModel.H" #include "radiationModel.H" #include "porousZones.H" -#include "timeActivatedExplicitSource.H" +#include "IObasicSourceList.H" #include "SLGThermo.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H index 100aa179c335eb0a34afda6aecc885110a2a89a0..d5d36f7c5f6bcbd3b07240bcbf915720e698be6a 100644 --- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H +++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/rhoEqn.H @@ -36,9 +36,10 @@ Description + fvc::div(phi) == parcels.Srho(rho) - + massSource.SuTot() ); + sources.apply(rhoEqn); + rhoEqn.solve(); } diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H index c8e3ccba5611cd6eced4965bad4ffaf3e79e8041..762245abf48b4d5dc677a1f454500ebf429af400 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readMechanicalProperties.H @@ -13,71 +13,177 @@ ); const dictionary& rhoDict(mechanicalProperties.subDict("rho")); - word rhoType(rhoDict.lookup("rho")); + word rhoType(rhoDict.lookup("type")); - volScalarField rho + autoPtr<volScalarField> rhoPtr; + + IOobject rhoIO ( - IOobject - ( - "rho", - runTime.timeName(), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ), + "rho", + runTime.timeName(0), mesh, - dimensionedScalar("zero", dimMass/dimVolume, 0.0) + IOobject::NO_READ, + IOobject::NO_WRITE ); - if (rhoType == "rhoInf") + if (rhoType == "uniform") { - rho = rhoDict.lookup("rhoInf"); + scalar rhoValue(readScalar(rhoDict.lookup("value"))); + + rhoPtr.reset + ( + new volScalarField + ( + rhoIO, + mesh, + dimensionedScalar + ( + "rho", + dimMass/dimVolume, + rhoValue + ), + zeroGradientFvPatchField<scalar>::typeName + ) + ); } + else if (rhoType == "field") + { + rhoIO.readOpt() = IOobject::MUST_READ; - volScalarField rhoE - ( - IOobject + rhoPtr.reset ( - "E", - runTime.timeName(0), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ), + new volScalarField + ( + rhoIO, + mesh + ) + ); + } + else + { + FatalErrorIn + ( + "readMechanicalProperties.H" + ) << "Valid type entries are uniform or field for rho" + << abort(FatalError); + } + + volScalarField& rho = rhoPtr(); + + const dictionary& EDict(mechanicalProperties.subDict("E")); + word EType(EDict.lookup("type")); + + autoPtr<volScalarField> EPtr; + + IOobject EIO + ( + "E", + runTime.timeName(0), mesh, - dimensionedScalar("0", dimMass/dimLength/sqr(dimTime), 0.0) + IOobject::NO_READ, + IOobject::NO_WRITE ); - const dictionary& EDict(mechanicalProperties.subDict("E")); - word EType(EDict.lookup("E")); - if (EType == "EInf") + if (EType == "uniform") { - rhoE = EDict.lookup("EInf"); + scalar rhoEValue(readScalar(EDict.lookup("value"))); + + EPtr.reset + ( + new volScalarField + ( + EIO, + mesh, + dimensionedScalar + ( + "Erho", + dimMass/dimLength/sqr(dimTime), + rhoEValue + ), + zeroGradientFvPatchField<scalar>::typeName + ) + ); + } + else if (EType == "field") + { + EIO.readOpt() = IOobject::MUST_READ; + + EPtr.reset + ( + new volScalarField + ( + EIO, + mesh + ) + ); } + else + { + FatalErrorIn + ( + "readMechanicalProperties.H" + ) << "Valid type entries are uniform or field for E" + << abort(FatalError); + } + + volScalarField& rhoE = EPtr(); + autoPtr<volScalarField> nuPtr; - volScalarField nu + IOobject nuIO ( - IOobject - ( - "nu", - runTime.timeName(0), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ), + "nu", + runTime.timeName(0), mesh, - dimensionedScalar("0", dimless, 0.0) + IOobject::NO_READ, + IOobject::NO_WRITE ); const dictionary& nuDict(mechanicalProperties.subDict("nu")); - word nuType(nuDict.lookup("nu")); + word nuType(nuDict.lookup("type")); - if (nuType == "nuInf") + if (nuType == "uniform") + { + scalar nuValue(readScalar(nuDict.lookup("value"))); + nuPtr.reset + ( + new volScalarField + ( + nuIO, + mesh, + dimensionedScalar + ( + "nu", + dimless, + nuValue + ), + zeroGradientFvPatchField<scalar>::typeName + ) + ); + } + else if(nuType == "field") { - nu = nuDict.lookup("nuInf"); + nuIO.readOpt() = IOobject::MUST_READ; + nuPtr.reset + ( + new volScalarField + ( + nuIO, + mesh + ) + ); + } + else + { + FatalErrorIn + ( + "readMechanicalProperties.H" + ) << "Valid type entries are uniform or field for nu" + << abort(FatalError); } + volScalarField& nu = nuPtr(); + Info<< "Normalising E : E/rho\n" << endl; volScalarField E = rhoE/rho; diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H b/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H index 4d7bb43fc95905006ce40a9f6350601784f6b7ef..54ac7d6db901265c216b8922c99ff9b26683262d 100644 --- a/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H +++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/readThermalProperties.H @@ -46,70 +46,180 @@ volScalarField DT if (thermalStress) { - volScalarField C + + autoPtr<volScalarField> CPtr; + + IOobject CIO ( - IOobject - ( - "C", - runTime.timeName(0), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ), + "C", + runTime.timeName(0), mesh, - dimensionedScalar("0", dimensionSet(0, 2, -2 , -1, 0), 0.0) + IOobject::NO_READ, + IOobject::NO_WRITE ); const dictionary& CDict(thermalProperties.subDict("C")); - word CType(CDict.lookup("C")); - if (CType == "CInf") + word CType(CDict.lookup("type")); + if (CType == "uniform") + { + scalar CValue(readScalar(CDict.lookup("value"))); + + CPtr.reset + ( + new volScalarField + ( + CIO, + mesh, + dimensionedScalar + ( + "C", + dimensionSet(0, 2, -2 , -1, 0), + CValue + ), + zeroGradientFvPatchField<scalar>::typeName + ) + ); + + } + else if(CType == "field") + { + CIO.readOpt() = IOobject::MUST_READ; + + CPtr.reset + ( + new volScalarField + ( + CIO, + mesh + ) + ); + } + else { - C = CDict.lookup("CInf"); + FatalErrorIn + ( + "readThermalProperties.H" + ) << "Valid type entries are uniform or field for C" + << abort(FatalError); } + volScalarField& C = CPtr(); + + autoPtr<volScalarField> rhoKPtr; - volScalarField rhoK + IOobject rhoKIO ( - IOobject - ( - "k", - runTime.timeName(0), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ), + "k", + runTime.timeName(0), mesh, - dimensionedScalar("0", dimensionSet(1, 1, -3 , -1, 0), 0.0) + IOobject::NO_READ, + IOobject::NO_WRITE ); const dictionary& kDict(thermalProperties.subDict("k")); - word kType(kDict.lookup("k")); - if (kType == "kInf") + word kType(kDict.lookup("type")); + if (kType == "uniform") + { + scalar rhoKValue(readScalar(kDict.lookup("value"))); + + rhoKPtr.reset + ( + new volScalarField + ( + rhoKIO, + mesh, + dimensionedScalar + ( + "rhoK", + dimensionSet(1, 1, -3 , -1, 0), + rhoKValue + ), + zeroGradientFvPatchField<scalar>::typeName + ) + ); + + } + else if (kType == "field") { - rhoK = kDict.lookup("kInf"); + rhoKIO.readOpt() = IOobject::MUST_READ; + + rhoKPtr.reset + ( + new volScalarField + ( + rhoKIO, + mesh + ) + ); } + else + { + FatalErrorIn + ( + "readThermalProperties.H" + ) << "Valid type entries are uniform or field for K" + << abort(FatalError); + } + + volScalarField& rhoK = rhoKPtr(); + + autoPtr<volScalarField> alphaPtr; - volScalarField alpha + IOobject alphaIO ( - IOobject - ( - "alpha", - runTime.timeName(0), - mesh, - IOobject::READ_IF_PRESENT, - IOobject::NO_WRITE - ), + "alpha", + runTime.timeName(0), mesh, - dimensionedScalar("0", dimensionSet(0, 0, 0 , -1, 0), 0.0) + IOobject::NO_READ, + IOobject::NO_WRITE ); + const dictionary& alphaDict(thermalProperties.subDict("alpha")); - word alphaType(alphaDict.lookup("alpha")); + word alphaType(alphaDict.lookup("type")); - if (alphaType == "alphaInf") + if (alphaType == "uniform") { - alpha = alphaDict.lookup("alphaInf"); + scalar alphaValue(readScalar(alphaDict.lookup("value"))); + alphaPtr.reset + ( + new volScalarField + ( + alphaIO, + mesh, + dimensionedScalar + ( + "alpha", + inv(dimTemperature), + alphaValue + ), + zeroGradientFvPatchField<scalar>::typeName + ) + ); } + else if (alphaType == "field") + { + alphaIO.readOpt() = IOobject::MUST_READ; + + alphaPtr.reset + ( + new volScalarField + ( + alphaIO, + mesh + ) + ); + } + else + { + FatalErrorIn + ( + "readThermalProperties.H" + ) << "Valid type entries are uniform or field for alpha" + << abort(FatalError); + } + + volScalarField& alpha = alphaPtr(); Info<< "Normalising k : k/rho\n" << endl; volScalarField k = rhoK/rho; diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C index 8aff8879e7200a53f5da730302196390ecbc2178..47a20059928bba9d2d8e92b613e35b56dded2009 100644 --- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C +++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C @@ -150,13 +150,18 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs() "mechanicalProperties" ); - dimensionedScalar rho(mechanicalProperties.lookup("rho")); - dimensionedScalar rhoE(mechanicalProperties.lookup("E")); - dimensionedScalar nu(mechanicalProperties.lookup("nu")); + const fvPatchField<scalar>& rho = + patch().lookupPatchField<volScalarField, scalar>("rho"); - dimensionedScalar E = rhoE/rho; - dimensionedScalar mu = E/(2.0*(1.0 + nu)); - dimensionedScalar lambda = nu*E/((1.0 + nu)*(1.0 - 2.0*nu)); + const fvPatchField<scalar>& rhoE = + patch().lookupPatchField<volScalarField, scalar>("E"); + + const fvPatchField<scalar>& nu = + patch().lookupPatchField<volScalarField, scalar>("nu"); + + scalarField E = rhoE/rho; + scalarField mu = E/(2.0*(1.0 + nu)); + scalarField lambda = nu*E/((1.0 + nu)*(1.0 - 2.0*nu)); Switch planeStress(mechanicalProperties.lookup("planeStress")); @@ -175,8 +180,8 @@ void tractionDisplacementCorrectionFvPatchVectorField::updateCoeffs() gradient() = ( - (traction_ + pressure_*n)/rho.value() - (n & (sigmaD + sigmaExp)) - )/(2.0*mu + lambda).value(); + (traction_ + pressure_*n)/rho - (n & (sigmaD + sigmaExp)) + )/(2.0*mu + lambda); fixedGradientFvPatchVectorField::updateCoeffs(); } diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index d30f23b9bde4297d45bca901fbdb0d30b7d08768..0eed2c9f4be9e343a2ed02e89eeae526bf84605c 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -378,19 +378,18 @@ $(SRF)/SRFModel/rpm/rpm.C $(SRF)/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C $(SRF)/derivedFvPatchFields/SRFFreestreamVelocityFvPatchVectorField/SRFFreestreamVelocityFvPatchVectorField.C -fieldSources = $(general)/fieldSources -$(fieldSources)/pressureGradientExplicitSource/pressureGradientExplicitSource.C -$(fieldSources)/timeActivatedExplicitSource/timeActivatedExplicitSource.C - basicSource = $(general)/fieldSources/basicSource $(basicSource)/basicSource/basicSource.C $(basicSource)/basicSource/basicSourceIO.C $(basicSource)/basicSource/basicSourceList.C $(basicSource)/basicSource/IObasicSourceList.C -$(basicSource)/actuationDiskSource/actuationDiskSource.C -$(basicSource)/radialActuationDiskSource/radialActuationDiskSource.C + +$(basicSource)/pressureGradientExplicitSource/pressureGradientExplicitSource.C +$(basicSource)/pressureGradientExplicitSource/pressureGradientExplicitSourceIO.C + $(basicSource)/explicitSource/explicitSource.C $(basicSource)/explicitSetValue/explicitSetValue.C + $(basicSource)/rotorDiskSource/rotorDiskSource.C $(basicSource)/rotorDiskSource/bladeModel/bladeModel.C $(basicSource)/rotorDiskSource/profileModel/profileModel.C @@ -398,5 +397,7 @@ $(basicSource)/rotorDiskSource/profileModel/profileModelList.C $(basicSource)/rotorDiskSource/profileModel/lookup/lookupProfile.C $(basicSource)/rotorDiskSource/profileModel/series/seriesProfile.C +$(basicSource)/actuationDiskSource/actuationDiskSource.C +$(basicSource)/radialActuationDiskSource/radialActuationDiskSource.C LIB = $(FOAM_LIBBIN)/libfiniteVolume diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.C index e7e996d1db9784c8a07821fdf425c03c25cca17f..68f0c2a5bf926e1812886b95de3a6ea9f5bfb42e 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.C @@ -35,7 +35,12 @@ License namespace Foam { defineTypeNameAndDebug(actuationDiskSource, 0); - addToRunTimeSelectionTable(basicSource, actuationDiskSource, dictionary); + addToRunTimeSelectionTable + ( + basicSource, + actuationDiskSource, + dictionary + ); } @@ -75,12 +80,14 @@ Foam::actuationDiskSource::actuationDiskSource ) : basicSource(name, modelType, dict, mesh), - coeffs_(dict.subDict(modelType + "Coeffs")), diskDir_(coeffs_.lookup("diskDir")), Cp_(readScalar(coeffs_.lookup("Cp"))), Ct_(readScalar(coeffs_.lookup("Ct"))), diskArea_(readScalar(coeffs_.lookup("diskArea"))) { + coeffs_.lookup("fieldNames") >> fieldNames_; + applied_.setSize(fieldNames_.size(), false); + Info<< " - creating actuation disk zone: " << this->name() << endl; @@ -90,17 +97,21 @@ Foam::actuationDiskSource::actuationDiskSource // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::actuationDiskSource::addSu(fvMatrix<vector>& UEqn) +void Foam::actuationDiskSource::addSup +( + fvMatrix<vector>& eqn, + const label fieldI +) { bool compressible = false; - if (UEqn.dimensions() == dimensionSet(1, 1, -2, 0, 0)) + if (eqn.dimensions() == dimForce) { compressible = true; } - const scalarField& cellsV = this->mesh().V(); - vectorField& Usource = UEqn.source(); - const vectorField& U = UEqn.psi(); + const scalarField& cellsV = mesh_.V(); + vectorField& Usource = eqn.source(); + const vectorField& U = eqn.psi(); if (V() > VSMALL) { @@ -111,7 +122,7 @@ void Foam::actuationDiskSource::addSu(fvMatrix<vector>& UEqn) Usource, cells_, cellsV, - this->mesh().lookupObject<volScalarField>("rho"), + mesh_.lookupObject<volScalarField>("rho"), U ); } @@ -141,7 +152,6 @@ bool Foam::actuationDiskSource::read(const dictionary& dict) { if (basicSource::read(dict)) { - coeffs_ = dict.subDict(typeName + "Coeffs"); coeffs_.readIfPresent("diskDir", diskDir_); coeffs_.readIfPresent("Cp", Cp_); coeffs_.readIfPresent("Ct", Ct_); diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.H index cbe98ea4c8d24e2489a9691c24931256bbe11138..077442589258e6d73bdf45a31d511af6225abb57 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/actuationDiskSource/actuationDiskSource.H @@ -26,16 +26,30 @@ Class Foam::actuationDiskSource Description - Actuation disk zone definition. + Actuation disk source + Constant values for momentum source for actuation disk - T = 2*rho*A*sqr(Uo)*a*(1-a) - U1 = (1 -a)Uo + T = 2*rho*A*sqr(Uo)*a*(1-a) + U1 = (1 -a)Uo + where: - A: disk area - Uo: upstream velocity - a: 1 - Cp/Ct - U1: velocity at the disk + A: disk area + Uo: upstream velocity + a: 1 - Cp/Ct + U1: velocity at the disk + + Sources described by: + + actuationDiskSourceCoeffs + { + fieldNames (U); // names of fields to apply source + diskDir (-1 0 0); // disk direction + Cp 0.1; // power coefficient + Ct 0.5; // thrust coefficient + diskArea 5.0; // disk area + } + SourceFiles actuationDiskSource.C @@ -46,14 +60,6 @@ SourceFiles #ifndef actuationDiskSource_H #define actuationDiskSource_H -#include "IOdictionary.H" -#include "coordinateSystem.H" -#include "coordinateSystems.H" -#include "wordList.H" -#include "labelList.H" -#include "DimensionedField.H" -#include "volFieldsFwd.H" -#include "fvMatricesFwd.H" #include "basicSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -74,9 +80,6 @@ protected: // Protected data - //- Coefficients dictionary - dictionary coeffs_; - //- Disk area normal vector diskDir_; @@ -169,11 +172,8 @@ public: // Public Functions - //-Source term to fvMatrix<vector> - virtual void addSu(fvMatrix<vector>& UEqn); - - //-Source term to fvMatrix<scalar> - virtual void addSu(fvMatrix<scalar>& UEqn){} + //- Source term to fvMatrix<vector> + virtual void addSup(fvMatrix<vector>& eqn, const label fieldI); // I-O diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/IObasicSourceList.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/IObasicSourceList.C index 0c8695edca3d2eacf9c11345873b553e08897583..d69bffa1eceb3f96b4db3957695aea49304f4510 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/IObasicSourceList.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/IObasicSourceList.C @@ -24,6 +24,41 @@ License \*---------------------------------------------------------------------------*/ #include "IObasicSourceList.H" +#include "fvMesh.H" +#include "Time.H" + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // + +Foam::IOobject Foam::IObasicSourceList::createIOobject +( + const fvMesh& mesh +) const +{ + IOobject io + ( + "sourcesProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (io.headerOk()) + { + Info<< "Creating field source list from " << io.name() << nl << endl; + + io.readOpt() = IOobject::MUST_READ_IF_MODIFIED; + return io; + } + else + { + Info<< "No field sources present" << nl << endl; + + io.readOpt() = IOobject::NO_READ; + return io; + } +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -32,17 +67,7 @@ Foam::IObasicSourceList::IObasicSourceList const fvMesh& mesh ) : - IOdictionary - ( - IOobject - ( - "sourcesProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ), + IOdictionary(createIOobject(mesh)), basicSourceList(mesh, *this) {} diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/IObasicSourceList.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/IObasicSourceList.H index a3c407814b6db6620fb089942d747362b10df08e..9b915899fb059a8519e94286192cf973d08578cb 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/IObasicSourceList.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/IObasicSourceList.H @@ -57,6 +57,9 @@ private: // Private Member Functions + //- Create IO object if dictionary is present + IOobject createIOobject(const fvMesh& mesh) const; + //- Disallow default bitwise copy construct IObasicSourceList(const IObasicSourceList&); diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C index c59b203618a3c8cdb8a92b07b0e56aa1f8055442..5f454974f2fac571a1173335681be93a81185b0c 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.C @@ -25,19 +25,16 @@ License #include "basicSource.H" #include "fvMesh.H" -#include "volFields.H" +#include "fvMatrices.H" #include "addToRunTimeSelectionTable.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { defineTypeNameAndDebug(basicSource, 0); defineRunTimeSelectionTable(basicSource, dictionary); - - // * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // - template<> const char* NamedEnum < basicSource::selectionModeType, @@ -120,12 +117,9 @@ void Foam::basicSource::setCellSet() label globalCellI = returnReduce(cellI, maxOp<label>()); if (globalCellI < 0) { - WarningIn - ( - "TimeActivatedExplicitSource<Type>::setCellIds()" - ) - << "Unable to find owner cell for point " << points_[i] - << endl; + WarningIn("basicSource::setCellIds()") + << "Unable to find owner cell for point " << points_[i] + << endl; } @@ -152,7 +146,7 @@ void Foam::basicSource::setCellSet() label zoneID = mesh_.cellZones().findZoneID(cellSetName_); if (zoneID == -1) { - FatalErrorIn("basicSource<Type>::setCellIds()") + FatalErrorIn("basicSource::setCellIds()") << "Cannot find cellZone " << cellSetName_ << endl << "Valid cellZones are " << mesh_.cellZones().names() << exit(FatalError); @@ -170,7 +164,7 @@ void Foam::basicSource::setCellSet() } default: { - FatalErrorIn("basicSource<Type>::setCellIds()") + FatalErrorIn("basicSource::setCellIds()") << "Unknown selectionMode " << selectionModeTypeNames_[selectionMode_] << ". Valid selectionMode types are" << selectionModeTypeNames_ @@ -205,6 +199,7 @@ Foam::basicSource::basicSource name_(name), mesh_(mesh), dict_(dict), + coeffs_(dict.subDict(modelType + "Coeffs")), active_(readBool(dict_.lookup("active"))), timeStart_(readScalar(dict_.lookup("timeStart"))), duration_(readScalar(dict_.lookup("duration"))), @@ -213,7 +208,9 @@ Foam::basicSource::basicSource selectionModeTypeNames_.read(dict_.lookup("selectionMode")) ), cellSetName_("none"), - V_(0.0) + V_(0.0), + fieldNames_(), + applied_() { setSelection(dict_); @@ -226,13 +223,13 @@ Foam::basicSource::basicSource Foam::autoPtr<Foam::basicSource> Foam::basicSource::New ( const word& name, - const dictionary& dict, + const dictionary& coeffs, const fvMesh& mesh ) { - word modelType(dict.lookup("type")); + word modelType(coeffs.lookup("type")); - Info<< "Selecting model type " << modelType << endl; + Info<< "Selecting source model type " << modelType << endl; dictionaryConstructorTable::iterator cstrIter = dictionaryConstructorTablePtr_->find(modelType); @@ -241,16 +238,16 @@ Foam::autoPtr<Foam::basicSource> Foam::basicSource::New { FatalErrorIn ( - "basicSource::New(const volVectorField&, " - "const surfaceScalarField&, transportModel&)" + "basicSource::New" + "(const name&, const dictionary&, const fvMesh&)" ) << "Unknown Model type " << modelType << nl << nl - << "Valid model types are :" << nl + << "Valid model types are:" << nl << dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError); } - return autoPtr<basicSource>(cstrIter()(name, modelType, dict, mesh)); + return autoPtr<basicSource>(cstrIter()(name, modelType, coeffs, mesh)); } @@ -279,21 +276,103 @@ bool Foam::basicSource::isActive() } -void Foam::basicSource::addSu(Foam::fvMatrix<vector>& Eqn) +Foam::label Foam::basicSource::applyToField(const word& fieldName) const +{ + forAll(fieldNames_, i) + { + if (fieldNames_[i] == fieldName) + { + return i; + } + } + + return -1; +} + + +void Foam::basicSource::checkApplied() const +{ + forAll(applied_, i) + { + if (!applied_[i]) + { + WarningIn("void Foam::basicSource::checkApplied() const") + << "Source " << name_ << " defined for field " + << fieldNames_[i] << " but never used" << endl; + } + } +} + + +void Foam::basicSource::addSup(fvMatrix<scalar>& eqn, const label fieldI) +{ + // do nothing +} + + +void Foam::basicSource::addSup(fvMatrix<vector>& eqn, const label fieldI) +{ + // do nothing +} + + +void Foam::basicSource::addSup +( + fvMatrix<sphericalTensor>& eqn, + const label fieldI +) +{ + // do nothing +} + + +void Foam::basicSource::addSup(fvMatrix<symmTensor>& eqn, const label fieldI) { - notImplemented("Foam::basicSource addSu(Foam::fvMatrix<vector>& Eqn)"); + // do nothing } -void Foam::basicSource::addSu(Foam::fvMatrix<scalar>& Eqn) +void Foam::basicSource::addSup(fvMatrix<tensor>& eqn, const label fieldI) +{ + // do nothing +} + + +void Foam::basicSource::setValue(fvMatrix<scalar>& eqn, const label fieldI) +{ + // do nothing +} + + +void Foam::basicSource::setValue(fvMatrix<vector>& eqn, const label fieldI) +{ + // do nothing +} + + +void Foam::basicSource::setValue +( + fvMatrix<sphericalTensor>& eqn, + const label fieldI +) +{ + // do nothing +} + + +void Foam::basicSource::setValue +( + fvMatrix<symmTensor>& eqn, + const label fieldI +) { - notImplemented("Foam::basicSource addSu(Foam::fvMatrix<scalar>& Eqn)"); + // do nothing } -void Foam::basicSource::setValue(Foam::fvMatrix<scalar>& Eqn) +void Foam::basicSource::setValue(fvMatrix<tensor>& eqn, const label fieldI) { - notImplemented("Foam::basicSource setValue(Foam::fvMatrix<scalar>& Eqn)"); + // do nothing } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.H index 9862282479b3c0db10e3c4857353c9335f003540..c70a2ba2670adfa4732a4d2498ec4ebd98ffd385 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSource.H @@ -25,52 +25,14 @@ Class Foam::basicSource Description - Basic source abtract class + Field source abtract base class. Provides a base set of controls, e.g. - Sources described by: + type scalarExplicitSource // source type + active on; // on/off switch + timeStart 0.0; // start time + duration 1000.0; // duration + selectionMode cellSet; // cellSet // points //cellZone - source1 - { - type actuationDiskSource; // explicitSource - active on; // on/off switch - timeStart 0.0; // start time - duration 1000.0; // duration - selectionMode cellSet; // cellSet // points //cellZone - cellSet c0; // cellSet name - - actuationDiskSourceCoeffs - { - diskDir (-1 0 0); // orientation of the disk - Cp 0.53; // Cp - Ct 0.58; // Ct - diskArea 40; // disk area - } - } - - source2 - { - type explicitSource; - active on; - timeStart 0.0; - duration 1000.0; - selectionMode points; - cellSet c0; - - points // list of points when selectionMode = points - ( - (-0.088 0.007 -0.02) - (-0.028 0.007 -0.02) - ); - explicitSourceCoeffs - { - volumeMode specific; //absolute - fieldData //field data - { - k 30.7; - epsilon 1.5; - } - } - } SourceFiles basicSource.C @@ -81,10 +43,8 @@ SourceFiles #ifndef basicSource_H #define basicSource_H -#include "fvMatrices.H" +#include "fvMatricesFwd.H" #include "cellSet.H" -#include "volFieldsFwd.H" -#include "DimensionedField.H" #include "autoPtr.H" #include "runTimeSelectionTables.H" @@ -96,7 +56,7 @@ namespace Foam class fvMesh; /*---------------------------------------------------------------------------*\ - Class basicSource Declaration + Class basicSource Declaration \*---------------------------------------------------------------------------*/ class basicSource @@ -128,8 +88,11 @@ protected: //- Reference to the mesh database const fvMesh& mesh_; - //- Dictionary containing the data of the source - const dictionary& dict_; + //- Top level source dictionary + dictionary dict_; + + //- Dictionary containing source coefficients + dictionary coeffs_; //- Source active flag bool active_; @@ -155,6 +118,12 @@ protected: //- Sum of cell volumes scalar V_; + //- Field names to apply source to - populated by derived models + wordList fieldNames_; + + //- Applied flag list - corresponds to each fieldNames_ entry + List<bool> applied_; + // Protected functions @@ -271,7 +240,7 @@ public: inline const fvMesh& mesh() const; //- Return dictionary - inline const dictionary& dictCoeffs() const; + inline const dictionary& coeffs() const; //- Return const access to the source active flag inline bool active() const; @@ -298,6 +267,9 @@ public: //- Return const access to the cell set inline const labelList& cells() const; + //- Set the applied flag to true for field index fieldI + inline void setApplied(const label fieldI); + // Edit @@ -314,29 +286,106 @@ public: // Checks //- Is the source active? - bool isActive(); + virtual bool isActive(); + + //- Return index of field name if found in fieldNames list + virtual label applyToField(const word& fieldName) const; + + //- Check that the source has been applied + virtual void checkApplied() const; // Evaluation - //- Add source term to vector fvMatrix - virtual void addSu(fvMatrix<vector>& Eqn); + // Add explicit and implicit contributions + + //- Scalar + virtual void addSup + ( + fvMatrix<scalar>& eqn, + const label fieldI + ); + + //- Vector + virtual void addSup + ( + fvMatrix<vector>& eqn, + const label fieldI + ); + + //- Spherical tensor + virtual void addSup + ( + fvMatrix<symmTensor>& eqn, + const label fieldI + ); + + //- Symmetric tensor + virtual void addSup + ( + fvMatrix<sphericalTensor>& eqn, + const label fieldI + ); + + //- Tensor + virtual void addSup + ( + fvMatrix<tensor>& eqn, + const label fieldI + ); - //- Add source term to scalar fvMatrix - virtual void addSu(fvMatrix<scalar>& Eqn); - //- Set constant value on field - virtual void setValue(fvMatrix<scalar>& Eq); + // Set values directly + //- Scalar + virtual void setValue + ( + fvMatrix<scalar>& eqn, + const label fieldI + ); + + //- Vector + virtual void setValue + ( + fvMatrix<vector>& eqn, + const label fieldI + ); + + //- Spherical tensor + virtual void setValue + ( + fvMatrix<sphericalTensor>& eqn, + const label fieldI + ); + + //- Symmetric tensor + virtual void setValue + ( + fvMatrix<symmTensor>& eqn, + const label fieldI + ); + + //- Tensor + virtual void setValue + ( + fvMatrix<tensor>& eqn, + const label fieldI + ); // I-O + //- Write the source header information + virtual void writeHeader(Ostream&) const; + + //- Write the source footer information + virtual void writeFooter(Ostream&) const; + //- Write the source properties - virtual void writeData(Ostream&) const = 0; + virtual void writeData(Ostream&) const; //- Read source dictionary - virtual bool read(const dictionary& dict) = 0; + virtual bool read(const dictionary& dict); }; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceI.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceI.H index e7a126d5c975b79803e82d502531932606fab7d0..daf00bfc7c07995156484fbe9553f48ec0c77aa3 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceI.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceI.H @@ -38,11 +38,13 @@ inline const Foam::fvMesh& Foam::basicSource::mesh() const return mesh_; } -inline const Foam::dictionary& Foam::basicSource::dictCoeffs() const + +inline const Foam::dictionary& Foam::basicSource::coeffs() const { - return dict_; + return coeffs_; } + inline bool Foam::basicSource::active() const { return active_; @@ -92,6 +94,12 @@ inline const Foam::labelList& Foam::basicSource::cells() const } +inline void Foam::basicSource::setApplied(const label fieldI) +{ + applied_[fieldI] = true; +} + + inline bool& Foam::basicSource::active() { return active_; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceIO.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceIO.C index caec8b58cf78769260e7f08816fe352a2f77826c..55eb290087b927a17e75a4c04957d339307919b1 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceIO.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceIO.C @@ -27,11 +27,21 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::basicSource::writeData(Ostream& os) const +void Foam::basicSource::writeHeader(Ostream& os) const { os << indent << name_ << nl << indent << token::BEGIN_BLOCK << incrIndent << nl; +} + + +void Foam::basicSource::writeFooter(Ostream& os) const +{ + os << decrIndent << indent << token::END_BLOCK << endl; +} + +void Foam::basicSource::writeData(Ostream& os) const +{ os.writeKeyword("active") << active_ << token::END_STATEMENT << nl; os.writeKeyword("timeStart") << timeStart_ << token::END_STATEMENT << nl; os.writeKeyword("duration") << duration_ << token::END_STATEMENT << nl; @@ -70,8 +80,6 @@ void Foam::basicSource::writeData(Ostream& os) const << abort(FatalError); } } - - os << decrIndent << indent << token::END_BLOCK << endl; } @@ -80,6 +88,9 @@ bool Foam::basicSource::read(const dictionary& dict) active_ = readBool(dict.lookup("active")); timeStart_ = readScalar(dict.lookup("timeStart")); duration_ = readScalar(dict.lookup("duration")); + + coeffs_ = dict.subDict(type() + "Coeffs"); + return true; } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.C index 79af0251430efbafbb62641764fff90a7e7fdec3..1fe8bd12c26d60d2d7894173d26f83e457f81ed2 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.C @@ -24,6 +24,32 @@ License \*---------------------------------------------------------------------------*/ #include "basicSourceList.H" +#include "addToRunTimeSelectionTable.H" +#include "fvMesh.H" +#include "Time.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(basicSourceList, 0); +} + + +// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::basicSourceList::checkApplied() const +{ + if (mesh_.time().timeIndex() == checkTimeIndex_) + { + forAll(*this, i) + { + const basicSource& bs = this->operator[](i); + bs.checkApplied(); + } + } +} + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // @@ -34,7 +60,8 @@ Foam::basicSourceList::basicSourceList ) : PtrList<basicSource>(), - mesh_(mesh) + mesh_(mesh), + checkTimeIndex_(mesh_.time().startTimeIndex() + 2) { label count = 0; forAllConstIter(dictionary, dict, iter) @@ -50,61 +77,27 @@ Foam::basicSourceList::basicSourceList label i = 0; forAllConstIter(dictionary, dict, iter) { - const word& name = iter().keyword(); - const dictionary& sourceDict = iter().dict(); - - this->set - ( - i++, - basicSource::New(name, sourceDict, mesh) - ); - } -} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - - -void Foam::basicSourceList::addSu(fvMatrix<scalar>& Eqn) -{ - forAll(*this, i) - { - if (this->operator[](i).isActive()) - { - this->operator[](i).addSu(Eqn); - } - } -} - - -void Foam::basicSourceList::addSu(fvMatrix<vector>& Eqn) -{ - - forAll(*this, i) - { - if (this->operator[](i).isActive()) + if (iter().isDict()) { - this->operator[](i).addSu(Eqn); + const word& name = iter().keyword(); + const dictionary& sourceDict = iter().dict(); + + this->set + ( + i++, + basicSource::New(name, sourceDict, mesh) + ); } } } -void Foam::basicSourceList::setValue(fvMatrix<scalar>& Eqn) -{ - - forAll(*this, i) - { - if (this->operator[](i).isActive()) - { - this->operator[](i).setValue(Eqn); - } - } -} - +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // bool Foam::basicSourceList::read(const dictionary& dict) { + checkTimeIndex_ = mesh_.time().timeIndex() + 2; + bool allOk = true; forAll(*this, i) { @@ -121,7 +114,7 @@ bool Foam::basicSourceList::writeData(Ostream& os) const // Write list contents forAll(*this, i) { - os << nl; + os << nl; this->operator[](i).writeData(os); } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.H index 30e6501de129f4724e3fe993f3b96231ef6b26a1..59134e64c2a0336d63a0e611903bf03121a0bbef 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceList.H @@ -45,7 +45,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class basicSourceList Declaration + Class basicSourceList Declaration \*---------------------------------------------------------------------------*/ class basicSourceList @@ -59,9 +59,15 @@ private: //- Reference to the mesh database const fvMesh& mesh_; + //- Time index to check that all defined sources have been applied + label checkTimeIndex_; + // Private Member Functions + //- Check that all sources have been applied + void checkApplied() const; + //- Disallow default bitwise copy construct basicSourceList(const basicSourceList&); @@ -71,29 +77,28 @@ private: public: + //- Runtime type information + TypeName("basicSourceList"); + + // Constructors //- Construct from components with list of field names basicSourceList(const fvMesh& mesh, const dictionary& dict); - //- Destructor - virtual ~basicSourceList() - {} + //- Destructor + virtual ~basicSourceList() + {} // Member Functions // Evaluation - //- Add source terms to scalar fvMatrix - void addSu(fvMatrix<scalar>& Eq); - - //- Add source terms to vector fvMatrix - void addSu(fvMatrix<vector>& Eq); - - //- Set constant value on field - void setValue(fvMatrix<scalar>& Eq); + //- Apply sources to equation + template<class Type> + void apply(fvMatrix<Type>& eqn); // I-O @@ -110,7 +115,6 @@ public: Ostream& os, const basicSourceList& sources ); - }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -119,6 +123,12 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#ifdef NoRepository + #include "basicSourceListTemplates.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + #endif // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueI.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceListTemplates.C similarity index 64% rename from src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueI.H rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceListTemplates.C index 35aa075140ce370c0dcd761729793081d8189d21..fef93a9e957b3d0cd035068bed5a613213edc1ff 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueI.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/basicSourceListTemplates.C @@ -23,14 +23,38 @@ License \*---------------------------------------------------------------------------*/ -#include "explicitSetValue.H" - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::List<Foam::point>& -Foam::explicitSetValue::points() const +template<class Type> +void Foam::basicSourceList::apply(fvMatrix<Type>& eqn) { - return points_; + checkApplied(); + + const word& fieldName = eqn.psi().name(); + + forAll(*this, i) + { + basicSource& source = this->operator[](i); + + label fieldI = source.applyToField(fieldName); + + if (fieldI != -1) + { + source.setApplied(fieldI); + + if (source.isActive()) + { + if (debug) + { + Info<< "Applying source " << source.name() << " to field " + << fieldName << endl; + } + + source.addSup(eqn, fieldI); + source.setValue(eqn, fieldI); + } + } + } } diff --git a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/windSimpleFoam.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/makeBasicSource.H similarity index 53% rename from applications/solvers/incompressible/simpleFoam/windSimpleFoam/windSimpleFoam.C rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/makeBasicSource.H index d3a8bcda1951a7392a87a1eef1c6bdb8ebf30082..4d8c787487d503d54cd5c09082cf19d96f1af05e 100644 --- a/applications/solvers/incompressible/simpleFoam/windSimpleFoam/windSimpleFoam.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/basicSource/makeBasicSource.H @@ -21,62 +21,31 @@ License You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. -Application - windSimpleFoam - -Description - Steady-state solver for incompressible, turbulent flow with external - source in the momentum equation. - \*---------------------------------------------------------------------------*/ -#include "fvCFD.H" -#include "singlePhaseTransportModel.H" -#include "RASModel.H" -#include "IObasicSourceList.H" -#include "simpleControl.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -int main(int argc, char *argv[]) -{ - #include "setRootCase.H" - #include "createTime.H" - #include "createMesh.H" - #include "createFields.H" - #include "initContinuityErrs.H" - - IObasicSourceList actuationDisks(mesh); - - simpleControl simple(mesh); +#ifndef makeBasicSource_H +#define makeBasicSource_H - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#include "basicSource.H" +#include "addToRunTimeSelectionTable.H" - Info<< "\nStarting time loop\n" << endl; - - while (simple.loop()) - { - Info<< "Time = " << runTime.timeName() << nl << endl; - - // Pressure-velocity SIMPLE corrector - { - #include "UEqn.H" - #include "pEqn.H" - } - - turbulence->correct(); - - runTime.write(); +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s" - << " ClockTime = " << runTime.elapsedClockTime() << " s" - << nl << endl; - } +#define makeBasicSource(Source, Type) \ + \ + defineTemplateTypeNameAndDebugWithName \ + ( \ + Source<Type>, \ + #Type#Source, \ + 0 \ + ); \ + \ + basicSource::adddictionaryConstructorToTable<Source<Type> > \ + add##Source##Type##dictionary##ConstructorTobasicSourceTable_ - Info<< "End\n" << endl; - return 0; -} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#endif // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueTemplates.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValue.C similarity index 50% rename from src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueTemplates.C rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValue.C index f67c3183436edcb72c1c5171f3fe0fb86a93800a..6a14cb2bffcd8ff711f5da8b79df0ac77d899c71 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueTemplates.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValue.C @@ -23,27 +23,76 @@ License \*---------------------------------------------------------------------------*/ -template <class Type> -void Foam::explicitSetValue::setFieldValue +#include "ExplicitSetValue.H" +#include "fvMesh.H" +#include "fvMatrices.H" +#include "DimensionedField.H" + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template<class Type> +void Foam::ExplicitSetValue<Type>::setFieldData(const dictionary& dict) +{ + fieldNames_.setSize(dict.toc().size()); + fieldData_.setSize(fieldNames_.size()); + + applied_.setSize(fieldNames_.size(), false); + + label i = 0; + forAllConstIter(dictionary, dict, iter) + { + fieldNames_[i] = iter().keyword(); + dict.lookup(iter().keyword()) >> fieldData_[i]; + i++; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +Foam::ExplicitSetValue<Type>::ExplicitSetValue ( - fvMatrix<Type>& Eqn, - const Type& value -) const + const word& name, + const word& modelType, + const dictionary& dict, + const fvMesh& mesh +) +: + basicSource(name, modelType, dict, mesh), + fieldData_() { - Type data = value; + read(dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void Foam::ExplicitSetValue<Type>::setValue +( + fvMatrix<Type>& eqn, + const label fieldI +) +{ + if (debug) + { + Info<< "ExplicitSetValue<"<< pTraits<Type>::typeName + << ">::setValue for source " << name_ << endl; + } DimensionedField<Type, volMesh> rhs ( IOobject ( - "rhs", - Eqn.psi().mesh().time().timeName(), - Eqn.psi().mesh(), + name_ + fieldNames_[fieldI] + "rhs", + eqn.psi().mesh().time().timeName(), + eqn.psi().mesh(), IOobject::NO_READ, IOobject::NO_WRITE, false ), - Eqn.psi().mesh(), + eqn.psi().mesh(), dimensioned<Type> ( "zero", @@ -52,53 +101,14 @@ void Foam::explicitSetValue::setFieldValue ) ); - List<Type> values(this->cells().size()); + List<Type> values(cells_.size()); - forAll (values, i) + forAll(values, i) { - values[i] = data; + values[i] = fieldData_[fieldI]; } - Eqn.setValues(this->cells(), values); -} - - -template <class Type> -void Foam::explicitSetValue::addField -( - HashTable<Type>& fields, - const wordList& fieldTypes, - const wordList& fieldNames, - const dictionary& fieldDataDict -) -{ - typedef GeometricField<Type, fvPatchField, volMesh> geometricField; - - forAll (fieldTypes, fieldI) - { - word fieldName = fieldNames[fieldI]; - word fieldType = fieldTypes[fieldI]; - - if - ( - ( - fieldType - == GeometricField<Type, fvPatchField, volMesh>::typeName - ) && - ( - this->mesh().foundObject<geometricField>(fieldName) - ) - ) - { - Type fieldValue = fieldDataDict.lookupOrDefault<Type> - ( - fieldName, - pTraits<Type>::zero - ); - - fields.insert(fieldName, fieldValue); - } - } + eqn.setValues(cells_, values); } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValue.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValue.H similarity index 60% rename from src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValue.H rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValue.H index df3d404f1ac373cdc1c584b6fcec73d08fbd2649..58a50ea75c96fd15112b8bffb22619c20f99e042 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValue.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValue.H @@ -29,27 +29,26 @@ Description Sources described by: - explicitSetValueCoeffs - { - fieldData // field data - usage for multiple fields + <Type>ExplicitSetValueCoeffs { - k 30.7; - epsilon 1.5; + fieldData + { + k 30.7; + epsilon 1.5; + } } - } + SourceFiles explicitSetValue.C \*---------------------------------------------------------------------------*/ -#ifndef explicitSetValue_H -#define explicitSetValue_H +#ifndef ExplicitSetValue_H +#define ExplicitSetValue_H -#include "cellSet.H" -#include "volFieldsFwd.H" -#include "DimensionedField.H" #include "basicSource.H" +#include "Tuple2.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -60,37 +59,18 @@ namespace Foam Class explicitSetValue Declaration \*---------------------------------------------------------------------------*/ -class explicitSetValue +template<class Type> +class ExplicitSetValue : public basicSource { - // Private data - - //- List of field types - HashTable<scalar> scalarFields_; - HashTable<vector> vectorFields_; - - //- Set value to field - template<class Type> - void setFieldValue(fvMatrix<Type>&, const Type&) const; - - //- Add field names and values to field table for types. - template<class Type> - void addField - ( - HashTable<Type>& fields, - const wordList& fieldTypes, - const wordList& fieldNames, - const dictionary& dict - ); - protected: // Protected data - //- Coefficients dictionary - dictionary coeffs_; + //- Source value per field + List<Type> fieldData_; // Protected functions @@ -108,7 +88,7 @@ public: // Constructors //- Construct from components - explicitSetValue + ExplicitSetValue ( const word& name, const word& modelType, @@ -116,30 +96,13 @@ public: const fvMesh& mesh ); - //- Return clone - autoPtr<explicitSetValue> clone() const - { - notImplemented("autoPtr<explicitSetValue> clone() const"); - return autoPtr<explicitSetValue>(NULL); - } - // Member Functions - - // Edit - - //- Return points - inline const List<point>& points() const; - - // Evaluation //- Set value on vector field - virtual void setValue(fvMatrix<vector>& UEqn); - - //- Set value on scalar field - virtual void setValue(fvMatrix<scalar>& UEqn); + virtual void setValue(fvMatrix<Type>& eqn, const label fieldI); // I-O @@ -147,15 +110,8 @@ public: //- Write the source properties virtual void writeData(Ostream&) const; - //- Read fieldData in sub-dictionary + //- Read source dictionary virtual bool read(const dictionary& dict); - - //- Ostream operator - friend Ostream& operator<< - ( - Ostream& os, - const explicitSetValue& source - ); }; @@ -165,13 +121,9 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "explicitSetValueIO.C" -#include "explicitSetValueI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #ifdef NoRepository -# include "explicitSetValueTemplates.C" +# include "ExplicitSetValue.C" +# include "ExplicitSetValueIO.C" #endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueIO.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValueIO.C similarity index 79% rename from src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueIO.C rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValueIO.C index 24e9205606db82c5af9e1cebfe659628e7b2b6a6..7fd1d4559264f757e3c88d05c080946d11909ff2 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValueIO.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/ExplicitSetValueIO.C @@ -23,22 +23,23 @@ License \*---------------------------------------------------------------------------*/ -#include "explicitSetValue.H" +#include "ExplicitSetValue.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::explicitSetValue::writeData(Ostream& os) const +template<class Type> +void Foam::ExplicitSetValue<Type>::writeData(Ostream& os) const { os << indent << name_ << endl; dict_.write(os); } -bool Foam::explicitSetValue::read(const dictionary& dict) +template<class Type> +bool Foam::ExplicitSetValue<Type>::read(const dictionary& dict) { if (basicSource::read(dict)) { - coeffs_ = dict.subDict(typeName + "Coeffs"); setFieldData(coeffs_.subDict("fieldData")); return true; } @@ -49,13 +50,4 @@ bool Foam::explicitSetValue::read(const dictionary& dict) } -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -Foam::Ostream& Foam::operator<<(Ostream& os, const explicitSetValue& source) -{ - source.writeData(os); - return os; -} - - // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValue.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValue.C index 898f2c41c3728ee47628edec240626365212f172..78bb54bcb3489d44312914342f1c679abcf90fa3 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValue.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSetValue/explicitSetValue.C @@ -23,92 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "explicitSetValue.H" -#include "fvMesh.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" -#include "HashSet.H" +#include "makeBasicSource.H" +#include "ExplicitSetValue.H" -// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(explicitSetValue, 0); - addToRunTimeSelectionTable - ( - basicSource, - explicitSetValue, - dictionary - ); -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -void Foam::explicitSetValue::setFieldData(const dictionary& dict) -{ - scalarFields_.clear(); - vectorFields_.clear(); - - wordList fieldTypes(dict.toc().size()); - wordList fieldNames(dict.toc().size()); - - forAll(dict.toc(), i) - { - const word& fieldName = dict.toc()[i]; - IOobject io - ( - fieldName, - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ); - if (io.headerOk()) - { - fieldTypes[i] = io.headerClassName(); - fieldNames[i] = dict.toc()[i]; - } - else - { - FatalErrorIn("explicitSetValue::setFieldData") - << "header not OK for field " << io.name() - << abort(FatalError); - } - } - - addField(scalarFields_, fieldTypes, fieldNames, dict); - addField(vectorFields_, fieldTypes, fieldNames, dict); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::explicitSetValue::explicitSetValue -( - const word& name, - const word& modelType, - const dictionary& dict, - const fvMesh& mesh -) -: - basicSource(name, modelType, dict, mesh), - coeffs_(dict.subDict(modelType + "Coeffs")) -{ - setFieldData(coeffs_.subDict("fieldData")); -} - - -void Foam::explicitSetValue::setValue(fvMatrix<scalar>& Eqn) -{ - setFieldValue(Eqn, scalarFields_[Eqn.psi().name()]); -} - - -void Foam::explicitSetValue::setValue(fvMatrix<vector>& Eqn) -{ - setFieldValue(Eqn, vectorFields_[Eqn.psi().name()]); + makeBasicSource(ExplicitSetValue, scalar); + makeBasicSource(ExplicitSetValue, vector); + makeBasicSource(ExplicitSetValue, sphericalTensor); + makeBasicSource(ExplicitSetValue, symmTensor); + makeBasicSource(ExplicitSetValue, tensor); } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSource.C new file mode 100644 index 0000000000000000000000000000000000000000..b95cd7ba0ef00e3335b653528f3f7b27667d11f4 --- /dev/null +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSource.C @@ -0,0 +1,175 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "ExplicitSource.H" +#include "fvMesh.H" +#include "fvMatrices.H" +#include "DimensionedField.H" + +// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // + +template<class Type> +const Foam::wordList Foam::ExplicitSource<Type>:: +volumeModeTypeNames_ +( + IStringStream("(absolute specific)")() +); + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +template<class Type> +typename Foam::ExplicitSource<Type>::volumeModeType +Foam::ExplicitSource<Type>::wordToVolumeModeType +( + const word& vmtName +) const +{ + forAll(volumeModeTypeNames_, i) + { + if (vmtName == volumeModeTypeNames_[i]) + { + return volumeModeType(i); + } + } + + FatalErrorIn + ( + "ExplicitSource<Type>::volumeModeType" + "ExplicitSource<Type>::wordToVolumeModeType(const word&)" + ) << "Unknown volumeMode type " << vmtName + << ". Valid volumeMode types are:" << nl << volumeModeTypeNames_ + << exit(FatalError); + + return volumeModeType(0); +} + + +template<class Type> +Foam::word Foam::ExplicitSource<Type>::volumeModeTypeToWord +( + const volumeModeType& vmtType +) const +{ + if (vmtType > volumeModeTypeNames_.size()) + { + return "UNKNOWN"; + } + else + { + return volumeModeTypeNames_[vmtType]; + } +} + + +template<class Type> +void Foam::ExplicitSource<Type>::setFieldData(const dictionary& dict) +{ + fieldNames_.setSize(dict.toc().size()); + fieldData_.setSize(fieldNames_.size()); + + applied_.setSize(fieldNames_.size(), false); + + label i = 0; + forAllConstIter(dictionary, dict, iter) + { + fieldNames_[i] = iter().keyword(); + dict.lookup(iter().keyword()) >> fieldData_[i]; + i++; + } + + // Set volume normalisation + if (volumeMode_ == vmAbsolute) + { + VDash_ = V_; + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class Type> +Foam::ExplicitSource<Type>::ExplicitSource +( + const word& name, + const word& modelType, + const dictionary& dict, + const fvMesh& mesh +) +: + basicSource(name, modelType, dict, mesh), + volumeMode_(vmAbsolute), + VDash_(1.0), + fieldData_() +{ + read(dict); +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class Type> +void Foam::ExplicitSource<Type>::addSup +( + fvMatrix<Type>& eqn, + const label fieldI +) +{ +// if (debug) + { + Info<< "ExplicitSource<"<< pTraits<Type>::typeName + << ">::addSup for source " << name_ << endl; + } + + DimensionedField<Type, volMesh> Su + ( + IOobject + ( + name_ + fieldNames_[fieldI] + "Sup", + mesh_.time().timeName(), + mesh_, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensioned<Type> + ( + "zero", + eqn.dimensions()/dimVolume, + pTraits<Type>::zero + ), + false + ); + + forAll(cells_, i) + { + Su[cells_[i]] = fieldData_[fieldI]/VDash_; + } + + eqn -= Su; +} + + +// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSource.H similarity index 58% rename from src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.H rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSource.H index 05c3782254769ad49c32318e781dd132ab7c19b7..7248b5ef264400b5294bc7e7f3ca1e04c88dc6c3 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSource.H @@ -22,39 +22,37 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::explicitSource + Foam::ExplicitSource Description - Explicit source. + Explicit source Sources described by: - explicitSourceCoeffs - { - points // list of points when selectionMode = points - ( - (-0.088 0.007 -0.02) - (-0.028 0.007 -0.02) - ); - volumeMode specific; //absolute - fieldData // field data - usage for multiple fields + <Type>ExplicitSourceCoeffs { - k 30.7; - epsilon 1.5; + volumeMode absolute; // specific + fieldData + { + k 30.7; + epsilon 1.5; + } } - } + + If volumeMode = + - absolute: values are given as <quantity> + - specific: values are given as <quantity>/m3 + SourceFiles - explicitSource.C + ExplicitSource.C \*---------------------------------------------------------------------------*/ -#ifndef explicitSource_H -#define explicitSource_H +#ifndef ExplicitSource_H +#define ExplicitSource_H -#include "cellSet.H" -#include "volFieldsFwd.H" -#include "DimensionedField.H" +#include "Tuple2.H" #include "basicSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -62,35 +60,31 @@ SourceFiles namespace Foam { -/*---------------------------------------------------------------------------*\ - Class explicitSource Declaration -\*---------------------------------------------------------------------------*/ +// Forward declaration of classes -class explicitSource -: - public basicSource -{ - // Private data +class fvMesh; - //- List of field types - HashTable<scalar> scalarFields_; - HashTable<vector> vectorFields_; +template<class Type> +class ExplicitSource; - //- Add source to matrix - template<class Type> - void addSource(fvMatrix<Type>&, const Type&) const; +// Forward declaration of friend functions - //- Add field names and values to field table for types. - template<class Type> - void addField - ( - HashTable<Type>& fields, - const wordList& fieldTypes, - const wordList& fieldNames, - const dictionary& dict - ); +template<class Type> +Ostream& operator<< +( + Ostream&, + const ExplicitSource<Type>& +); +/*---------------------------------------------------------------------------*\ + Class ExplicitSource Declaration +\*---------------------------------------------------------------------------*/ +template<class Type> +class ExplicitSource +: + public basicSource +{ public: // Public data @@ -103,22 +97,31 @@ public: }; //- Word list of volume mode type names - static const NamedEnum<volumeModeType, 2> volumeModeTypeNames_; + static const wordList volumeModeTypeNames_; protected: // Protected data - //- Coefficients dictionary - dictionary coeffs_; - //- Volume mode volumeModeType volumeMode_; + //- Volume normalisation + scalar VDash_; + + //- Source field values + List<Type> fieldData_; + // Protected functions + //- Helper function to convert from a word to a volumeModeType + volumeModeType wordToVolumeModeType(const word& vtName) const; + + //- Helper function to convert from a volumeModeType to a word + word volumeModeTypeToWord(const volumeModeType& vtType) const; + //- Set the local field data void setFieldData(const dictionary& dict); @@ -126,13 +129,13 @@ protected: public: //- Runtime type information - TypeName("explicitSource"); + TypeName("ExplicitSource"); // Constructors //- Construct from components - explicitSource + ExplicitSource ( const word& name, const word& modelType, @@ -140,17 +143,6 @@ public: const fvMesh& mesh ); - //- Return clone - autoPtr<explicitSource> clone() const - { - notImplemented - ( - "autoPtr<explicitSource> clone() const" - ); - return autoPtr<explicitSource>(NULL); - } - - // Member Functions @@ -159,23 +151,23 @@ public: //- Return const access to the volume mode inline const volumeModeType& volumeMode() const; + //- Return const access to the source field values + inline const List<Type>& fieldData() const; + // Edit //- Return access to the volume mode inline volumeModeType& volumeMode(); - //- Return points - inline const List<point>& points() const; + //- Return access to the source field values + inline List<Type>& fieldData(); // Evaluation - //-Source term to fvMatrix<vector> - virtual void addSu(fvMatrix<vector>& UEqn); - - //-Source term to fvMatrix<scalar> - virtual void addSu(fvMatrix<scalar>& UEqn); + //- Add explicit contribution to equation + virtual void addSup(fvMatrix<Type>& eqn, const label fieldI); // I-O @@ -183,15 +175,8 @@ public: //- Write the source properties virtual void writeData(Ostream&) const; - //- Read fieldData in sub-dictionary + //- Read source dictionary virtual bool read(const dictionary& dict); - - //- Ostream operator - friend Ostream& operator<< - ( - Ostream& os, - const explicitSource& source - ); }; @@ -201,14 +186,14 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "explicitSourceIO.C" -#include "explicitSourceI.H" +#ifdef NoRepository +# include "ExplicitSource.C" +# include "ExplicitSourceIO.C" +#endif // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository -# include "explicitSourceTemplates.C" -#endif +#include "ExplicitSourceI.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceI.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSourceI.H similarity index 72% rename from src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceI.H rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSourceI.H index 8bc5a6262893a41cf659f7439c3a1d24631444c7..14276e0197b9ce60b7c264da8dfce20e0ca430ff 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceI.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSourceI.H @@ -23,28 +23,37 @@ License \*---------------------------------------------------------------------------*/ -#include "explicitSource.H" +#include "ExplicitSource.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline const Foam::explicitSource::volumeModeType& -Foam::explicitSource::volumeMode() const +template<class Type> +inline const typename Foam::ExplicitSource<Type>::volumeModeType& +Foam::ExplicitSource<Type>::volumeMode() const { return volumeMode_; } -inline Foam::explicitSource::volumeModeType& -Foam::explicitSource::volumeMode() +template<class Type> +inline const Foam::List<Type>& Foam::ExplicitSource<Type>::fieldData() const +{ + return fieldData_; +} + + +template<class Type> +inline typename Foam::ExplicitSource<Type>::volumeModeType& +Foam::ExplicitSource<Type>::volumeMode() { return volumeMode_; } -inline const Foam::List<Foam::point>& -Foam::explicitSource::points() const +template<class Type> +inline Foam::List<Type>& Foam::ExplicitSource<Type>::fieldData() { - return points_; + return fieldData_; } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceIO.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSourceIO.C similarity index 79% rename from src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceIO.C rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSourceIO.C index f97ad329067091f0ba063410bc818d8e06e37e9c..d181f3f20796e23df8ce6d556b71359ab2671b07 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceIO.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/ExplicitSourceIO.C @@ -23,23 +23,26 @@ License \*---------------------------------------------------------------------------*/ -#include "explicitSource.H" +#include "ExplicitSource.H" // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::explicitSource::writeData(Ostream& os) const +template<class Type> +void Foam::ExplicitSource<Type>::writeData(Ostream& os) const { os << indent << name_ << endl; dict_.write(os); } -bool Foam::explicitSource::read(const dictionary& dict) +template<class Type> +bool Foam::ExplicitSource<Type>::read(const dictionary& dict) { if (basicSource::read(dict)) { - coeffs_ = dict.subDict(typeName + "Coeffs"); setFieldData(coeffs_.subDict("fieldData")); + volumeMode_ = wordToVolumeModeType(coeffs_.lookup("volumeMode")); + return true; } else @@ -49,13 +52,4 @@ bool Foam::explicitSource::read(const dictionary& dict) } -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -Foam::Ostream& Foam::operator<<(Ostream& os, const explicitSource& source) -{ - source.writeData(os); - return os; -} - - // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.C index af5555f3fb09af2f0c73a427a8930c8c4c10ff00..338a4220593b5bd424e338bdb500c8859b9b90cb 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSource.C @@ -23,111 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "explicitSource.H" -#include "fvMesh.H" -#include "volFields.H" -#include "addToRunTimeSelectionTable.H" -#include "HashSet.H" +#include "makeBasicSource.H" +#include "ExplicitSource.H" -// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - defineTypeNameAndDebug(explicitSource, 0); - addToRunTimeSelectionTable - ( - basicSource, - explicitSource, - dictionary - ); - - - // * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // - - template<> const char* NamedEnum - < - explicitSource::volumeModeType, - 2 - >::names[] = - { - "absolute", - "specific" - }; - - const NamedEnum<explicitSource::volumeModeType, 2> - explicitSource::volumeModeTypeNames_; -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -void Foam::explicitSource::setFieldData(const dictionary& dict) -{ - scalarFields_.clear(); - vectorFields_.clear(); - - wordList fieldTypes(dict.toc().size()); - wordList fieldNames(dict.toc().size()); - - forAll(dict.toc(), i) - { - const word& fieldName = dict.toc()[i]; - IOobject io - ( - fieldName, - this->mesh().time().timeName(), - this->mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ); - if (io.headerOk()) - { - fieldTypes[i] = io.headerClassName(); - fieldNames[i] = dict.toc()[i]; - } - else - { - FatalErrorIn - ( - "explicitSource::setFieldData" - ) << "header not OK " << io.name() - << exit(FatalError); - } - } - - addField(scalarFields_, fieldTypes, fieldNames, dict); - addField(vectorFields_, fieldTypes, fieldNames, dict); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::explicitSource::explicitSource -( - const word& name, - const word& modelType, - const dictionary& dict, - const fvMesh& mesh -) -: - basicSource(name, modelType, dict, mesh), - coeffs_(dict.subDict(modelType + "Coeffs")), - volumeMode_(volumeModeTypeNames_.read(coeffs_.lookup("volumeMode"))) -{ - setFieldData(dict_.subDict("fieldData")); -} - - -void Foam::explicitSource::addSu(fvMatrix<scalar>& Eqn) -{ - addSource(Eqn, scalarFields_[Eqn.psi().name()]); -} - - -void Foam::explicitSource::addSu(fvMatrix<vector>& Eqn) -{ - addSource(Eqn, vectorFields_[Eqn.psi().name()]); + makeBasicSource(ExplicitSource, scalar); + makeBasicSource(ExplicitSource, vector); + makeBasicSource(ExplicitSource, sphericalTensor); + makeBasicSource(ExplicitSource, symmTensor); + makeBasicSource(ExplicitSource, tensor); } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceTemplates.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceTemplates.C deleted file mode 100644 index 92b94c3b1648418352cb4104901c8d8687b4d3ad..0000000000000000000000000000000000000000 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/explicitSource/explicitSourceTemplates.C +++ /dev/null @@ -1,104 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -template <class Type> -void Foam::explicitSource::addSource -( - fvMatrix<Type>& Eqn, - const Type& sourceData -) const -{ - Type data = sourceData; - if (volumeMode_ == vmAbsolute) - { - // Convert to specific quantity - data /= V_; - } - - DimensionedField<Type, volMesh> rhs - ( - IOobject - ( - "rhs", - Eqn.psi().mesh().time().timeName(), - Eqn.psi().mesh(), - IOobject::NO_READ, - IOobject::NO_WRITE, - false - ), - Eqn.psi().mesh(), - dimensioned<Type> - ( - "zero", - Eqn.dimensions()/dimVolume, - pTraits<Type>::zero - ) - ); - UIndirectList<Type>(rhs, this->cells()) = data; - - Eqn -= rhs; -} - - -template <class Type> -void Foam::explicitSource::addField -( - HashTable<Type>& fields, - const wordList& fieldTypes, - const wordList& fieldNames, - const dictionary& fieldDataDict -) -{ - typedef GeometricField<Type, fvPatchField, volMesh> geometricField; - - forAll (fieldTypes, fieldI) - { - word fieldName = fieldNames[fieldI]; - word fieldType = fieldTypes[fieldI]; - - if - ( - ( - fieldType - == GeometricField<Type, fvPatchField, volMesh>::typeName - ) && - ( - this->mesh().foundObject<geometricField>(fieldName) - ) - ) - { - Type fieldValue = fieldDataDict.lookupOrDefault<Type> - ( - fieldName, - pTraits<Type>::zero - ); - - fields.insert(fieldName, fieldValue); - } - } -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSource.C similarity index 58% rename from src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSource.C index d2c9912effec3d2dd243ced845ed2b638aec59a2..e3ff7ca50e6c28b25745108e428f86fadc5430d6 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSource.C @@ -24,8 +24,25 @@ License \*---------------------------------------------------------------------------*/ #include "pressureGradientExplicitSource.H" -#include "volFields.H" +#include "fvMatrices.H" +#include "DimensionedField.H" #include "IFstream.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(pressureGradientExplicitSource, 0); + + addToRunTimeSelectionTable + ( + basicSource, + pressureGradientExplicitSource, + dictionary + ); +} + // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -38,7 +55,7 @@ void Foam::pressureGradientExplicitSource::writeGradP() const ( IOobject ( - sourceName_ + "Properties", + name_ + "Properties", mesh_.time().timeName(), "uniform", mesh_, @@ -52,65 +69,76 @@ void Foam::pressureGradientExplicitSource::writeGradP() const } +void Foam::pressureGradientExplicitSource::update(fvMatrix<vector>& eqn) +{ + volVectorField& U = const_cast<volVectorField&>(eqn.psi()); + + const volScalarField& rAU = + mesh_.lookupObject<volScalarField>("(1|A(" + U.name() + "))"); + + // Integrate flow variables over cell set + scalar magUbarAve = 0.0; + scalar rAUave = 0.0; + const scalarField& cv = mesh_.V(); + forAll(cells_, i) + { + label cellI = cells_[i]; + scalar volCell = cv[cellI]; + magUbarAve += (flowDir_ & U[cellI])*volCell; + rAUave += rAU[cellI]*volCell; + } + + // Collect across all processors + reduce(magUbarAve, sumOp<scalar>()); + + // Volume averages + magUbarAve /= V_; + rAUave /= V_; + + // Calculate the pressure gradient increment needed to adjust the average + // flow-rate to the desired value + scalar gradPplus = (mag(Ubar_) - magUbarAve)/rAUave; + + // Apply correction to velocity field + forAll(cells_, i) + { + label cellI = cells_[i]; + U[cellI] += flowDir_*rAU[cellI]*gradPplus; + } + + // Update pressure gradient + gradP_.value() += gradPplus; + + Info<< "Uncorrected Ubar = " << magUbarAve << tab + << "Pressure gradient = " << gradP_.value() << endl; + + writeGradP(); +} + + // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::pressureGradientExplicitSource::pressureGradientExplicitSource ( const word& sourceName, - volVectorField& U + const word& modelType, + const dictionary& dict, + const fvMesh& mesh ) : - sourceName_(sourceName), - mesh_(U.mesh()), - U_(U), - dict_ - ( - IOobject - ( - sourceName + "Properties", - mesh_.time().constant(), - mesh_, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE - ) - ), - Ubar_(dict_.lookup("Ubar")), - gradPini_(dict_.lookup("gradPini")), + basicSource(sourceName, modelType, dict, mesh), + Ubar_(coeffs_.lookup("Ubar")), + gradPini_(coeffs_.lookup("gradPini")), gradP_(gradPini_), - flowDir_(Ubar_/mag(Ubar_)), - cellSource_(dict_.lookup("cellSource")), - cellSelector_ - ( - topoSetSource::New - ( - cellSource_, - mesh_, - dict_.subDict(cellSource_ + "Coeffs") - ) - ), - selectedCellSet_ - ( - mesh_, - sourceName_ + "CellSet", - mesh_.nCells()/10 + 1 // Reasonable size estimate. - ) + flowDir_(Ubar_/mag(Ubar_)) { - // Create the cell set - cellSelector_->applyToSet - ( - topoSetSource::NEW, - selectedCellSet_ - ); - - // Give some feedback - Info<< " Selected " - << returnReduce(selectedCellSet_.size(), sumOp<label>()) - << " cells" << endl; + coeffs_.lookup("fieldNames") >> fieldNames_; + applied_.setSize(fieldNames_.size(), false); // Read the initial pressure gradient from file if it exists IFstream propsFile ( - mesh_.time().timeName()/"uniform"/(sourceName_ + "Properties") + mesh_.time().timeName()/"uniform"/(name_ + "Properties") ); if (propsFile.good()) @@ -126,86 +154,31 @@ Foam::pressureGradientExplicitSource::pressureGradientExplicitSource // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -Foam::tmp<Foam::DimensionedField<Foam::vector, Foam::volMesh> > -Foam::pressureGradientExplicitSource::Su() const +void Foam::pressureGradientExplicitSource::addSup +( + fvMatrix<vector>& eqn, + const label fieldI +) { - tmp<DimensionedField<vector, volMesh> > tSource + update(eqn); + + DimensionedField<vector, volMesh> Su ( - new DimensionedField<vector, volMesh> + IOobject ( - IOobject - ( - sourceName_, - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), + name_ + fieldNames_[fieldI] + "Sup", + mesh_.time().timeName(), mesh_, - dimensionedVector("zero", gradP_.dimensions(), vector::zero) - ) + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh_, + dimensionedVector("zero", gradP_.dimensions(), vector::zero) ); - DimensionedField<vector, volMesh>& sourceField = tSource(); + UIndirectList<vector>(Su, cells_) = flowDir_*gradP_.value(); - forAllConstIter(cellSet, selectedCellSet_, iter) - { - label cellI = iter.key(); - - sourceField[cellI] = flowDir_*gradP_.value(); - } - - return tSource; -} - - -void Foam::pressureGradientExplicitSource::update() -{ - const volScalarField& rAU = - mesh_.lookupObject<volScalarField>("(1|A(" + U_.name() + "))"); - - // Integrate flow variables over cell set - scalar volTot = 0.0; - scalar magUbarAve = 0.0; - scalar rAUave = 0.0; - forAllConstIter(cellSet, selectedCellSet_, iter) - { - label cellI = iter.key(); - - scalar volCell = mesh_.V()[cellI]; - volTot += volCell; - - magUbarAve += (flowDir_ & U_[cellI])*volCell; - rAUave += rAU[cellI]*volCell; - } - - // Collect across all processors - reduce(volTot, sumOp<scalar>()); - reduce(magUbarAve, sumOp<scalar>()); - reduce(rAUave, sumOp<scalar>()); - - // Volume averages - magUbarAve /= volTot; - rAUave /= volTot; - - // Calculate the pressure gradient increment needed to adjust the average - // flow-rate to the desired value - scalar gradPplus = (mag(Ubar_) - magUbarAve)/rAUave; - - // Apply correction to velocity field - forAllConstIter(cellSet, selectedCellSet_, iter) - { - label cellI = iter.key(); - U_[cellI] += flowDir_*rAU[cellI]*gradPplus; - } - - // Update pressure gradient - gradP_.value() += gradPplus; - - Info<< "Uncorrected Ubar = " << magUbarAve << tab - << "Pressure gradient = " << gradP_.value() << endl; - - writeGradP(); + eqn -= Su; } diff --git a/src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSource.H similarity index 73% rename from src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.H rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSource.H index b4cf73e3385b27ede6d28e8eefd2bc350b73a873..287c1701f3f8cdb85ebd3dfd28984ed2edf9ddda 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/pressureGradientExplicitSource/pressureGradientExplicitSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSource.H @@ -25,10 +25,21 @@ Class Foam::pressureGradientExplicitSource Description - Creates a cell set pressure gradient source + Creates a pressure gradient source Note: Currently only handles kinematic pressure + Sources described by: + + pressureGradientExplicitSourceCoeffs + { + UName U; // name of velocity field + Ubar (10.0 0 0); // desired average velocity + gradPini gradPini [0 2 -2 0 0] 0; // initial pressure gradient + flowDir (1 0 0); // flow direction + } + + SourceFiles pressureGradientExplicitSource.C @@ -42,6 +53,7 @@ SourceFiles #include "cellSet.H" #include "fvMesh.H" #include "volFields.H" +#include "basicSource.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -49,25 +61,15 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class pressureGradientExplicitSource Declaration + Class pressureGradientExplicitSource Declaration \*---------------------------------------------------------------------------*/ class pressureGradientExplicitSource +: + public basicSource { // Private data - //- Name of the source - const word sourceName_; - - //- Reference to the mesh - const fvMesh& mesh_; - - //- Reference to the velocity field - volVectorField& U_; - - //- Properties dictionary - IOdictionary dict_; - //- Average velocity vector Ubar_; @@ -80,21 +82,15 @@ class pressureGradientExplicitSource //- Flow direction vector flowDir_; - //- Name of cell source - word cellSource_; - - //- The method by which the cells will be selected - autoPtr<topoSetSource> cellSelector_; - - //- The set of selected cells - cellSet selectedCellSet_; - // Private Member Functions //- Write the pressure gradient to file (for restarts etc) void writeGradP() const; + //- Correct driving force for a constant mass flow rate + void update(fvMatrix<vector>& eqn); + //- Disallow default bitwise copy construct pressureGradientExplicitSource(const pressureGradientExplicitSource&); @@ -104,13 +100,19 @@ class pressureGradientExplicitSource public: + //- Runtime type information + TypeName("pressureGradientExplicitSource"); + + // Constructors //- Construct from explicit source name and mesh pressureGradientExplicitSource ( const word& sourceName, - volVectorField& U + const word& modelType, + const dictionary& dict, + const fvMesh& mesh ); @@ -118,12 +120,17 @@ public: // Access - //- Return a tmp field of the source - tmp<DimensionedField<vector, volMesh> > Su() const; + //- Add explicit contribution to equation + virtual void addSup(fvMatrix<vector>& eqn, const label fieldI); - //- Correct driving force for a constant mass flow rate - void update(); + // I-O + + //- Write the source properties + virtual void writeData(Ostream&) const; + + //- Read source dictionary + virtual bool read(const dictionary& dict); }; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSourceIO.C similarity index 69% rename from src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C rename to src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSourceIO.C index 54ee1b3744a65ae8b1ee031fc7372d5dda6cd780..b6d1b2d1cf2ba38daf88a33e30d56bee1602f83c 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/pressureGradientExplicitSource/pressureGradientExplicitSourceIO.C @@ -23,22 +23,34 @@ License \*---------------------------------------------------------------------------*/ -#include "timeActivatedExplicitSource.H" +#include "pressureGradientExplicitSource.H" -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -namespace Foam +void Foam::pressureGradientExplicitSource::writeData(Ostream& os) const { - defineTemplateTypeNameAndDebug + notImplemented ( - IOPtrList<scalarTimeActivatedExplicitSource>, - 0 + "void Foam::pressureGradientExplicitSource::writeData" + "(" + "Ostream&" + ") const" ); - defineTemplateTypeNameAndDebug +} + + +bool Foam::pressureGradientExplicitSource::read(const dictionary& dict) +{ + notImplemented ( - IOPtrList<vectorTimeActivatedExplicitSource>, - 0 + "bool Foam::pressureGradientExplicitSource::read" + "(" + "const dictionary&" + ") const" ); + + return false; } + // ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSource.C index 0444a9408b3dc3e81896634da6e641dbff45dfae..4a5631270ab514929e82b30c64ac153ea156b092 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSource.C @@ -53,30 +53,31 @@ Foam::radialActuationDiskSource::radialActuationDiskSource ) : actuationDiskSource(name, modelType, dict, mesh), - coeffsDict_(dict.subDict(modelType + "Coeffs")), - coeffs_() + radialCoeffs_(coeffs_.lookup("coeffs")) { - coeffsDict_.lookup("coeffs") >> coeffs_; - Info<< " - creating radial actuation disk zone: " - << this->name() << endl; + Info<< " - creating radial actuation disk zone: " << name_ << endl; } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::radialActuationDiskSource::addSu(fvMatrix<vector>& UEqn) +void Foam::radialActuationDiskSource::addSup +( + fvMatrix<vector>& eqn, + const label fieldI +) { bool compressible = false; - if (UEqn.dimensions() == dimensionSet(1, 1, -2, 0, 0)) + if (eqn.dimensions() == dimForce) { compressible = true; } - const scalarField& cellsV = this->mesh().V(); - vectorField& Usource = UEqn.source(); - const vectorField& U = UEqn.psi(); + const scalarField& cellsV = mesh_.V(); + vectorField& Usource = eqn.source(); + const vectorField& U = eqn.psi(); - if (V() > VSMALL) + if (V_ > VSMALL) { if (compressible) { @@ -85,7 +86,7 @@ void Foam::radialActuationDiskSource::addSu(fvMatrix<vector>& UEqn) Usource, cells_, cellsV, - this->mesh().lookupObject<volScalarField>("rho"), + mesh_.lookupObject<volScalarField>("rho"), U ); } @@ -114,12 +115,11 @@ bool Foam::radialActuationDiskSource::read(const dictionary& dict) { if (basicSource::read(dict)) { - const dictionary& coeffsDict_ = dict.subDict(typeName + "Coeffs"); - coeffsDict_.readIfPresent("diskDir", diskDir_); - coeffsDict_.readIfPresent("Cp", Cp_); - coeffsDict_.readIfPresent("Ct", Ct_); - coeffsDict_.readIfPresent("diskArea", diskArea_); - coeffsDict_.lookup("coeffs") >> coeffs_; + coeffs_.readIfPresent("diskDir", diskDir_); + coeffs_.readIfPresent("Cp", Cp_); + coeffs_.readIfPresent("Ct", Ct_); + coeffs_.readIfPresent("diskArea", diskArea_); + coeffs_.lookup("coeffs") >> radialCoeffs_; return true; } else diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSource.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSource.H index 245f002fa51446d0035f74c58987764ec3640783..4c464bcfd36754571d947eca2af534ca456a8969 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSource.H @@ -29,17 +29,31 @@ Description Actuation disk zone definition. Constant values for momentum source for actuation disk - T = 2*rho*A*sqr(Uo)*a*(1-a) - U1 = (1 -a)Uo + T = 2*rho*A*sqr(Uo)*a*(1-a) + U1 = (1 -a)Uo + where: - A: disk area - Uo: upstream velocity - a: 1 - Cp/Ct - U1: velocity at the disk + A: disk area + Uo: upstream velocity + a: 1 - Cp/Ct + U1: velocity at the disk The thrust is distributed by a radial function: - thrust(r) = T*(C0 + C1*r^2 + C2*r^4) + + thrust(r) = T*(C0 + C1*r^2 + C2*r^4) + + Sources described by: + + actuationDiskSourceCoeffs + { + fieldName U; // name of field to apply source + diskDir (-1 0 0); // disk direction + Cp 0.1; // power coefficient + Ct 0.5; // thrust coefficient + diskArea 5.0; // disk area + coeffs (0.1 0.5 0.01); // radial distribution coefficients + } SourceFiles @@ -51,10 +65,8 @@ SourceFiles #ifndef radialActuationDiskSource_H #define radialActuationDiskSource_H -#include "DimensionedField.H" -#include "volFieldsFwd.H" -#include "FixedList.H" #include "actuationDiskSource.H" +#include "FixedList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -71,11 +83,8 @@ class radialActuationDiskSource { // Private data - //- Coefficients dictionary - dictionary coeffsDict_; - //- Coeffcients for the radial distribution - FixedList<scalar, 3> coeffs_; + FixedList<scalar, 3> radialCoeffs_; // Private Member Functions @@ -124,7 +133,7 @@ public: // Public Functions //- Source term to fvMatrix<vector> - virtual void addSu(fvMatrix<vector>& UEqn); + virtual void addSup(fvMatrix<vector>& eqn, const label fieldI); // I-O diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSourceTemplates.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSourceTemplates.C index 47ac4d0f4083862825de8baf0832ac88e8620ba5..fce5c0a1706c5afb2907ca94377bd254d9067055 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSourceTemplates.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/radialActuationDiskSource/radialActuationDiskSourceTemplates.C @@ -61,24 +61,25 @@ addRadialActuationDiskAxialInertialResistance const scalar maxR = gMax(mag(zoneCellCentres - avgCentre)); scalar intCoeffs = - coeffs_[0] - + coeffs_[1]*sqr(maxR)/2.0 - + coeffs_[2]*pow4(maxR)/3.0; + radialCoeffs_[0] + + radialCoeffs_[1]*sqr(maxR)/2.0 + + radialCoeffs_[2]*pow4(maxR)/3.0; forAll(cells, i) { T[i] = 2.0*rho[cells[i]]*diskArea_*mag(U[cells[i]])*a/(1.0 - a); - scalar r = mag(mesh().cellCentres()[cells[i]] - avgCentre); + scalar r2 = magSqr(mesh().cellCentres()[cells[i]] - avgCentre); Tr[i] = - T[i]*(coeffs_[0] + coeffs_[1]*sqr(r) + coeffs_[2]*pow4(r)) + T[i] + *(radialCoeffs_[0] + radialCoeffs_[1]*r2 + radialCoeffs_[2]*sqr(r2)) /intCoeffs; } forAll(cells, i) { - Usource[cells[i]] += ((Vcells[cells[i]]/V())*Tr[i]*E) & U[cells[i]]; + Usource[cells[i]] += ((Vcells[cells[i]]/V_)*Tr[i]*E) & U[cells[i]]; } if (debug) diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/profileModel/profileModelList.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/profileModel/profileModelList.H index 74326dced4b74ed907493363c2f066c831c212cc..0a6c12528844dc52ae2d7d0d9377f18b164fbfde 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/profileModel/profileModelList.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/profileModel/profileModelList.H @@ -28,7 +28,7 @@ Description Base class for profile models SourceFiles - profileModel.C + profileModelList.C \*---------------------------------------------------------------------------*/ diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C index db4fd5d80336bb3c72f418c02e1b18bd0169c32c..02f29fcd77a5a0c7d77c25afac01e6345e5a8d60 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.C @@ -28,6 +28,7 @@ License #include "mathematicalConstants.H" #include "unitConversion.H" #include "geometricOneField.H" +#include "fvMatrices.H" using namespace Foam::constant; @@ -262,10 +263,8 @@ void Foam::rotorDiskSource::createCoordinateSystem() } default: { - FatalErrorIn - ( - "rotorDiskSource::createCoordinateSystem(const geometryMode&);" - ) << "Unknown geometryMode " << geometryModeTypeNames_[gm] + FatalErrorIn("rotorDiskSource::createCoordinateSystem()") + << "Unknown geometryMode " << geometryModeTypeNames_[gm] << ". Available geometry modes include " << geometryModeTypeNames_ << exit(FatalError); } @@ -369,7 +368,6 @@ Foam::rotorDiskSource::rotorDiskSource ) : basicSource(name, modelType, dict, mesh), - coeffs_(dict_.subDict(type() + "Coeffs")), rhoName_("none"), omega_(0.0), nBlades_(0), @@ -399,20 +397,20 @@ Foam::rotorDiskSource::~rotorDiskSource() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::rotorDiskSource::addSu(fvMatrix<vector>& UEqn) +void Foam::rotorDiskSource::addSup(fvMatrix<vector>& eqn, const label fieldI) { // add source to lhs of eqn - const volVectorField& U = UEqn.psi(); + const volVectorField& U = eqn.psi(); - if (UEqn.dimensions() == dimForce) + if (eqn.dimensions() == dimForce) { coeffs_.lookup("rhoName") >> rhoName_; const volScalarField& rho = mesh_.lookupObject<volScalarField>(rhoName_); - UEqn += calculateForces + eqn += calculateForces ( rho.internalField(), inflowVelocity(U), @@ -421,7 +419,7 @@ void Foam::rotorDiskSource::addSu(fvMatrix<vector>& UEqn) } else { - UEqn += calculateForces + eqn += calculateForces ( oneField(), inflowVelocity(U), @@ -431,12 +429,6 @@ void Foam::rotorDiskSource::addSu(fvMatrix<vector>& UEqn) } -void Foam::rotorDiskSource::addSu(fvMatrix<scalar>& UEqn) -{ - // do nothing -} - - void Foam::rotorDiskSource::writeData(Ostream& os) const { os << indent << name_ << endl; @@ -448,7 +440,8 @@ bool Foam::rotorDiskSource::read(const dictionary& dict) { if (basicSource::read(dict)) { - coeffs_ = dict.subDict(type() + "Coeffs"); + coeffs_.lookup("fieldNames") >> fieldNames_; + applied_.setSize(fieldNames_.size(), false); scalar rpm(readScalar(coeffs_.lookup("rpm"))); omega_ = rpm/60.0*mathematical::twoPi; diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.H b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.H index 0d646b98996b3174b4693da90e37346620adec46..7565fa17ceafbe0450bf086d4faf80f43382df4d 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.H +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSource.H @@ -25,11 +25,61 @@ Class Foam::rotorDiskSource Description - Cell-zone based momemtum source + Cell based momemtum source Source approximates the mean effects of rotor forces on a cylindrical region within the domain + Sources described by: + + rotorDiskSourceCoeffs + { + fieldNames (U); // names of fields on which to apply source + rhoName rho; // density field if compressible case + nBlades 3; // number of blades + tip effect 0.96; // normalised radius above which lift = 0 + + inletFlowType local; // inlet flow type specification + + geometryMode auto; // geometry specification + + refDirection (-1 0 0); // reference direction + + flapCoeffs + { + beta0 0; // coning angle [deg] + beta1 0; // lateral flapping coeff + beta2 0; // longitudinal flapping coeff + } + trimCoeffs + { + alphac 15; // collective pitch angle [deg] + A 0; // lateral cyclic coeff + B 0; // longitudinal cyclic coeff + } + blade + { + ... + } + profiles + { + ... + } + } + + Where: + + geometryMode = + auto : determine rototor co-ord system from cells + specified : specified co-ord system + + inletFlowType = + fixed : specified velocity + surfaceNormal : specified normal velocity (positive towards rotor) + local : use local flow conditions + + + SourceFiles rotorDiskSource.C rotorDiskSourceTemplates.C @@ -44,6 +94,8 @@ SourceFiles #include "NamedEnum.H" #include "bladeModel.H" #include "profileModelList.H" +#include "volFieldsFwd.H" +#include "dimensionSet.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -97,9 +149,6 @@ protected: // Protected data - //- Coefficients dictionary - dictionary coeffs_; - //- Name of density field word rhoName_; @@ -211,14 +260,10 @@ public: // Member Functions - // Source term addition //- Source term to fvMatrix<vector> - virtual void addSu(fvMatrix<vector>& UEqn); - - //- Source term to fvMatrix<scalar> - virtual void addSu(fvMatrix<scalar>& UEqn); + virtual void addSup(fvMatrix<vector>& eqn, const label fieldI); // I-O diff --git a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSourceTemplates.C b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSourceTemplates.C index 5bc97c703f99f4ab4e4b316b0c1c9213a31c2fc5..4427ecec52930a0e50c3d22a6ab454d6e3c1e0dd 100644 --- a/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSourceTemplates.C +++ b/src/finiteVolume/cfdTools/general/fieldSources/basicSource/rotorDiskSource/rotorDiskSourceTemplates.C @@ -27,6 +27,7 @@ License #include "addToRunTimeSelectionTable.H" #include "mathematicalConstants.H" #include "unitConversion.H" +#include "volFields.H" using namespace Foam::constant; @@ -175,9 +176,9 @@ Foam::tmp<Foam::volVectorField> Foam::rotorDiskSource::calculateForces } // calculate forces - scalar pDyn = 0.5*rho[cellI]*sqr(magUc); - scalar f = pDyn*chord*nBlades_*area_[i]/(mathematical::twoPi); - vector localForce = vector(0.0, f*Cd, tipFactor*f*Cl); + const scalar pDyn = 0.5*rho[cellI]*sqr(magUc); + const scalar f = pDyn*chord*nBlades_*area_[i]/(mathematical::twoPi); + const vector localForce(0.0, f*Cd, tipFactor*f*Cl); // accumulate forces dragEff += localForce.y(); diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.C deleted file mode 100644 index cce9bc97ae249bd45c99293871ed31325413cf41..0000000000000000000000000000000000000000 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.C +++ /dev/null @@ -1,393 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "TimeActivatedExplicitSource.H" -#include "fvMesh.H" -#include "volFields.H" - -// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * // - -template<class Type> -const Foam::wordList Foam::TimeActivatedExplicitSource<Type>:: -selectionModeTypeNames_ -( - IStringStream("(points cellSet cellZone all)")() -); - - -template<class Type> -const Foam::wordList Foam::TimeActivatedExplicitSource<Type>:: -volumeModeTypeNames_ -( - IStringStream("(absolute specific)")() -); - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -template<class Type> -typename Foam::TimeActivatedExplicitSource<Type>::selectionModeType -Foam::TimeActivatedExplicitSource<Type>::wordToSelectionModeType -( - const word& smtName -) const -{ - forAll(selectionModeTypeNames_, i) - { - if (smtName == selectionModeTypeNames_[i]) - { - return selectionModeType(i); - } - } - - FatalErrorIn - ( - "TimeActivatedExplicitSource<Type>::selectionModeType" - "TimeActivatedExplicitSource<Type>::wordToSelectionModeType" - "(" - "const word&" - ")" - ) << "Unknown selectionMode type " << smtName - << ". Valid selectionMode types are:" << nl << selectionModeTypeNames_ - << exit(FatalError); - - return selectionModeType(0); -} - - -template<class Type> -typename Foam::TimeActivatedExplicitSource<Type>::volumeModeType -Foam::TimeActivatedExplicitSource<Type>::wordToVolumeModeType -( - const word& vmtName -) const -{ - forAll(volumeModeTypeNames_, i) - { - if (vmtName == volumeModeTypeNames_[i]) - { - return volumeModeType(i); - } - } - - FatalErrorIn - ( - "TimeActivatedExplicitSource<Type>::volumeModeType" - "TimeActivatedExplicitSource<Type>::wordToVolumeModeType(const word&)" - ) << "Unknown volumeMode type " << vmtName - << ". Valid volumeMode types are:" << nl << volumeModeTypeNames_ - << exit(FatalError); - - return volumeModeType(0); -} - - -template<class Type> -Foam::word Foam::TimeActivatedExplicitSource<Type>::selectionModeTypeToWord -( - const selectionModeType& smtType -) const -{ - if (smtType > selectionModeTypeNames_.size()) - { - return "UNKNOWN"; - } - else - { - return selectionModeTypeNames_[smtType]; - } -} - - -template<class Type> -Foam::word Foam::TimeActivatedExplicitSource<Type>::volumeModeTypeToWord -( - const volumeModeType& vmtType -) const -{ - if (vmtType > volumeModeTypeNames_.size()) - { - return "UNKNOWN"; - } - else - { - return volumeModeTypeNames_[vmtType]; - } -} - - -template<class Type> -void Foam::TimeActivatedExplicitSource<Type>::setSelection -( - const dictionary& dict -) -{ - switch (selectionMode_) - { - case smPoints: - { - dict.lookup("points") >> points_; - break; - } - case smCellSet: - { - dict.lookup("cellSet") >> cellSetName_; - break; - } - case smCellZone: - { - dict.lookup("cellZone") >> cellSetName_; - break; - } - case smAll: - { - break; - } - default: - { - FatalErrorIn - ( - "TimeActivatedExplicitSource::setSelection(const dictionary&)" - ) << "Unknown selectionMode " - << selectionModeTypeNames_[selectionMode_] - << ". Valid selectionMode types are" << selectionModeTypeNames_ - << exit(FatalError); - } - } -} - - -template<class Type> -void Foam::TimeActivatedExplicitSource<Type>::setFieldData -( - const dictionary& dict, - const wordList& fieldNames -) -{ - dict.lookup("fieldData") >> fieldData_; - labelList localFieldIds(fieldData_.size(), -1); - forAll(fieldNames, i) - { - forAll(fieldData_, j) - { - const word& fdName = fieldData_[j].first(); - if (fdName == fieldNames[i]) - { - fieldIds_[i] = j; - localFieldIds[j] = i; - break; - } - } - } - forAll(localFieldIds, i) - { - if (localFieldIds[i] < 0) - { - FatalErrorIn - ( - "TimeActivatedExplicitSource<Type>::setFieldData" - "(" - "const dictionary&, " - "const wordList&" - ")" - ) << "Field " << fieldData_[i].first() << " not found in " - << "field list. Available fields are: " << nl << fieldNames - << exit(FatalError); - } - } -} - - -template<class Type> -void Foam::TimeActivatedExplicitSource<Type>::setCellSet() -{ - Info<< incrIndent << indent << "Source: " << name_ << endl; - switch (selectionMode_) - { - case smPoints: - { - Info<< indent << "- selecting cells using points" << endl; - - labelHashSet selectedCells; - - forAll(points_, i) - { - label cellI = mesh_.findCell - ( - points_[i], - polyMesh::FACEDIAGTETS - ); - if (cellI >= 0) - { - selectedCells.insert(cellI); - } - - label globalCellI = returnReduce(cellI, maxOp<label>()); - if (globalCellI < 0) - { - WarningIn("TimeActivatedExplicitSource<Type>::setCellIds()") - << "Unable to find owner cell for point " << points_[i] - << endl; - } - } - - cells_ = selectedCells.toc(); - - break; - } - case smCellSet: - { - Info<< indent << "- selecting cells using cellSet " - << cellSetName_ << endl; - - cellSet selectedCells(mesh_, cellSetName_); - cells_ = selectedCells.toc(); - - break; - } - case smCellZone: - { - Info<< indent << "- selecting cells using cellZone " - << cellSetName_ << endl; - label zoneID = mesh_.cellZones().findZoneID(cellSetName_); - if (zoneID == -1) - { - FatalErrorIn("TimeActivatedExplicitSource<Type>::setCellIds()") - << "Cannot find cellZone " << cellSetName_ << endl - << "Valid cellZones are " << mesh_.cellZones().names() - << exit(FatalError); - } - cells_ = mesh_.cellZones()[zoneID]; - - break; - } - case smAll: - { - Info<< indent << "- selecting all cells" << endl; - cells_ = identity(mesh_.nCells()); - - break; - } - default: - { - FatalErrorIn("TimeActivatedExplicitSource<Type>::setCellIds()") - << "Unknown selectionMode " - << selectionModeTypeNames_[selectionMode_] - << ". Valid selectionMode types are" << selectionModeTypeNames_ - << exit(FatalError); - } - } - - // Set volume normalisation - if (volumeMode_ == vmAbsolute) - { - V_ = 0.0; - forAll(cells_, i) - { - V_ += mesh_.V()[cells_[i]]; - } - reduce(V_, sumOp<scalar>()); - } - - Info<< indent << "- selected " - << returnReduce(cells_.size(), sumOp<label>()) - << " cell(s) with volume " << V_ << nl << decrIndent << endl; -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -Foam::TimeActivatedExplicitSource<Type>::TimeActivatedExplicitSource -( - const word& name, - const dictionary& dict, - const fvMesh& mesh, - const wordList& fieldNames -) -: - name_(name), - mesh_(mesh), - active_(readBool(dict.lookup("active"))), - timeStart_(readScalar(dict.lookup("timeStart"))), - duration_(readScalar(dict.lookup("duration"))), - volumeMode_(wordToVolumeModeType(dict.lookup("volumeMode"))), - selectionMode_(wordToSelectionModeType(dict.lookup("selectionMode"))), - points_(), - cellSetName_("none"), - V_(1.0), - fieldData_(), - fieldIds_(fieldNames.size(), -1) -{ - setSelection(dict); - - if (fieldNames.size() == 1) - { - fieldData_.setSize(1); - fieldData_[0].first() = fieldNames[0]; - dict.lookup("fieldData") >> fieldData_[0].second(); - fieldIds_[0] = 0; - } - else - { - setFieldData(dict, fieldNames); - } - - setCellSet(); -} - - -template<class Type> -void Foam::TimeActivatedExplicitSource<Type>::addToField -( - DimensionedField<Type, volMesh>& Su, - const label fieldI -) -{ - const label fid = fieldIds_[fieldI]; - - if - ( - active_ - && (fid >= 0) - && (mesh_.time().value() >= timeStart_) - && (mesh_.time().value() <= timeEnd()) - ) - { - // Update the cell set if the mesh is changing - if (mesh_.changing()) - { - setCellSet(); - } - - forAll(cells_, i) - { - Su[cells_[i]] = fieldData_[fid].second()/V_; - } - } -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.H deleted file mode 100644 index 73304ef7d8deb571c34b0066fb3f6be68a313e02..0000000000000000000000000000000000000000 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSource.H +++ /dev/null @@ -1,392 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -Class - Foam::TimeActivatedExplicitSource - -Description - Time activated explicit source. - - Sources described by: - - { - active true; // on/off switch - timeStart 0.2; // start time - duration 2.0; // duration - selectionMode points; // cellSet/cellZone/all - volumeMode absolute; // specific - - fieldData // field data - usage for multiple fields - ( - (H2O 0.005) - ); - - fieldData 0.005; // field data - usage for single field - - points // list of points when selectionMode = points - ( - (2.75 0.5 0) - ); - - cellSet c0; // cellSet name when selectionMode=cellSet - cellZone c0; // cellZone name when selectionMode=cellZone - } - -SourceFiles - TimeActivatedExplicitSource.C - -\*---------------------------------------------------------------------------*/ - -#ifndef TimeActivatedExplicitSource_H -#define TimeActivatedExplicitSource_H - -#include "Tuple2.H" -#include "cellSet.H" -#include "volFieldsFwd.H" -#include "DimensionedField.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of classes - -class fvMesh; - -template<class Type> -class TimeActivatedExplicitSource; - -// Forward declaration of friend functions - -template<class Type> -Ostream& operator<< -( - Ostream&, - const TimeActivatedExplicitSource<Type>& -); - -/*---------------------------------------------------------------------------*\ - Class TimeActivatedExplicitSource Declaration -\*---------------------------------------------------------------------------*/ - -template<class Type> -class TimeActivatedExplicitSource -{ -public: - - // Public data - - //- Enumeration for selection mode types - enum selectionModeType - { - smPoints, - smCellSet, - smCellZone, - smAll - }; - - //- Word list of selection mode type names - static const wordList selectionModeTypeNames_; - - //- Enumeration for volume types - enum volumeModeType - { - vmAbsolute, - vmSpecific - }; - - //- Word list of volume mode type names - static const wordList volumeModeTypeNames_; - - -protected: - - // Protected data - - typedef Tuple2<word, Type> fieldNameValuePair; - - //- Source name - word name_; - - //- Reference to the mesh database - const fvMesh& mesh_; - - //- Source active flag - bool active_; - - //- Time start - scalar timeStart_; - - //- Duration - scalar duration_; - - //- Volume mode - volumeModeType volumeMode_; - - //- Cell selection mode - selectionModeType selectionMode_; - - //- List of points for "points" selectionMode - List<point> points_; - - //- Name of cell set for "cellSet" and "cellZone" selectionMode - word cellSetName_; - - //- Set of cells to apply source to - labelList cells_; - - //- Sum of cell volumes - scalar V_; - - //- List of source field name vs value pairs - List<fieldNameValuePair> fieldData_; - - //- Map of fields ids from supplied fields to local field source ids - labelList fieldIds_; - - - // Protected functions - - //- Helper function to convert from a word to a selectionModeType - selectionModeType wordToSelectionModeType(const word& smtName) const; - - //- Helper function to convert from a word to a volumeModeType - volumeModeType wordToVolumeModeType(const word& vtName) const; - - //- Helper function to convert from a selectionModeType to a word - word selectionModeTypeToWord(const selectionModeType& smtType) const; - - //- Helper function to convert from a volumeModeType to a word - word volumeModeTypeToWord(const volumeModeType& vtType) const; - - //- Set the cellSet or points selection - void setSelection(const dictionary& dict); - - //- Set the local field data - void setFieldData(const dictionary& dict, const wordList& fieldNames); - - //- Set the cell set based on the user input selection mode - void setCellSet(); - - -public: - - // Constructors - - //- Construct from components - TimeActivatedExplicitSource - ( - const word& name, - const dictionary& dict, - const fvMesh& mesh, - const wordList& fieldNames - ); - - //- Return clone - autoPtr<TimeActivatedExplicitSource> clone() const - { - notImplemented - ( - "autoPtr<TimeActivatedExplicitSource> clone() const" - ); - return autoPtr<TimeActivatedExplicitSource>(NULL); - } - - //- Return pointer to new TimeActivatedExplicitSource object created - // on the freestore from an Istream - class iNew - { - //- Reference to the mesh database - const fvMesh& mesh_; - - //- List of field names - const wordList& fieldNames_; - - - public: - - iNew - ( - const fvMesh& mesh, - const wordList& fieldNames - ) - : - mesh_(mesh), - fieldNames_(fieldNames) - {} - - autoPtr<TimeActivatedExplicitSource> operator()(Istream& is) const - { - const word name(is); - const dictionary dict(is); - - return autoPtr<TimeActivatedExplicitSource> - ( - new TimeActivatedExplicitSource - ( - name, - dict, - mesh_, - fieldNames_ - ) - ); - } - }; - - - // Member Functions - - // Access - - //- Return const access to the source name - inline const word& name() const; - - //- Return const access to the mesh database - inline const fvMesh& mesh() const; - - //- Return const access to the source active flag - inline bool active() const; - - //- Return const access to the time start - inline scalar timeStart() const; - - //- Return const access to the duration - inline scalar duration() const; - - //- Return const access to the time end - inline scalar timeEnd() const; - - //- Return const access to the volume mode - inline const volumeModeType& volumeMode() const; - - //- Return const access to the cell selection mode - inline const selectionModeType& selectionMode() const; - - //- Return const access to the list of points for "points" - // selectionMode - inline const List<point>& points() const; - - //- Return const access to the name of cell set for "cellSet" - // selectionMode - inline const word& cellSetName() const; - - //- Return const access to the total cell volume - inline scalar V() const; - - //- Return const access to the cell set - inline const labelList& cells() const; - - //- Return const access to the source field name vs value pairs - inline const List<fieldNameValuePair>& fieldData() const; - - //- Return const access to the the map of fields ids from supplied - // fields to local field source ids - inline const labelList& fieldIds() const; - - - // Edit - - //- Return access to the source name - inline word& name(); - - //- Return access to the source active flag - inline bool& active(); - - //- Return access to the time start - inline scalar& timeStart(); - - //- Return access to the duration - inline scalar& duration(); - - //- Return access to the volume mode - inline volumeModeType& volumeMode(); - - //- Return access to the cell selection mode - inline selectionModeType& selectionMode(); - - //- Return access to the list of points for "points" selectionMode - inline List<point>& points(); - - //- Return access to the name of cell set for "cellSet" - // selectionMode - inline word& cellSetName(); - - //- Return access to the total cell volume - inline scalar& V(); - - //- Return access to the cell set - inline labelList& cells(); - - //- Return access to the source field name vs value pairs - inline List<fieldNameValuePair>& fieldData(); - - //- Return access to the the map of fields ids from supplied - // fields to local field source ids - inline labelList& fieldIds(); - - - // Evaluation - - //- Add the source contribution to field Su - void addToField - ( - DimensionedField<Type, volMesh>& Su, - const label fieldI - ); - - - // I-O - - //- Write the source properties - void writeData(Ostream&) const; - - //- Ostream operator - friend Ostream& operator<< <Type> - ( - Ostream& os, - const TimeActivatedExplicitSource& source - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "TimeActivatedExplicitSource.C" -# include "TimeActivatedExplicitSourceIO.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "TimeActivatedExplicitSourceI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceI.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceI.H deleted file mode 100644 index 41ab9b6f5b4a9b1b826fb95884542f1f02d0eb79..0000000000000000000000000000000000000000 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceI.H +++ /dev/null @@ -1,228 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "TimeActivatedExplicitSource.H" - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -inline const Foam::word& Foam::TimeActivatedExplicitSource<Type>::name() const -{ - return name_; -} - - -template<class Type> -inline const Foam::fvMesh& Foam::TimeActivatedExplicitSource<Type>::mesh() const -{ - return mesh_; -} - - -template<class Type> -inline bool Foam::TimeActivatedExplicitSource<Type>::active() const -{ - return active_; -} - - -template<class Type> -inline Foam::scalar Foam::TimeActivatedExplicitSource<Type>::timeStart() const -{ - return timeStart_; -} - - -template<class Type> -inline Foam::scalar Foam::TimeActivatedExplicitSource<Type>::duration() const -{ - return duration_; -} - - -template<class Type> -inline Foam::scalar Foam::TimeActivatedExplicitSource<Type>::timeEnd() const -{ - return timeStart_ + duration_; -} - - -template<class Type> -inline const typename Foam::TimeActivatedExplicitSource<Type>::volumeModeType& -Foam::TimeActivatedExplicitSource<Type>::volumeMode() const -{ - return volumeMode_; -} - - -template<class Type> -inline const typename Foam::TimeActivatedExplicitSource<Type>:: -selectionModeType& -Foam::TimeActivatedExplicitSource<Type>::selectionMode() const -{ - return selectionMode_; -} - - -template<class Type> -inline const Foam::List<Foam::point>& -Foam::TimeActivatedExplicitSource<Type>::points() const -{ - return points_; -} - - -template<class Type> -inline const Foam::word& -Foam::TimeActivatedExplicitSource<Type>::cellSetName() const -{ - return cellSetName_; -} - - -template<class Type> -inline Foam::scalar Foam::TimeActivatedExplicitSource<Type>::V() const -{ - return V_; -} - - -template<class Type> -inline const Foam::labelList& -Foam::TimeActivatedExplicitSource<Type>::cells() const -{ - return cells_; -} - - -template<class Type> -inline const Foam::List<typename Foam::TimeActivatedExplicitSource<Type>:: -fieldNameValuePair>& -Foam::TimeActivatedExplicitSource<Type>::fieldData() const -{ - return fieldData_; -} - - -template<class Type> -inline const Foam::labelList& -Foam::TimeActivatedExplicitSource<Type>::fieldIds() const -{ - return fieldIds_; -} - - -template<class Type> -inline Foam::word& Foam::TimeActivatedExplicitSource<Type>::name() -{ - return name_; -} - - -template<class Type> -inline bool& Foam::TimeActivatedExplicitSource<Type>::active() -{ - return active_; -} - - -template<class Type> -inline Foam::scalar& Foam::TimeActivatedExplicitSource<Type>::timeStart() -{ - return timeStart_; -} - - -template<class Type> -inline Foam::scalar& Foam::TimeActivatedExplicitSource<Type>::duration() -{ - return duration_; -} - - -template<class Type> -inline typename Foam::TimeActivatedExplicitSource<Type>::volumeModeType& -Foam::TimeActivatedExplicitSource<Type>::volumeMode() -{ - return volumeMode_; -} - - -template<class Type> -inline typename Foam::TimeActivatedExplicitSource<Type>::selectionModeType& -Foam::TimeActivatedExplicitSource<Type>::selectionMode() -{ - return selectionMode_; -} - - -template<class Type> -inline Foam::List<Foam::point>& -Foam::TimeActivatedExplicitSource<Type>::points() -{ - return points_; -} - - -template<class Type> -inline Foam::word& Foam::TimeActivatedExplicitSource<Type>::cellSetName() -{ - return cellSetName_; -} - - -template<class Type> -inline Foam::scalar& Foam::TimeActivatedExplicitSource<Type>::V() -{ - return V_; -} - - -template<class Type> -inline Foam::labelList& Foam::TimeActivatedExplicitSource<Type>::cells() -{ - return cells_; -} - - -template<class Type> -inline Foam::List -< - typename Foam::TimeActivatedExplicitSource<Type>::fieldNameValuePair ->& -Foam::TimeActivatedExplicitSource<Type>::fieldData() -{ - return fieldData_; -} - - -template<class Type> -inline Foam::labelList& Foam::TimeActivatedExplicitSource<Type>::fieldIds() -{ - return fieldIds_; -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceIO.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceIO.C deleted file mode 100644 index 7b07e62d033c61fd91b91882ab35b839284d8da9..0000000000000000000000000000000000000000 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceIO.C +++ /dev/null @@ -1,101 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "TimeActivatedExplicitSource.H" - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -void Foam::TimeActivatedExplicitSource<Type>::writeData(Ostream& os) const -{ - os << indent << name_ << nl - << indent << token::BEGIN_BLOCK << incrIndent << nl; - - os.writeKeyword("active") << active_ << token::END_STATEMENT << nl; - os.writeKeyword("timeStart") << timeStart_ << token::END_STATEMENT << nl; - os.writeKeyword("duration") << duration_ << token::END_STATEMENT << nl; - os.writeKeyword("selectionMode") << selectionModeTypeToWord(selectionMode_) - << token::END_STATEMENT << nl; - os.writeKeyword("volumeMode") << volumeModeTypeToWord(volumeMode_) - << token::END_STATEMENT << nl; - - if (fieldIds_.size() == 1) - { - os.writeKeyword("fieldData") << fieldData_[0].second() - << token::END_STATEMENT << nl; - } - else - { - os.writeKeyword("fieldData") << fieldData_ << nl; - } - - switch (selectionMode_) - { - case smPoints: - { - os.writeKeyword("points") << nl << indent << points_ - << token::END_STATEMENT << nl; - break; - } - case smCellSet: - { - os.writeKeyword("cellSet") << cellSetName_ - << token::END_STATEMENT << nl; - break; - } - default: - { - FatalErrorIn - ( - "TimeActivatedExplicitSource<Type>::writeData" - "(" - "Ostream&, " - "bool" - ") const" - ) << "Unknown selectionMode " - << selectionModeTypeToWord(selectionMode_) - << abort(FatalError); - } - } - - os << decrIndent << indent << token::END_BLOCK << endl; -} - - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -template<class Type> -Foam::Ostream& Foam::operator<< -( - Ostream& os, - const TimeActivatedExplicitSource<Type>& source -) -{ - source.writeData(os); - return os; -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C deleted file mode 100644 index 65f1216bc75ebb7fe78c10395e05dd9f82e016af..0000000000000000000000000000000000000000 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.C +++ /dev/null @@ -1,222 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "TimeActivatedExplicitSourceList.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Type> -Foam::TimeActivatedExplicitSourceList<Type>::TimeActivatedExplicitSourceList -( - const word& name, - const fvMesh& mesh, - const dimensionSet& dimensions, - const wordList& fieldNames -) -: - IOPtrList<TimeActivatedExplicitSource<Type> > - ( - IOobject - ( - name + "SourceProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ), - typename TimeActivatedExplicitSource<Type>::iNew(mesh, fieldNames) - ), - name_(name), - mesh_(mesh), - dimensions_(dimensions), - fieldNames_(fieldNames) -{} - - -template<class Type> -Foam::TimeActivatedExplicitSourceList<Type>::TimeActivatedExplicitSourceList -( - const word& name, - const fvMesh& mesh, - const dimensionSet& dimensions, - const word& fieldName -) -: - IOPtrList<TimeActivatedExplicitSource<Type> > - ( - IOobject - ( - name + "SourceProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ), - typename TimeActivatedExplicitSource<Type>::iNew - ( - mesh, - IStringStream('(' + fieldName + ')')() - ) - ), - name_(name), - mesh_(mesh), - dimensions_(dimensions), - fieldNames_(1, fieldName) -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Type> -Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> > -Foam::TimeActivatedExplicitSourceList<Type>::Su(const label fieldI) -{ - tmp<DimensionedField<Type, volMesh> > tSu - ( - new DimensionedField<Type, volMesh> - ( - IOobject - ( - name_ + "Source_" + fieldNames_[fieldI], - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensioned<Type>("zero", dimensions_, pTraits<Type>::zero) - ) - ); - - DimensionedField<Type, volMesh>& Su = tSu(); - - forAll(*this, i) - { - this->operator[](i).addToField(Su, fieldI); - } - - return tSu; -} - - -template<class Type> -Foam::tmp<Foam::DimensionedField<Type, Foam::volMesh> > -Foam::TimeActivatedExplicitSourceList<Type>::SuTot() -{ - tmp<DimensionedField<Type, volMesh> > tSuTot - ( - new DimensionedField<Type, volMesh> - ( - IOobject - ( - name_ + "TotalSource", - mesh_.time().timeName(), - mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE - ), - mesh_, - dimensioned<Type>("zero", dimensions_, pTraits<Type>::zero) - ) - ); - - DimensionedField<Type, volMesh>& SuTot = tSuTot(); - - forAll(fieldNames_, fieldI) - { - forAll(*this, sourceI) - { - this->operator[](sourceI).addToField(SuTot, fieldI); - } - } - - return tSuTot; -} - - -template<class Type> -bool Foam::TimeActivatedExplicitSourceList<Type>::readData(Istream& is) -{ - this->clear(); - - IOPtrList<TimeActivatedExplicitSource<Type> > newSources - ( - IOobject - ( - name_ + "TimeActivatedExplicitSource", - mesh_.time().constant(), - mesh_, - IOobject::MUST_READ, - IOobject::NO_WRITE, - false - ), - typename TimeActivatedExplicitSource<Type>::iNew(mesh_, fieldNames_) - ); - - this->transfer(newSources); - - return is.good(); -} - - -template<class Type> -bool Foam::TimeActivatedExplicitSourceList<Type>::writeData(Ostream& os) const -{ - // Write size of list - os << nl << this->size(); - - // Write beginning of contents - os << nl << token::BEGIN_LIST; - - // Write list contents - forAll(*this, i) - { - os << nl; - this->operator[](i).writeData(os); - } - - // Write end of contents - os << token::END_LIST << token::END_STATEMENT << nl; - - // Check state of IOstream - return os.good(); -} - - -// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * // - -template<class Type> -Foam::Ostream& Foam::operator<< -( - Ostream& os, - const TimeActivatedExplicitSourceList<Type>& sources -) -{ - sources.writeData(os); - return os; -} - - -// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.H deleted file mode 100644 index 228d3127330a07a8450b0223d2559e1b0c533e91..0000000000000000000000000000000000000000 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/TimeActivatedExplicitSourceList.H +++ /dev/null @@ -1,171 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -Class - Foam::TimeActivatedExplicitSourceList - -Description - List of time activeted explict sources - -SourceFiles - TimeActivatedExplicitSourceList.C - -\*---------------------------------------------------------------------------*/ - -#ifndef TimeActivatedExplicitSourceList_H -#define TimeActivatedExplicitSourceList_H - -#include "IOPtrList.H" -#include "TimeActivatedExplicitSource.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -// Forward declaration of classes -class fvMesh; - -template<class Type> -class TimeActivatedExplicitSource; - -template<class Type> -class TimeActivatedExplicitSourceList; - -// Forward declaration of friend functions - -template<class Type> -Ostream& operator<< -( - Ostream&, - const TimeActivatedExplicitSourceList<Type>& -); - -/*---------------------------------------------------------------------------*\ - Class TimeActivatedExplicitSourceList Declaration -\*---------------------------------------------------------------------------*/ - -template<class Type> -class TimeActivatedExplicitSourceList -: - public IOPtrList<TimeActivatedExplicitSource<Type> > -{ -private: - - // Private data - - //- Name of source properties list - word name_; - - //- Reference to the mesh database - const fvMesh& mesh_; - - //- Dimensions of source properties - dimensionSet dimensions_; - - //- List of field names the source is working on - wordList fieldNames_; - - - // Private Member Functions - - //- Disallow default bitwise copy construct - TimeActivatedExplicitSourceList - ( - const TimeActivatedExplicitSourceList<Type>& - ); - - //- Disallow default bitwise assignment - void operator=(const TimeActivatedExplicitSourceList<Type>&); - - -public: - - // Constructors - - //- Construct from components with list of field names - TimeActivatedExplicitSourceList - ( - const word& name, - const fvMesh& mesh, - const dimensionSet& dimensions, - const wordList& fieldNames - ); - - //- Construct from components with single field name - TimeActivatedExplicitSourceList - ( - const word& name, - const fvMesh& mesh, - const dimensionSet& dimensions, - const word& fieldName - ); - - - // Member Functions - - // Evaluation - - //- Return the source for field, fieldI - tmp<DimensionedField<Type, volMesh> > Su - ( - const label fieldI = 0 - ); - - //- Return the total source for all fields - tmp<DimensionedField<Type, volMesh> > SuTot(); - - - - // I-O - - //- Read data from Istream - bool readData(Istream& is); - - //- Write data to Istream - bool writeData(Ostream& os) const; - - //- Ostream operator - friend Ostream& operator<< <Type> - ( - Ostream& os, - const TimeActivatedExplicitSourceList& sources - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository -# include "TimeActivatedExplicitSourceList.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.H b/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.H deleted file mode 100644 index 00b26abdb3e30b0a780ff7b649ea26238f4c52a4..0000000000000000000000000000000000000000 --- a/src/finiteVolume/cfdTools/general/fieldSources/timeActivatedExplicitSource/timeActivatedExplicitSource.H +++ /dev/null @@ -1,66 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 3 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, see <http://www.gnu.org/licenses/>. - -Typedef - Foam::timeActivatedExplicitSource - -\*---------------------------------------------------------------------------*/ - -#ifndef timeActivatedExplicitSource_H -#define timeActivatedExplicitSource_H - -#include "TimeActivatedExplicitSource.H" -#include "TimeActivatedExplicitSourceList.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - typedef TimeActivatedExplicitSource<scalar> - scalarTimeActivatedExplicitSource; - typedef TimeActivatedExplicitSource<vector> - vectorTimeActivatedExplicitSource; - typedef TimeActivatedExplicitSource<sphericalTensor> - sphericalTensorTimeActivatedExplicitSource; - typedef TimeActivatedExplicitSource<symmTensor> - symmTensorTimeActivatedExplicitSource; - typedef TimeActivatedExplicitSource<tensor> - tensorTimeActivatedExplicitSource; - - typedef TimeActivatedExplicitSourceList<scalar> - scalarTimeActivatedExplicitSourceList; - typedef TimeActivatedExplicitSourceList<vector> - vectorTimeActivatedExplicitSourceList; - typedef TimeActivatedExplicitSourceList<sphericalTensor> - sphericalTensorTimeActivatedExplicitSourceList; - typedef TimeActivatedExplicitSourceList<symmTensor> - symmTensorTimeActivatedExplicitSourceList; - typedef TimeActivatedExplicitSourceList<tensor> - tensorTimeActivatedExplicitSourceList; -} - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.H b/src/lagrangian/basic/InteractionLists/InteractionLists.H index 9490fc937d00809d565c6ff8f3ab5767d99a676f..bcbac057a272fa278893706c50ee5ef7b5e30f65 100644 --- a/src/lagrangian/basic/InteractionLists/InteractionLists.H +++ b/src/lagrangian/basic/InteractionLists/InteractionLists.H @@ -30,7 +30,7 @@ Description cells are potentially in range of each other. Builds referred interaction list, specifying which cells are - required to provide interactions across coupled patched (cyclic or + required to provide interactions across coupled patches (cyclic or processor). Generates referred cells, and refers particles to the correct processor, applying the appropriate transform. diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index 7007e0167b5a636ed7deff1526e7429e951d75e8..9ae6b2f5b9169c265bd60577384b97f0d58c9b64 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -339,7 +339,7 @@ void Foam::KinematicParcel<ParcelType>::hitFace(TrackData& td) typename TrackData::cloudType::parcelType& p = static_cast<typename TrackData::cloudType::parcelType&>(*this); - td.cloud().functions().postFace(p); + td.cloud().functions().postFace(p, p.face()); } @@ -363,7 +363,7 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch static_cast<typename TrackData::cloudType::parcelType&>(*this); // Invoke post-processing model - td.cloud().functions().postPatch(p, patchI); + td.cloud().functions().postPatch(p, patchI, pp.whichFace(p.face())); // Invoke surface film model if (td.cloud().surfaceFilm().transferParcel(p, pp, td.keepParticle)) diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H index 6eadb7fea82da1099277c395987ba3a49ea4c789..572be515a63fe96a7ebd9f9f3f9c84fdefa8429d 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H @@ -29,6 +29,7 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "FacePostProcessing.H" +#include "ParticleErosion.H" #include "ParticleTracks.H" #include "PatchPostProcessing.H" #include "VoidFraction.H" @@ -40,6 +41,7 @@ License makeCloudFunctionObject(CloudType); \ \ makeCloudFunctionObjectType(FacePostProcessing, CloudType); \ + makeCloudFunctionObjectType(ParticleErosion, CloudType); \ makeCloudFunctionObjectType(ParticleTracks, CloudType); \ makeCloudFunctionObjectType(PatchPostProcessing, CloudType); \ makeCloudFunctionObjectType(VoidFraction, CloudType); diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C index 02416263cbce244c69e91b0fe39d69b7af690c9a..d31ddd7c5e49d8a548f379ace2b14b927a15726d 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.C @@ -107,6 +107,7 @@ template<class CloudType> void Foam::CloudFunctionObject<CloudType>::postPatch ( const typename CloudType::parcelType&, + const label, const label ) { @@ -117,7 +118,8 @@ void Foam::CloudFunctionObject<CloudType>::postPatch template<class CloudType> void Foam::CloudFunctionObject<CloudType>::postFace ( - const typename CloudType::parcelType& + const typename CloudType::parcelType&, + const label ) { // do nothing diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H index 0ea373d5cb7cc8c4f13dc57a585681cd242ccb83..df17418c4bac7dac79f051f41e39a7de8896df59 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObject/CloudFunctionObject.H @@ -141,11 +141,16 @@ public: virtual void postPatch ( const typename CloudType::parcelType& p, - const label patchI + const label patchI, + const label patchFaceI ); //- Post-face hook - virtual void postFace(const typename CloudType::parcelType& p); + virtual void postFace + ( + const typename CloudType::parcelType& p, + const label faceI + ); }; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C index 7c9e715c78f6e0f05c83da56346fcd3a4f325c12..556c72908cb2ef46b5b2c03b0bd9bd0abd4bc78f 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.C @@ -146,12 +146,13 @@ template<class CloudType> void Foam::CloudFunctionObjectList<CloudType>::postPatch ( const typename CloudType::parcelType& p, - const label patchI + const label patchI, + const label patchFaceI ) { forAll(*this, i) { - this->operator[](i).postPatch(p, patchI); + this->operator[](i).postPatch(p, patchI, patchFaceI); } } @@ -159,12 +160,13 @@ void Foam::CloudFunctionObjectList<CloudType>::postPatch template<class CloudType> void Foam::CloudFunctionObjectList<CloudType>::postFace ( - const typename CloudType::parcelType& p + const typename CloudType::parcelType& p, + const label faceI ) { forAll(*this, i) { - this->operator[](i).postFace(p); + this->operator[](i).postFace(p, faceI); } } diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H index edba8be4a4845b77ccb755edbe53154ce2a2d2bc..b8b296fe2117000acdf9dee7e1491add68554cd0 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudFunctionObjectList/CloudFunctionObjectList.H @@ -121,11 +121,16 @@ public: virtual void postPatch ( const typename CloudType::parcelType& p, - const label patchI + const label patchI, + const label patchFaceI ); //- Post-face hook - virtual void postFace(const typename CloudType::parcelType& p); + virtual void postFace + ( + const typename CloudType::parcelType& p, + const label faceI + ); }; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C index 8888cdaa33b360159676d10e2fe5b4139a779105..ebe1c773d22a58633455ac5d9ba6c9420de3f84b 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.C @@ -390,16 +390,11 @@ Foam::FacePostProcessing<CloudType>::~FacePostProcessing() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template<class CloudType> -void Foam::FacePostProcessing<CloudType>::postPatch +void Foam::FacePostProcessing<CloudType>::postFace ( - const parcelType&, - const label + const parcelType& p, + const label faceI ) -{} - - -template<class CloudType> -void Foam::FacePostProcessing<CloudType>::postFace(const parcelType& p) { if ( @@ -407,13 +402,13 @@ void Foam::FacePostProcessing<CloudType>::postFace(const parcelType& p) || this->owner().solution().transient() ) { - label zoneI = -1; - label faceI = -1; - applyToFace(p.face(), zoneI, faceI); + label zoneId = -1; + label faceId = -1; + applyToFace(faceI, zoneId, faceId); - if ((zoneI != -1) && (faceI != -1)) + if ((zoneId != -1) && (faceId != -1)) { - mass_[zoneI][faceI] += p.mass()*p.nParticle(); + mass_[zoneId][faceId] += p.mass()*p.nParticle(); } } } diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.H index e61d8ba4a7ab1ae7c76b10f903db2357dfdbc8f7..4dc023ea04d84717f1ea0c2257846cb8c336ee4b 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/FacePostProcessing/FacePostProcessing.H @@ -161,11 +161,12 @@ public: // Evaluation - //- Post-patch hook - virtual void postPatch(const parcelType& p, const label patchI); - //- Post-face hook - virtual void postFace(const parcelType& p); + virtual void postFace + ( + const parcelType& p, + const label faceI + ); }; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C new file mode 100644 index 0000000000000000000000000000000000000000..3c649b17a961cc1016529d89a936326213605b4b --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.C @@ -0,0 +1,210 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "ParticleErosion.H" + +// * * * * * * * * * * * * * Protectd Member Functions * * * * * * * * * * * // + +template<class CloudType> +Foam::label Foam::ParticleErosion<CloudType>::applyToPatch +( + const label globalPatchI +) const +{ + forAll(patchIDs_, i) + { + if (patchIDs_[i] == globalPatchI) + { + return i; + } + } + + return -1; +} + + +template<class CloudType> +void Foam::ParticleErosion<CloudType>::write() +{ + if (QPtr_.valid()) + { + QPtr_->write(); + } + else + { + FatalErrorIn("void Foam::ParticleErosion<CloudType>::write()") + << "QPtr not valid" << abort(FatalError); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::ParticleErosion<CloudType>::ParticleErosion +( + const dictionary& dict, + CloudType& owner +) +: + CloudFunctionObject<CloudType>(dict, owner, typeName), + QPtr_(NULL), + patchIDs_(), + p_(readScalar(this->coeffDict().lookup("p"))), + psi_(this->coeffDict().template lookupOrDefault<scalar>("psi", 2.0)), + K_(this->coeffDict().template lookupOrDefault<scalar>("K", 2.0)) +{ + const wordList allPatchNames = owner.mesh().boundaryMesh().names(); + wordList patchName(this->coeffDict().lookup("patches")); + + labelHashSet uniquePatchIDs; + forAllReverse(patchName, i) + { + labelList patchIDs = findStrings(patchName[i], allPatchNames); + + if (patchIDs.empty()) + { + WarningIn + ( + "Foam::ParticleErosion<CloudType>::ParticleErosion" + "(" + "const dictionary&, " + "CloudType& " + ")" + ) << "Cannot find any patch names matching " << patchName[i] + << endl; + } + + uniquePatchIDs.insert(patchIDs); + } + + patchIDs_ = uniquePatchIDs.toc(); +} + + +template<class CloudType> +Foam::ParticleErosion<CloudType>::ParticleErosion +( + const ParticleErosion<CloudType>& pe +) +: + CloudFunctionObject<CloudType>(pe), + QPtr_(NULL), + patchIDs_(pe.patchIDs_), + p_(pe.p_), + psi_(pe.psi_), + K_(pe.K_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template<class CloudType> +Foam::ParticleErosion<CloudType>::~ParticleErosion() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template<class CloudType> +void Foam::ParticleErosion<CloudType>::preEvolve() +{ + if (QPtr_.valid()) + { + QPtr_->internalField() = 0.0; + } + else + { + const fvMesh& mesh = this->owner().mesh(); + + QPtr_.reset + ( + new volScalarField + ( + IOobject + ( + this->owner().name() + "Q", + mesh.time().timeName(), + mesh, + IOobject::NO_READ, + IOobject::NO_WRITE + ), + mesh, + dimensionedScalar("zero", dimVolume, 0.0) + ) + ); + } +} + + +template<class CloudType> +void Foam::ParticleErosion<CloudType>::postPatch +( + const parcelType& p, + const label patchI, + const label patchFaceI +) +{ + const label localPatchI = applyToPatch(patchI); + + if (localPatchI != -1) + { + const fvMesh& mesh = this->owner().mesh(); + + // patch-normal direction + vector nw = p.currentTetIndices().faceTri(mesh).normal(); + + // particle direction of travel + const vector& U = p.U(); + + // quick reject if particle travelling away from the patch + if ((-nw & U) < 0) + { + return; + } + + nw /= mag(nw); + const scalar magU = mag(U); + const vector Udir = U/magU; + + // determine impact angle, alpha + const scalar alpha = mathematical::pi/2.0 - acos(nw & Udir); + + const scalar coeff = p.nParticle()*p.mass()*sqr(magU)/(p_*psi_*K_); + + scalar& Q = QPtr_->boundaryField()[patchI][patchFaceI]; + if (tan(alpha) < K_/6.0) + { + Q += coeff*(sin(2.0*alpha) - 6.0/K_*sqr(sin(alpha))); + } + else + { + Q += coeff*(K_*sqr(cos(alpha))/6.0); + } + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.H new file mode 100644 index 0000000000000000000000000000000000000000..c23dfc4c402d70b182e9b4708ede0a8bf0dccae6 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleErosion/ParticleErosion.H @@ -0,0 +1,149 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\/ 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 3 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, see <http://www.gnu.org/licenses/>. + +Class + Foam::ParticleErosion + +Description + Creates particle erosion field, Q + +SourceFiles + ParticleErosion.C + +\*---------------------------------------------------------------------------*/ + +#ifndef ParticleErosion_H +#define ParticleErosion_H + +#include "CloudFunctionObject.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class ParticleErosion Declaration +\*---------------------------------------------------------------------------*/ + +template<class CloudType> +class ParticleErosion +: + public CloudFunctionObject<CloudType> +{ + // Private Data + + // Typedefs + + //- Convenience typedef for parcel type + typedef typename CloudType::parcelType parcelType; + + + //- Particle erosion field + autoPtr<volScalarField> QPtr_; + + //- List of patch indices to post-process + labelList patchIDs_; + + //- Plastic flow stress - typical metal value = 2.7 GPa + scalar p_; + + //- Ratio between depth of contact and length of cut - default=2 + scalar psi_; + + //- Ratio of normal and tangential forces - default=2 + scalar K_; + + +protected: + + // Protected Member Functions + + //- Returns local patchI if patch is in patchIds_ list + label applyToPatch(const label globalPatchI) const; + + //- Write post-processing info + virtual void write(); + + +public: + + //- Runtime type information + TypeName("particleErosion"); + + + // Constructors + + //- Construct from dictionary + ParticleErosion(const dictionary& dict, CloudType& owner); + + //- Construct copy + ParticleErosion(const ParticleErosion<CloudType>& pe); + + //- Construct and return a clone + virtual autoPtr<CloudFunctionObject<CloudType> > clone() const + { + return autoPtr<CloudFunctionObject<CloudType> > + ( + new ParticleErosion<CloudType>(*this) + ); + } + + + //- Destructor + virtual ~ParticleErosion(); + + + // Member Functions + + // Evaluation + + //- Pre-evolve hook + virtual void preEvolve(); + + //- Post-patch hook + virtual void postPatch + ( + const parcelType& p, + const label patchI, + const label patchFaceI + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "ParticleErosion.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C index 4dd5b3fdeec7dfcfcab79661684ac268e988575e..9721a5a55d400106bf9c17d87224f188ac3b99c4 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.C @@ -109,12 +109,11 @@ void Foam::ParticleTracks<CloudType>::preEvolve() template<class CloudType> -void Foam::ParticleTracks<CloudType>::postPatch(const parcelType&, const label) -{} - - -template<class CloudType> -void Foam::ParticleTracks<CloudType>::postFace(const parcelType& p) +void Foam::ParticleTracks<CloudType>::postFace +( + const parcelType& p, + const label +) { if ( @@ -126,7 +125,11 @@ void Foam::ParticleTracks<CloudType>::postFace(const parcelType& p) { FatalErrorIn ( - "Foam::ParticleTracks<CloudType>::postFace(const parcelType&)" + "Foam::ParticleTracks<CloudType>::postFace" + "(" + "const parcelType&, " + "const label" + ")" )<< "Cloud storage not allocated" << abort(FatalError); } diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.H index db2108367d2216c55a2cb06ce55bdcc784d69f45..9a9939dbb25e5ac5474f2a57371e228cde979985 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/ParticleTracks/ParticleTracks.H @@ -139,11 +139,12 @@ public: //- Pre-evolve hook virtual void preEvolve(); - //- Post-patch hook - virtual void postPatch(const parcelType& p, const label patchI); - //- Post-face hook - virtual void postFace(const parcelType& p); + virtual void postFace + ( + const parcelType& p, + const label faceI + ); }; diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C index 99249f84850b2148ae92ef37122e7664488b99e2..2b60f241b536d8195a92363a88e6e9c834bd941a 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.C @@ -196,7 +196,8 @@ template<class CloudType> void Foam::PatchPostProcessing<CloudType>::postPatch ( const parcelType& p, - const label patchI + const label patchI, + const label ) { const label localPatchI = applyToPatch(patchI); @@ -210,9 +211,4 @@ void Foam::PatchPostProcessing<CloudType>::postPatch } -template<class CloudType> -void Foam::PatchPostProcessing<CloudType>::postFace(const parcelType&) -{} - - // ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.H index 56d27345264ac595029ebf234401f683e9c7d8eb..83aaa1663bf1519eb9fb8934108b45bbe8cc5d2f 100644 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.H +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchPostProcessing/PatchPostProcessing.H @@ -121,10 +121,12 @@ public: // Evaluation //- Post-patch hook - virtual void postPatch(const parcelType& p, const label patchI); - - //- Post-face hook - virtual void postFace(const parcelType& p); + virtual void postPatch + ( + const parcelType& p, + const label patchI, + const label patchFaceI + ); }; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C index b3af69d60715c7fba6d438335c2bfe06e308bc6f..7851be5e707e204db8c77baf2de47b5dcab9b7d3 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairCollision.C @@ -128,7 +128,7 @@ void Foam::PairCollision<CloudType>::realReferredInteraction() const labelListList& ril = il_.ril(); List<IDLList<typename CloudType::parcelType> >& referredParticles = - il_.referredParticles(); + il_.referredParticles(); List<DynamicList<typename CloudType::parcelType*> >& cellOccupancy = this->owner().cellOccupancy(); @@ -137,7 +137,7 @@ void Foam::PairCollision<CloudType>::realReferredInteraction() forAll(ril, refCellI) { IDLList<typename CloudType::parcelType>& refCellRefParticles = - referredParticles[refCellI]; + referredParticles[refCellI]; const labelList& realCells = ril[refCellI]; @@ -260,6 +260,7 @@ void Foam::PairCollision<CloudType>::wallInteraction() U.boundaryField()[patchI][patchFaceI] ); + bool particleHit = false; if (normalAlignment > cosPhiMinFlatWall) { // Guard against a flat interaction being @@ -284,6 +285,8 @@ void Foam::PairCollision<CloudType>::wallInteraction() ); flatSiteData.append(wSD); + + particleHit = true; } } else @@ -293,7 +296,20 @@ void Foam::PairCollision<CloudType>::wallInteraction() otherSiteDistances.append(nearest.distance()); otherSiteData.append(wSD); + + particleHit = true; } + + if (particleHit) + { + this->owner().functions().postFace(p, realFaceI); + this->owner().functions().postPatch + ( + p, + patchI, + patchFaceI + ); + } } } @@ -333,6 +349,7 @@ void Foam::PairCollision<CloudType>::wallInteraction() il_.referredWallData()[refWallFaceI] ); + bool particleHit = false; if (normalAlignment > cosPhiMinFlatWall) { // Guard against a flat interaction being @@ -357,6 +374,8 @@ void Foam::PairCollision<CloudType>::wallInteraction() ); flatSiteData.append(wSD); + + particleHit = false; } } else @@ -366,6 +385,14 @@ void Foam::PairCollision<CloudType>::wallInteraction() otherSiteDistances.append(nearest.distance()); otherSiteData.append(wSD); + + particleHit = false; + } + + if (particleHit) + { + // TODO: call cloud function objects for referred + // wall particle interactions } } } diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C index 2e6a4b4384da5fab4fd8602aa60c85a1295dd619..cfa3fa852b88d4ec2bbca8f297f01ef00d4090f5 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C @@ -850,14 +850,6 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::calcAddressing return; } - - if (debug) - { - Info<< "AMI: calcAddressing" << endl; - writePatch(srcPatch, "VTK", "source"); - writePatch(tgtPatch, "VTK", "target"); - } - // temporary storage for addressing and weights List<DynamicList<label> > srcAddr(srcPatch.size()); List<DynamicList<scalar> > srcWght(srcPatch.size()); @@ -1307,8 +1299,6 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update if (debug) { - writeWeights(srcWeights_, srcPatch, "VTK", "source"); - writeWeights(tgtWeights_, tgtPatch, "VTK", "target"); writeFaceConnectivity(srcPatch, newTgtPatch, srcAddress_); } } @@ -1318,12 +1308,6 @@ void Foam::AMIInterpolation<SourcePatch, TargetPatch>::update calcAddressing(srcPatch, tgtPatch); - if (debug) - { - writeWeights(srcWeights_, srcPatch, "VTK", "source"); - writeWeights(tgtWeights_, tgtPatch, "VTK", "target"); - } - normaliseWeights(srcPatch, "source", srcAddress_, srcWeights_, true); normaliseWeights(tgtPatch, "target", tgtAddress_, tgtWeights_, true); } @@ -1527,7 +1511,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget const Field<Type>& fld ) const { - return interpolateToSource(fld, sumOp<Type>()); + return interpolateToTarget(fld, sumOp<Type>()); } @@ -1539,7 +1523,7 @@ Foam::AMIInterpolation<SourcePatch, TargetPatch>::interpolateToTarget const tmp<Field<Type> >& tFld ) const { - return interpolateToSource(tFld, sumOp<Type>()); + return interpolateToTarget(tFld, sumOp<Type>()); } @@ -1576,74 +1560,4 @@ const } -template<class SourcePatch, class TargetPatch> -void Foam::AMIInterpolation<SourcePatch, TargetPatch>::writeWeights -( - const scalarListList& weights, - const primitivePatch& patch, - const word& folder, - const word& prefix -) -const -{ -/* - static label i = 0; - - scalarField wghtSum(weights.size(), 0.0); - - forAll(weights, faceI) - { - scalar s = sum(weights[faceI]); - wghtSum[faceI] = s; - } - - vtkSurfaceWriter writer; - - writer.write - ( - folder, - prefix - + '_' + Foam::name(i) + "_proc" + Foam::name(Pstream::myProcNo()), - patch.localPoints(), - patch.localFaces(), - "weights", - wghtSum, - false - ); - - i++; -*/ -} - - -template<class SourcePatch, class TargetPatch> -void Foam::AMIInterpolation<SourcePatch, TargetPatch>::writePatch -( - const primitivePatch& patch, - const word& folder, - const word& prefix -) -const -{ -/* - static label i = 0; - - vtkSurfaceWriter writer; - writer.write - ( - folder, - prefix - + '_' + Foam::name(i) + "_proc" + Foam::name(Pstream::myProcNo()), - patch.localPoints(), - patch.localFaces(), - "AMIPatch", - scalarField(patch.size(), Pstream::myProcNo()), - false - ); - - i++; -*/ -} - - // ************************************************************************* // diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H index 8df0d6fb4abaa105efca9f31ce858ecef62a1bcc..8ac857a66f85147e896c01c175f56b2cf4ea6ac5 100644 --- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H +++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.H @@ -416,25 +416,6 @@ public: const primitivePatch& tgtPatch, const labelListList& srcAddress ) const; - - //- Write weights to VTK file - void writeWeights - ( - const scalarListList& weights, - const primitivePatch& patch, - const word& folder, - const word& prefix - ) - const; - - //- Write patch - void writePatch - ( - const primitivePatch& patch, - const word& folder, - const word& prefix - ) - const; }; diff --git a/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.C index 094524091e1e7236f5fdbba15a692b16063c7b92..61f758966f95f07f906c04ff4c90e17dadbbdf77 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/fvDOM/fvDOM/fvDOM.C @@ -63,7 +63,7 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) "G", mesh_.time().timeName(), mesh_, - IOobject::NO_READ, + IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), mesh_, @@ -76,7 +76,7 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) "Qr", mesh_.time().timeName(), mesh_, - IOobject::NO_READ, + IOobject::READ_IF_PRESENT, IOobject::AUTO_WRITE ), mesh_, @@ -102,8 +102,8 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) "Qin", mesh_.time().timeName(), mesh_, - IOobject::NO_READ, - IOobject::NO_WRITE + IOobject::READ_IF_PRESENT, + IOobject::AUTO_WRITE ), mesh_, dimensionedScalar("Qin", dimMass/pow3(dimTime), 0.0) @@ -228,7 +228,6 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T) ); i++; } - } } @@ -277,7 +276,7 @@ bool Foam::radiation::fvDOM::read() { if (radiationModel::read()) { -// Only reading solution parameters - not changing ray geometry + // Only reading solution parameters - not changing ray geometry coeffs_.readIfPresent("convergence", convergence_); coeffs_.readIfPresent("maxIter", maxIter_); diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C index 3c968483b68f2eb97b35393d1e996b7865f579ca..7e780fe22f8e0accffda0157f34bbdbd2b9e4f9d 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.C @@ -61,6 +61,7 @@ Foam::radiation::radiationModel::radiationModel(const volScalarField& T) radiation_(false), coeffs_(dictionary::null), solverFreq_(0), + firstIter_(true), absorptionEmission_(NULL), scatter_(NULL) {} @@ -89,6 +90,7 @@ Foam::radiation::radiationModel::radiationModel radiation_(lookup("radiation")), coeffs_(subDict(type + "Coeffs")), solverFreq_(readLabel(lookup("solverFreq"))), + firstIter_(true), absorptionEmission_(absorptionEmissionModel::New(*this, mesh_)), scatter_(scatterModel::New(*this, mesh_)) { @@ -130,9 +132,10 @@ void Foam::radiation::radiationModel::correct() return; } - if (time_.timeIndex() % solverFreq_ == 0) + if (firstIter_ || (time_.timeIndex() % solverFreq_ == 0)) { calculate(); + firstIter_ = false; } } diff --git a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H index 3f58438700d17cd5b4c9a403ff0f6a1791c49be5..f33f962784b37aa28f766e68afb6b7dacaac41a6 100644 --- a/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H +++ b/src/thermophysicalModels/radiationModels/radiationModel/radiationModel/radiationModel.H @@ -91,6 +91,9 @@ protected: // radiation solver iteration label solverFreq_; + //- Flag to enable radiation model to be evaluated on first iteration + bool firstIter_; + // References to the radiation sub-models diff --git a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H index eba7d3394ba2e2655535c909a92e1449e3b9467f..2135d53e03cc2f13e280ad00923ddd40a51b3c56 100644 --- a/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H +++ b/src/thermophysicalModels/specie/thermo/janaf/janafThermoI.H @@ -206,15 +206,15 @@ inline void Foam::janafThermo<EquationOfState>::operator+= if (notEqual(Tcommon_, jt.Tcommon_)) { - WarningIn + FatalErrorIn ( "janafThermo<EquationOfState>::operator+=" "(const janafThermo<EquationOfState>& jt) const" - ) << "Tcommon " << Tcommon_ << " != " << jt.Tcommon_ - << ", an average value will be used for the result" - << endl; - - Tcommon_ = molr1*Tcommon_ + molr2*jt.Tcommon_; + ) << "Tcommon " << Tcommon_ << " for " + << (this->name().size() ? this->name() : "others") + << " != " << jt.Tcommon_ << " for " + << (jt.name().size() ? jt.name() : "others") + << exit(FatalError); } for @@ -253,15 +253,15 @@ inline void Foam::janafThermo<EquationOfState>::operator-= if (notEqual(Tcommon_, jt.Tcommon_)) { - WarningIn + FatalErrorIn ( "janafThermo<EquationOfState>::operator-=" "(const janafThermo<EquationOfState>& jt) const" - ) << "Tcommon " << Tcommon_ << " != " << jt.Tcommon_ - << ", an average value will be used for the result" - << endl; - - Tcommon_ = (molr1*Tcommon_ + molr2*jt.Tcommon_)/(molr1 + molr2); + ) << "Tcommon " << Tcommon_ << " for " + << (this->name().size() ? this->name() : "others") + << " != " << jt.Tcommon_ << " for " + << (jt.name().size() ? jt.name() : "others") + << exit(FatalError); } for @@ -316,19 +316,18 @@ inline Foam::janafThermo<EquationOfState> Foam::operator+ + molr2*jt2.lowCpCoeffs_[coefLabel]; } - scalar Tcommon = jt1.Tcommon_; if (notEqual(jt1.Tcommon_, jt2.Tcommon_)) { - WarningIn + FatalErrorIn ( "operator+" "(const janafThermo<EquationOfState>& jt1," " const janafThermo<EquationOfState>& jt2)" - ) << "Tcommon " << jt1.Tcommon_ << " != " << jt2.Tcommon_ - << ", an average value will be used for the result" - << endl; - - Tcommon = molr1*jt1.Tcommon_ + molr2*jt2.Tcommon_; + ) << "Tcommon " << jt1.Tcommon_ << " for " + << (jt1.name().size() ? jt1.name() : "others") + << " != " << jt2.Tcommon_ << " for " + << (jt2.name().size() ? jt2.name() : "others") + << exit(FatalError); } return janafThermo<EquationOfState> @@ -336,7 +335,7 @@ inline Foam::janafThermo<EquationOfState> Foam::operator+ eofs, max(jt1.Tlow_, jt2.Tlow_), min(jt1.Thigh_, jt2.Thigh_), - Tcommon, + jt1.Tcommon_, highCpCoeffs, lowCpCoeffs ); @@ -375,19 +374,18 @@ inline Foam::janafThermo<EquationOfState> Foam::operator- - molr2*jt2.lowCpCoeffs_[coefLabel]; } - scalar Tcommon = jt1.Tcommon_; if (notEqual(jt1.Tcommon_, jt2.Tcommon_)) { - WarningIn + FatalErrorIn ( "operator-" "(const janafThermo<EquationOfState>& jt1," " const janafThermo<EquationOfState>& jt2)" - ) << "Tcommon " << jt1.Tcommon_ << " != " << jt2.Tcommon_ - << ", an average value will be used for the result" - << endl; - - Tcommon = (molr1*jt1.Tcommon_ + molr2*jt2.Tcommon_)/(molr1 + molr2); + ) << "Tcommon " << jt1.Tcommon_ << " for " + << (jt1.name().size() ? jt1.name() : "others") + << " != " << jt2.Tcommon_ << " for " + << (jt2.name().size() ? jt2.name() : "others") + << exit(FatalError); } return janafThermo<EquationOfState> @@ -395,7 +393,7 @@ inline Foam::janafThermo<EquationOfState> Foam::operator- eofs, max(jt1.Tlow_, jt2.Tlow_), min(jt1.Thigh_, jt2.Thigh_), - Tcommon, + jt1.Tcommon_, highCpCoeffs, lowCpCoeffs ); diff --git a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C index 0d7ead98d18b96e9594fa46e2a4f74f233adf8f1..07cc0c9481eed6baa9c866a8875b3811c405c4ee 100644 --- a/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C +++ b/src/turbulenceModels/derivedFvPatchFields/porousBafflePressure/porousBafflePressureFvPatchField.C @@ -70,17 +70,10 @@ Foam::porousBafflePressureFvPatchField<Type>::porousBafflePressureFvPatchField I_(readScalar(dict.lookup("I"))), length_(readScalar(dict.lookup("length"))) { - if (dict.found("value")) - { - fvPatchField<Type>::operator= - ( - Field<Type>("value", dict, p.size()) - ); - } - else - { - this->evaluate(Pstream::blocking); - } + fvPatchField<Type>::operator= + ( + Field<Type>("value", dict, p.size()) + ); } diff --git a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C index 5458ad5e6498b5cce4ce0590878a24c43506c687..eaf09f03c1a25fcd9e496180e13fb8e77b5ef75e 100644 --- a/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C +++ b/src/turbulenceModels/incompressible/RAS/LienCubicKELowRe/LienCubicKELowRe.C @@ -426,6 +426,7 @@ void LienCubicKELowRe::correct() volScalarField G ( + "RASModel::G", Cmu_*fMu*sqr(k_)/epsilon_*S2 - (nonlinearStress_ && gradU_) ); diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/Allrun b/tutorials/incompressible/pisoFoam/les/motorBike/Allrun index 634e4374e3394d8b3b22835a3dfd2dc32023b775..14cc54db66dd13529ebcc0663b20e4b1bea0a281 100755 --- a/tutorials/incompressible/pisoFoam/les/motorBike/Allrun +++ b/tutorials/incompressible/pisoFoam/les/motorBike/Allrun @@ -25,7 +25,7 @@ cloneParallelCase() # Do the Spalart-Allmaras steady-state case (cd motorBike && foamRunTutorials) -# Clone the steady-stae case to the LES case +# Clone the steady-state case to the LES case cloneParallelCase motorBike motorBikeLES # Do the LES case diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/U b/tutorials/incompressible/simpleFoam/turbineSiting/0/U similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/U rename to tutorials/incompressible/simpleFoam/turbineSiting/0/U diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/epsilon b/tutorials/incompressible/simpleFoam/turbineSiting/0/epsilon similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/epsilon rename to tutorials/incompressible/simpleFoam/turbineSiting/0/epsilon diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/include/ABLConditions b/tutorials/incompressible/simpleFoam/turbineSiting/0/include/ABLConditions similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/include/ABLConditions rename to tutorials/incompressible/simpleFoam/turbineSiting/0/include/ABLConditions diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/include/fixedInlet b/tutorials/incompressible/simpleFoam/turbineSiting/0/include/fixedInlet similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/include/fixedInlet rename to tutorials/incompressible/simpleFoam/turbineSiting/0/include/fixedInlet diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/include/initialConditions b/tutorials/incompressible/simpleFoam/turbineSiting/0/include/initialConditions similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/include/initialConditions rename to tutorials/incompressible/simpleFoam/turbineSiting/0/include/initialConditions diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/include/sideAndTopPatches b/tutorials/incompressible/simpleFoam/turbineSiting/0/include/sideAndTopPatches similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/include/sideAndTopPatches rename to tutorials/incompressible/simpleFoam/turbineSiting/0/include/sideAndTopPatches diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/k b/tutorials/incompressible/simpleFoam/turbineSiting/0/k similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/k rename to tutorials/incompressible/simpleFoam/turbineSiting/0/k diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/nut b/tutorials/incompressible/simpleFoam/turbineSiting/0/nut similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/nut rename to tutorials/incompressible/simpleFoam/turbineSiting/0/nut diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/0/p b/tutorials/incompressible/simpleFoam/turbineSiting/0/p similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/0/p rename to tutorials/incompressible/simpleFoam/turbineSiting/0/p diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/Allclean b/tutorials/incompressible/simpleFoam/turbineSiting/Allclean similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/Allclean rename to tutorials/incompressible/simpleFoam/turbineSiting/Allclean diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/Allrun b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/Allrun rename to tutorials/incompressible/simpleFoam/turbineSiting/Allrun diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/constant/RASProperties b/tutorials/incompressible/simpleFoam/turbineSiting/constant/RASProperties similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/constant/RASProperties rename to tutorials/incompressible/simpleFoam/turbineSiting/constant/RASProperties diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/constant/polyMesh/blockMeshDict b/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/blockMeshDict similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/constant/polyMesh/blockMeshDict rename to tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/blockMeshDict diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/constant/polyMesh/boundary b/tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/constant/polyMesh/boundary rename to tutorials/incompressible/simpleFoam/turbineSiting/constant/polyMesh/boundary diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/constant/sourcesProperties b/tutorials/incompressible/simpleFoam/turbineSiting/constant/sourcesProperties similarity index 93% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/constant/sourcesProperties rename to tutorials/incompressible/simpleFoam/turbineSiting/constant/sourcesProperties index 0af83ef73c78e243d175bfe348a98b28c2f9e192..a4dee066b519eef9cd1cc3c35ae80094449c3e70 100644 --- a/tutorials/incompressible/windSimpleFoam/turbineSiting/constant/sourcesProperties +++ b/tutorials/incompressible/simpleFoam/turbineSiting/constant/sourcesProperties @@ -23,10 +23,10 @@ disk1 duration 1000.0; //duration selectionMode cellSet; //cellSet // points //cellZone cellSet actuationDisk1;//cellSet name when selectionMode = cellSet - cellZone actuationDisk1;//cellZone name when selectionMode = cellZone actuationDiskSourceCoeffs { + fieldName U; diskDir (-1 0 0); // orientation of the disk Cp 0.53; // Cp Ct 0.58; // Ct @@ -42,14 +42,15 @@ disk2 duration 1000.0; selectionMode cellSet; cellSet actuationDisk2; - cellZone actuationDisk2; actuationDiskSourceCoeffs { + fieldName U; diskDir (-1 0 0); Cp 0.53; Ct 0.58; diskArea 40; } } + // ************************************************************************* // diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/constant/transportProperties b/tutorials/incompressible/simpleFoam/turbineSiting/constant/transportProperties similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/constant/transportProperties rename to tutorials/incompressible/simpleFoam/turbineSiting/constant/transportProperties diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/constant/triSurface/terrain.stl b/tutorials/incompressible/simpleFoam/turbineSiting/constant/triSurface/terrain.stl similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/constant/triSurface/terrain.stl rename to tutorials/incompressible/simpleFoam/turbineSiting/constant/triSurface/terrain.stl diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/makeZones b/tutorials/incompressible/simpleFoam/turbineSiting/makeZones similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/makeZones rename to tutorials/incompressible/simpleFoam/turbineSiting/makeZones diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/changeDictionaryDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/changeDictionaryDict rename to tutorials/incompressible/simpleFoam/turbineSiting/system/changeDictionaryDict diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/controlDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/controlDict similarity index 97% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/controlDict rename to tutorials/incompressible/simpleFoam/turbineSiting/system/controlDict index f2df1da69d83d1f607b118e7ebb979dd75c24869..f930bfe64866d66e1632d70f407a3191a86d7e02 100644 --- a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/controlDict +++ b/tutorials/incompressible/simpleFoam/turbineSiting/system/controlDict @@ -14,7 +14,7 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -application windSimpleFoam; +application simpleFoam; startFrom latestTime; diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/decomposeParDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/decomposeParDict rename to tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/decomposeParDict-4proc b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-4proc similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/decomposeParDict-4proc rename to tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-4proc diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/decomposeParDict-nonPar b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/decomposeParDict-nonPar rename to tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-nonPar diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/decomposeParDict-par b/tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/decomposeParDict-par rename to tutorials/incompressible/simpleFoam/turbineSiting/system/decomposeParDict-par diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/fvSchemes b/tutorials/incompressible/simpleFoam/turbineSiting/system/fvSchemes similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/fvSchemes rename to tutorials/incompressible/simpleFoam/turbineSiting/system/fvSchemes diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/fvSolution b/tutorials/incompressible/simpleFoam/turbineSiting/system/fvSolution similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/fvSolution rename to tutorials/incompressible/simpleFoam/turbineSiting/system/fvSolution diff --git a/tutorials/incompressible/windSimpleFoam/turbineSiting/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict similarity index 100% rename from tutorials/incompressible/windSimpleFoam/turbineSiting/system/snappyHexMeshDict rename to tutorials/incompressible/simpleFoam/turbineSiting/system/snappyHexMeshDict diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/energySourceProperties b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/energySourceProperties deleted file mode 100644 index b551f35f228f04810eeec549dce5511a3ea41b40..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/energySourceProperties +++ /dev/null @@ -1,22 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object energySourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - // none -); - -// ************************************************************************* // diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/momentumSourceProperties b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/momentumSourceProperties deleted file mode 100644 index c9cf6ca3fe1263e7e7d66eb9a335dbe45a7b2a17..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/momentumSourceProperties +++ /dev/null @@ -1,23 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object momentumSourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - // none -); - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/massSourceProperties b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/sourcesProperties similarity index 93% rename from tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/massSourceProperties rename to tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/sourcesProperties index 11811461db17c48f404b9e64569b7f02424f0b98..8aedc2c3067b699efa8aeb1326ffd19ca18dfef3 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/massSourceProperties +++ b/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/sourcesProperties @@ -11,13 +11,10 @@ FoamFile format ascii; class dictionary; location "constant"; - object massSourcesProperties; + object sourcesProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -( - // none -); - +// none // ************************************************************************* // diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/energySourceProperties b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/energySourceProperties deleted file mode 100644 index b551f35f228f04810eeec549dce5511a3ea41b40..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/energySourceProperties +++ /dev/null @@ -1,22 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object energySourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - // none -); - -// ************************************************************************* // diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/momentumSourceProperties b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/momentumSourceProperties deleted file mode 100644 index c9cf6ca3fe1263e7e7d66eb9a335dbe45a7b2a17..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/momentumSourceProperties +++ /dev/null @@ -1,23 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object momentumSourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - // none -); - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/massSourceProperties b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/sourcesProperties similarity index 93% rename from tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/massSourceProperties rename to tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/sourcesProperties index 11811461db17c48f404b9e64569b7f02424f0b98..8aedc2c3067b699efa8aeb1326ffd19ca18dfef3 100644 --- a/tutorials/lagrangian/LTSReactingParcelFoam/counterFlowFlame2D/constant/massSourceProperties +++ b/tutorials/lagrangian/LTSReactingParcelFoam/verticalChannel/constant/sourcesProperties @@ -11,13 +11,10 @@ FoamFile format ascii; class dictionary; location "constant"; - object massSourcesProperties; + object sourcesProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -( - // none -); - +// none // ************************************************************************* // diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/energySourceProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/energySourceProperties deleted file mode 100644 index b10138820a14d5d35eae5daf65390a7d9c76b721..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/energySourceProperties +++ /dev/null @@ -1,31 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object energySourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - source1 - { - active true; - timeStart 0.15; - duration 0.2; - selectionMode cellSet; - volumeMode absolute; - fieldData 20000; - cellSet ignitionCells; - } -); - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/massSourceProperties b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/sourcesProperties similarity index 73% rename from tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/massSourceProperties rename to tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/sourcesProperties index 30c8a7de3abf547ab01be6fae555f4e17e2beab2..0c93adb63225df18e130cc114acb3d61071ff031 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/massSourceProperties +++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/constant/sourcesProperties @@ -11,28 +11,28 @@ FoamFile format ascii; class dictionary; location "constant"; - object massSourcesProperties; + object sourcesProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -( - source1 +source1 +{ + type scalarExplicitSource; + active true; + timeStart 0.15; + duration 0.2; + selectionMode cellSet; + cellSet ignitionCells; + + scalarExplicitSourceCoeffs { - active true; - timeStart 0.2; - duration 2.0; - selectionMode points; volumeMode absolute; fieldData - ( - (H2O 1e-4) // kg/s - ); - points - ( - (2.75 0.5 0) - ); + { + hs 20000; + } } -); +} // ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/energySourceProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/energySourceProperties deleted file mode 100644 index 7bb14d0371293b04fa7b4bffdd8459ef97249797..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/energySourceProperties +++ /dev/null @@ -1,34 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object energySourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - source1 - { - active true; - timeStart 0.2; - duration 2.0; - selectionMode points; - volumeMode absolute; - fieldData 10; - points - ( - (2.75 0.5 0) - ); - } -); - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/momentumSourceProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/momentumSourceProperties deleted file mode 100644 index e28bdc8552462fe7c78dd08bc56178fa6640986b..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/momentumSourceProperties +++ /dev/null @@ -1,35 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object momentumSourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - source1 - { - active true; - timeStart 0.2; - duration 2.0; - selectionMode points; - volumeMode absolute; - fieldData (0 0.005 0); - points - ( - (2.75 0.5 0) - ); - } -); - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/sourcesProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/sourcesProperties new file mode 100644 index 0000000000000000000000000000000000000000..0bcf0c982b673244df695fafec69a847e3d8e716 --- /dev/null +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/filter/constant/sourcesProperties @@ -0,0 +1,89 @@ +/*--------------------------------*- C++ -*----------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: dev | +| \\ / A nd | Web: www.OpenFOAM.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object sourcesProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +massSource1 +{ + type scalarExplicitSource; + active true; + timeStart 0.2; + duration 2.0; + selectionMode points; + points + ( + (2.75 0.5 0) + ); + + scalarExplicitSourceCoeffs + { + volumeMode absolute; + fieldData + { + rho 1e-4; // kg/s + H2O 1e-4; // kg/s + p 1e-4; // kg/s + } + } +} + + +momentumSource1 +{ + type vectorExplicitSource; + active true; + timeStart 0.2; + duration 2.0; + selectionMode points; + points + ( + (2.75 0.5 0) + ); + + vectorExplicitSourceCoeffs + { + volumeMode absolute; + fieldData + { + U (0 0.005 0); + } + } +} + + +energySource1 +{ + type scalarExplicitSource; + active true; + timeStart 0.2; + duration 2.0; + selectionMode points; + points + ( + (2.75 0.5 0) + ); + + scalarExplicitSourceCoeffs + { + volumeMode absolute; + fieldData + { + hs 10; + } + } +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/energySourceProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/energySourceProperties deleted file mode 100644 index b551f35f228f04810eeec549dce5511a3ea41b40..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/energySourceProperties +++ /dev/null @@ -1,22 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object energySourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - // none -); - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/momentumSourceProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/momentumSourceProperties deleted file mode 100644 index c9cf6ca3fe1263e7e7d66eb9a335dbe45a7b2a17..0000000000000000000000000000000000000000 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/momentumSourceProperties +++ /dev/null @@ -1,23 +0,0 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: dev | -| \\ / A nd | Web: www.OpenFOAM.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -FoamFile -{ - version 2.0; - format ascii; - class dictionary; - location "constant"; - object momentumSourcesProperties; -} -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -( - // none -); - - -// ************************************************************************* // diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/massSourceProperties b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/sourcesProperties similarity index 93% rename from tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/massSourceProperties rename to tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/sourcesProperties index 11811461db17c48f404b9e64569b7f02424f0b98..8aedc2c3067b699efa8aeb1326ffd19ca18dfef3 100644 --- a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/massSourceProperties +++ b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/verticalChannel/constant/sourcesProperties @@ -11,13 +11,10 @@ FoamFile format ascii; class dictionary; location "constant"; - object massSourcesProperties; + object sourcesProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -( - // none -); - +// none // ************************************************************************* // diff --git a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/changeDictionaryDict b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/changeDictionaryDict index 971bafaa29770122bc4d04458f280bd9762f22e2..4ffe6871510e5c2e9cba3596fe5d63533eabe94e 100644 --- a/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/changeDictionaryDict +++ b/tutorials/multiphase/interFoam/ras/damBreakPorousBaffle/system/changeDictionaryDict @@ -27,7 +27,7 @@ dictionaryReplacement D 700; I 500; length 1.05; - jump uniform 0 + jump uniform 0; value uniform 0; } porous_half1 diff --git a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/mechanicalProperties b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/mechanicalProperties index c92d02a0f7d43d03d8a7a03776cb74b317baaa3a..377c6cee24659887dd4de652bd1a561ff9f3ae51 100644 --- a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/mechanicalProperties +++ b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/mechanicalProperties @@ -17,20 +17,20 @@ FoamFile rho { - rho rhoInf; - rhoInf rhoInf [ 1 -3 0 0 0 0 0 ] 7854; + type uniform; + value 7854; } nu { - nu nuInf; - nuInf nuInf [ 0 0 0 0 0 0 0 ] 0.3; + type uniform; + value 0.3; } E { - E EInf; - EInf EInf [ 1 -1 -2 0 0 0 0 ] 2e+11; + type uniform; + value 2e+11; } planeStress yes; diff --git a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/thermalProperties b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/thermalProperties index f68549dbba9a3c552ce22a71ee8fb3336c4fedbe..77f422aca4da98c5b92147a8330c7c8922fbd3f9 100644 --- a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/thermalProperties +++ b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/constant/thermalProperties @@ -17,20 +17,20 @@ FoamFile C { - C CInf; - CInf CInf [ 0 2 -2 -1 0 0 0 ] 434; + type uniform; + value 434; } k { - k kInf; - kInf kInf [ 1 1 -3 -1 0 0 0 ] 60.5; + type uniform; + value 60.5; } alpha { - alpha alphaInf; - alphaInf alphaInf [ 0 0 0 -1 0 0 0 ] 1.1e-05; + type uniform; + value 1.1e-05; } thermalStress no; diff --git a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/constant/mechanicalProperties b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/constant/mechanicalProperties index f14ecc2556972ac31ca79e56cdb31cd8ec05a853..8e28bddeb6223977f258e31f1050c4cc1db6ca7d 100644 --- a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/constant/mechanicalProperties +++ b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/constant/mechanicalProperties @@ -15,13 +15,24 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -rho rho [ 1 -3 0 0 0 0 0 ] 7854; +rho +{ + type uniform; + value 7854; +} -E E [ 1 -1 -2 0 0 0 0 ] 2e+11; +nu +{ + type uniform; + value 0.0; +} -nu nu [ 0 0 0 0 0 0 0 ] 0; +E +{ + type uniform; + value 2e+11; +} planeStress yes; - // ************************************************************************* // diff --git a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/constant/thermalProperties b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/constant/thermalProperties index 9d09fa79015d53d74ddd4f78ce3837f80eb55bc6..77f422aca4da98c5b92147a8330c7c8922fbd3f9 100644 --- a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/constant/thermalProperties +++ b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/constant/thermalProperties @@ -15,11 +15,23 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -C C [ 0 2 -2 -1 0 0 0 ] 434; +C +{ + type uniform; + value 434; +} -k k [ 1 1 -3 -1 0 0 0 ] 60.5; +k +{ + type uniform; + value 60.5; +} -alpha alpha [ 0 0 0 -1 0 0 0 ] 1.1e-05; +alpha +{ + type uniform; + value 1.1e-05; +} thermalStress no;