diff --git a/src/OpenFOAM/db/dictionary/dictionary.C b/src/OpenFOAM/db/dictionary/dictionary.C index 3d2f08da8c..e646ce06f3 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.C +++ b/src/OpenFOAM/db/dictionary/dictionary.C @@ -31,7 +31,7 @@ License #include "DynamicList.H" #include "inputSyntaxEntry.H" #include "fileOperation.H" - +#include "stringOps.H" /* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */ @@ -330,7 +330,12 @@ const Foam::entry* Foam::dictionary::lookupScopedSubEntryPtr // Lookup in the dictionary specified by file name // created from the part of the keyword before the '!' - const fileName fName = keyword.substr(0, emarkPos); + fileName fName = keyword.substr(0, emarkPos); + + if (!fName.isAbsolute()) + { + fName = topDict().name().path()/fName; + } if (fName == topDict().name()) { @@ -351,7 +356,7 @@ const Foam::entry* Foam::dictionary::lookupScopedSubEntryPtr autoPtr ifsPtr ( - fileHandler().NewIFstream(topDict().name().path()/fName) + fileHandler().NewIFstream(fName) ); ISstream& ifs = ifsPtr(); diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/T b/tutorials/combustion/coldEngineFoam/freePiston/0/T index bda2f9458c..c3a471c589 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/T +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/T @@ -14,12 +14,11 @@ FoamFile object T; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "include/caseSettings" +#inputSyntax slash; dimensions [0 0 0 1 0 0 0]; -internalField uniform $:internalField.T; +internalField uniform $include/caseSettings!internalField/T; boundaryField { @@ -35,7 +34,7 @@ boundaryField liner { - $:wall.T; + $include/caseSettings!wall/T; } cylinderHead diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/U b/tutorials/combustion/coldEngineFoam/freePiston/0/U index 567a48aa99..f9ee829058 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/U +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/U @@ -14,12 +14,11 @@ FoamFile object U; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "include/caseSettings" +#inputSyntax slash; dimensions [0 1 -1 0 0 0 0]; -internalField uniform $:internalField.U; +internalField uniform $include/caseSettings!internalField/U; boundaryField { @@ -35,7 +34,7 @@ boundaryField liner { - $:wall.U; + $include/caseSettings!wall/U; } cylinderHead @@ -45,7 +44,7 @@ boundaryField piston { - $:piston.U; + $include/caseSettings!piston/U; } } diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/air b/tutorials/combustion/coldEngineFoam/freePiston/0/air index b7f11f1c90..1a8fd32459 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/air +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/air @@ -14,8 +14,7 @@ FoamFile object air; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "include/caseSettings" +#inputSyntax slash; dimensions [0 0 0 0 0 0 0]; @@ -35,7 +34,7 @@ boundaryField liner { - $:wall.p; + $include/caseSettings!wall/p; } cylinderHead diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/alphat b/tutorials/combustion/coldEngineFoam/freePiston/0/alphat index bbd84f83f7..38007571c2 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/alphat +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/alphat @@ -14,8 +14,7 @@ FoamFile object alphat; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "include/caseSettings" +#inputSyntax slash; dimensions [1 -1 -1 0 0 0 0]; @@ -27,11 +26,26 @@ boundaryField { type wedge; } - front { $back; } - liner { $:wall.alphat; } - cylinderHead { $liner; } - piston { $liner; } -} + + front + { + $back; + } + + liner + { + $include/caseSettings!wall/alphat; + } + + cylinderHead + { + $liner; + } + + piston + { + $liner; + } } diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/epsilon b/tutorials/combustion/coldEngineFoam/freePiston/0/epsilon index 4b7b39e06a..07cf54cd41 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/epsilon +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/epsilon @@ -14,12 +14,11 @@ FoamFile object epsilon; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "include/caseSettings" +#inputSyntax slash; dimensions [0 2 -3 0 0 0 0]; -internalField uniform $:internalField.epsilon; +internalField uniform $include/caseSettings!internalField/epsilon; boundaryField { @@ -35,7 +34,7 @@ boundaryField liner { - $:wall.epsilon; + $include/caseSettings!wall/epsilon; } cylinderHead diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/include/boundaryConditions b/tutorials/combustion/coldEngineFoam/freePiston/0/include/boundaryConditions index 554c95f1ce..bfc8bb7048 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/include/boundaryConditions +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/include/boundaryConditions @@ -13,6 +13,7 @@ FoamFile object boundaryConditions; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#inputSyntax slash; wall { @@ -35,13 +36,13 @@ wall k { type kqRWallFunction; - value uniform $:internalField.k; + value uniform $!internalField/k; } epsilon { type epsilonWallFunction; - value uniform $:internalField.epsilon; + value uniform $!internalField/epsilon; } nut diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/include/caseSettings b/tutorials/combustion/coldEngineFoam/freePiston/0/include/caseSettings index 3d77f0d33a..dc11a7de3e 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/include/caseSettings +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/include/caseSettings @@ -13,6 +13,7 @@ FoamFile object caseSettings; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +#inputSyntax slash; internalField { diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/k b/tutorials/combustion/coldEngineFoam/freePiston/0/k index bff12ce1cd..7ca0227b8e 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/k +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/k @@ -14,12 +14,11 @@ FoamFile object k; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "include/caseSettings" +#inputSyntax slash; dimensions [0 2 -2 0 0 0 0]; -internalField uniform $:internalField.k; +internalField uniform $include/caseSettings!internalField/k; boundaryField { @@ -35,7 +34,7 @@ boundaryField liner { - $:wall.k; + $include/caseSettings!wall/k; } cylinderHead diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/nut b/tutorials/combustion/coldEngineFoam/freePiston/0/nut index 4699fe28e1..c96bdc6f11 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/nut +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/nut @@ -14,8 +14,7 @@ FoamFile object nut; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "include/caseSettings" +#inputSyntax slash; dimensions [0 2 -1 0 0 0 0]; @@ -27,11 +26,26 @@ boundaryField { type wedge; } - front { $back; } - liner { $:wall.nut; } - cylinderHead { $liner; } - piston { $liner; } -} + + front + { + $back; + } + + liner + { + $include/caseSettings!wall/nut; + } + + cylinderHead + { + $liner; + } + + piston + { + $liner; + } } diff --git a/tutorials/combustion/coldEngineFoam/freePiston/0/p b/tutorials/combustion/coldEngineFoam/freePiston/0/p index de5d4b69a9..7b0f0886a8 100644 --- a/tutorials/combustion/coldEngineFoam/freePiston/0/p +++ b/tutorials/combustion/coldEngineFoam/freePiston/0/p @@ -14,12 +14,11 @@ FoamFile object p; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "include/caseSettings" +#inputSyntax slash; dimensions [1 -1 -2 0 0 0 0]; -internalField uniform $:internalField.p; +internalField uniform $include/caseSettings!internalField/p; boundaryField { @@ -35,7 +34,7 @@ boundaryField liner { - $:wall.p; + $include/caseSettings!wall/p; } cylinderHead