### Example solidMixtureProperties Configuration Source: https://cpp.openfoam.org/v11/solidMixtureProperties_8H_source.html This example shows how to define a two-component solid mixture, including properties for 'C' and 'ash'. Use this configuration within your OpenFOAM case setup for solid mixture properties. ```C++ { C; ash { //... user defined properties for ash } } ``` -------------------------------- ### Main Function Setup Source: https://cpp.openfoam.org/v11/createPatch_8C_source.html Sets up the main execution environment for the createPatch utility. Includes options for region, overwrite, and dictionary settings, and initializes the mesh. ```cpp int main(int argc, char *argv[]) { #include "addOverwriteOption.H" #include "addRegionOption.H" #include "addDictOption.H" #include "setRootCase.H" #include "createTimeNoFunctionObjects.H" Foam::word meshRegionName = polyMesh::defaultRegion; args.optionReadIfPresent("region", meshRegionName); const bool overwrite = args.optionFound("overwrite"); #include "createNamedPolyMesh.H" const word oldInstance = mesh.pointsInstance(); const dictionary dict(systemDict("createPatchDict", args, mesh)); // Whether to synchronise points const Switch pointSync(dict.lookupOrDefault("pointSync", false)); // Whether to write cyclic matches to .OBJ files const Switch writeCyclicMatch ( dict.lookupOrDefault("writeCyclicMatch", false) ); const polyBoundaryMesh& patches = mesh.boundaryMesh(); // If running parallel check same patches everywhere patches.checkParallelSync(true); if (writeCyclicMatch) { writeCyclicMatchObjs("initial_", mesh); } // Read patch construct info from dictionary PtrList patchSources(dict.lookup("patches")); HashSet addedPatchNames; forAll(patchSources, addedI) { const dictionary& dict = patchSources[addedI]; addedPatchNames.insert(dict.lookup("name")); } // 1. Add all new patches // ~~~~~~~~~~~~~~~~~~~~~~~ if (patchSources.size()) { // Old and new patches. DynamicList allPatches(patches.size()+patchSources.size()); label startFacei = mesh.nInternalFaces(); // Copy old patches. forAll(patches, patchi) { const polyPatch& pp = patches[patchi]; if (!isA(pp)) { allPatches.append ( pp.clone ( patches, patchi, pp.size(), startFacei ).ptr() ``` -------------------------------- ### Get patch start indices Source: https://cpp.openfoam.org/v11/classFoam_1_1sampledSurfaces_1_1patch.html Returns the starting label for each patch. ```cpp const labelList& patchStart() const ``` -------------------------------- ### OpenFOAM Main Function Setup Source: https://cpp.openfoam.org/v11/PDRMesh_8C_source.html This snippet shows the standard setup for the main function in an OpenFOAM application, including including necessary headers for options, root case, and mesh creation. It initializes IOdictionary for reading configuration. ```cpp int main(int argc, char *argv[]) { #include "addOverwriteOption.H" #include "setRootCase.H" #include "createTimeNoFunctionObjects.H" #include "createMeshNoChangers.H" // Read control dictionary // ~~~~~~~~~~~~~~~~~~~~~~~~ IOdictionary dict ( IOobject ( "PDRMeshDict", runTime.system(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE ) ); // Per faceSet the patch to put the baffles into const List> setsAndPatches(dict.lookup("blockedFaces")); ``` -------------------------------- ### Get blockEdge Start Point Label Source: https://cpp.openfoam.org/v11/classFoam_1_1blockEdges_1_1arcEdge.html Returns the label of the start point of the blockEdge. ```cpp label start () const ``` -------------------------------- ### Reading Initial Conditions Example Source: https://cpp.openfoam.org/v11/globals_i.html Example of reading initial conditions from a dictionary. This is a common step in setting up a simulation. ```C++ Info<< "Reading initial conditions.\n"<< endl; IOdictionary initialConditions(IOobject("initialConditions", runTime.constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, IOobject::NO_WRITE)); scalar p0=initialConditions.lookup< scalar >() : createFields.H ``` -------------------------------- ### Get Old Patch Start Labels Source: https://cpp.openfoam.org/v11/polyTopoChangeMap_8H_source.html Returns a list of the starting labels for the old patches. ```cpp const labelList& oldPatchStarts() const { return oldPatchStarts_; } ``` -------------------------------- ### Get Start Time in OpenFOAM Source: https://cpp.openfoam.org/v11/Time_8C_source.html Returns the simulation's start time as a dimensioned scalar, similar to beginTime but specifically for the defined start time. ```cpp Foam::dimensionedScalar Foam::Time::startTime() const { return dimensionedScalar ( timeName(timeToUserTime(startTime_)), dimTime, startTime_ ); } ``` -------------------------------- ### OpenFOAM Reaction-Driven Simulation Setup Source: https://cpp.openfoam.org/v11/phaseSystems_2populationBalanceModel_2nucleationModels_2reactionDriven_2reactionDriven_8C_source.html Setup for reaction-driven simulations in OpenFOAM. This involves defining reaction kinetics and related parameters. ```C++ reactionDriven { // Reaction-driven simulation settings } ``` -------------------------------- ### Get fvPatch start label Source: https://cpp.openfoam.org/v11/fvMeshStitcherTemplates_8C_source.html Returns the starting label of this patch within the polyMesh face list. ```cpp virtual label start() const ``` -------------------------------- ### IOobject Constructors Source: https://cpp.openfoam.org/v11/classFoam_1_1dragModels_1_1Gibilaro.html Demonstrates the various ways to construct an IOobject, including initialization with name, instance, registry, and I/O options, as well as copy construction. ```APIDOC ## IOobject Constructors ### Description Constructs an IOobject with specified parameters or from a copy of another IOobject. ### Methods - IOobject (const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true) - IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true) - IOobject (const fileName &path, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true) - IOobject (const IOobject &io, const objectRegistry ®istry) - IOobject (const IOobject &io, const word &name) - IOobject (const IOobject &io)=default ``` -------------------------------- ### IOobject Constructors Source: https://cpp.openfoam.org/v11/classFoam_1_1data.html Demonstrates the various ways to construct an IOobject, including initialization with name, instance, registry, and I/O options. ```APIDOC ## IOobject Constructors ### Description Constructs an IOobject with different sets of parameters. ### Methods - IOobject (const word &name, const fileName &instance, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true) - IOobject (const word &name, const fileName &instance, const fileName &local, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true) - IOobject (const fileName &path, const objectRegistry ®istry, readOption r=NO_READ, writeOption w=NO_WRITE, bool registerObject=true) - IOobject (const IOobject &io, const objectRegistry ®istry) - IOobject (const IOobject &io, const word &name) - IOobject (const IOobject &io)=default ``` -------------------------------- ### Get start point of trackedParticle Source: https://cpp.openfoam.org/v11/classFoam_1_1trackedParticle.html Returns a reference to the starting point of the tracked particle. This is an inline method. ```cpp point& start() ``` -------------------------------- ### searchableDisk Configuration Example Source: https://cpp.openfoam.org/v11/searchableDisk_8H_source.html Example specification for a searchableDisk in snappyHexMeshDict. Requires origin, normal, and radius properties. ```C++ type searchableDisk; origin (10 10 10); normal (0 1 0); radius 5; ``` -------------------------------- ### Get List Starts Source: https://cpp.openfoam.org/v11/Distribution_8H_source.html Returns the starting bin indices for each component. This is an inline function defined in DistributionI.H. ```cpp inline const List