File tree Expand file tree Collapse file tree 2 files changed +70
-1
lines changed
applications/solvers/dfLowMachFoam Expand file tree Collapse file tree 2 files changed +70
-1
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,8 @@ rho = thermo.rho();
115115Info << "Creating field kinetic energy K\n" << endl ;
116116volScalarField K ("K" , 0.5 * magSqr (U ));
117117
118+ #include "createLocalBlend.H"
119+
118120multivariateSurfaceInterpolationScheme < scalar > ::fieldTable fields ;
119121
120122#include "createMRF.H"
@@ -206,4 +208,4 @@ const Switch splitting = CanteraTorchProperties.lookupOrDefault("splittingStrate
206208#ifdef USE_LIBTORCH
207209 const Switch log_ = CanteraTorchProperties .subDict ("TorchSettings" ).lookupOrDefault ("log" , false);
208210 const Switch torch_ = CanteraTorchProperties .subDict ("TorchSettings" ).lookupOrDefault ("torch" , false);
209- #endif
211+ #endif
Original file line number Diff line number Diff line change 1+ /*---------------------------------------------------------------------------*\
2+ This function is designed to read the UBlendingFactor for localBlended
3+ schemes used by the divSchemes, i.e.:
4+ ```
5+ divSchemes
6+ {
7+ div(phi,U) Gauss localBlended linear upwind;
8+ }
9+ ```
10+ \*---------------------------------------------------------------------------*/
11+
12+ // Find and parse the divSchemes sub-dictionary
13+ const dictionary & divSchemesDict = mesh .schemesDict ().subDict ("divSchemes" );
14+
15+ Switch foundLocalBlended = false;
16+
17+ // Parse the divSchemes tokens
18+ wordList keys = divSchemesDict .toc ();
19+ forAll (keys , i )
20+ {
21+ const word & key = keys [i ];
22+ // Convert to string
23+ ITstream & is = divSchemesDict .lookup (key );
24+ OStringStream os ;
25+ os << is ;
26+ word schemeStr = os .str ();
27+
28+ if (schemeStr .find ("localBlended" ) != word ::npos )
29+ {
30+ foundLocalBlended = true;
31+ }
32+ }
33+
34+ // Create the localBlendingFactor field only if localBlended scheme is found
35+ if (foundLocalBlended )
36+ {
37+ Info << " Creating UBlendingFactor field for localBlended schemes " << endl ;
38+
39+ // Read the scalarField UBlend
40+ volScalarField UBlend
41+ (
42+ IOobject
43+ (
44+ "UBlend ",
45+ mesh .time ().timeName (),
46+ mesh ,
47+ IOobject ::MUST_READ ,
48+ IOobject ::NO_WRITE
49+ ),
50+ mesh
51+ )
52+
53+ // Construct the surfaceScalarField UBlendingFactor by interpolating UBlend to cell faces
54+ surfaceScalarField UBlendingFactor
55+ (
56+ IOobject
57+ (
58+ "UBlendingFactor ",
59+ mesh .time ().timeName (),
60+ mesh ,
61+ IOobject ::NO_READ ,
62+ IOobject ::NO_WRITE
63+ ),
64+ mesh ,
65+ fvc ::interpolate (UBlend )
66+ );
67+ }
You can’t perform that action at this time.
0 commit comments