How krebeljk/openinjmoldsim works
Project type and purpose
• openInjMoldSim is an extension to the OpenFOAM CFD toolkit: a C++-based scientific solver for simulating injection-molding processes (filling, packing, cooling).
• It is not a web or GUI application but a command-line plugin that compiles against OpenFOAM and runs on “case” directories containing input decks.
File structure
• Top level:
• applications/solvers/multiphase/openInjMoldSim – contains multiple solver variants and custom library modules (thermo, transport, forces, fiber orientation) plus build scripts (Make, Allwmake).
• tutorials/demo and tutorials/test – example “case” directories (dogbone, fill_pack, crossWLF, etc.) with OpenFOAM-style system/constant/org0 folders and Python post-processing scripts.
• Configuration files: .gitignore, LICENSE.md, VERSION.md, README.md.
• Patterns:
• Each solver variant (openInjMoldSim.C, compressibleInterDyMFoam.C, openInjMoldSimF.C) links to a set of H/C modules under subfolders (mojThermo, crossWlfInSorodno, mojLibForces, polymerPVT, mojTurbulentFluidThermoModel, etc.).
• Build flow: invoke Allwmake in solver directory → generates library objects → links executables.
README for additional insights
• Indicates underlying dependency on OpenFOAM 7, compilation via Allwmake, runtime flow (mesh → run → paraFoam).
• Highlights core physics modules: Tait equation of state, Cross-WLF viscosity, non-isothermal laminar flow, elastic stresses, fiber orientation.
a. Main components
1. OpenFOAM Core Framework
– Mesh handling, linear solvers, IO, time loop
2. openInjMoldSim Plugin Modules
– Solver executables: openInjMoldSim, openInjMoldSimF, compressibleInterDyMFoam
– Physics libraries:
• Thermodynamics (mojThermo, polymerPVT, twoPhaseMixtureThermo)
• Transport (crossWlfInSorodno, mojConstTransport)
• Forces (mojLibForces)
• Fiber orientation (openInjMoldSimF: Advani-Folgar-Tucker)
– Equation definitions (UEqn.H, TEqn.H, alphaEqns.H, pEqn.H, etc.)
3. Build System
– Makefiles, Allwmake scripts orchestrating compilation and linking
4. Case Workflow & Post-Processing
– Input “case” directories (system/, constant/, org0/) holding mesh, material tables, simulation settings (controlDict, fvSchemes, fvSolution)
– Python scripts for plotting results and notebook tutorials
– paraFoam visualization
b. Relationships & interactions
• Build System → compiles Plugin Modules → links against OpenFOAM Core → produces Solver Executables
• At runtime: Solver Executables → read Case Input (system/, constant/, org0/) → instantiate physics modules → perform time-loop computations (mass, momentum, energy, phase fraction equations) → write field data (U, p, T, alpha.poly, stresses)
• Post-Processing Scripts & paraFoam ← read output fields
c. Architectural patterns & design principles
• Modular C++ plugin structure: each physical model implemented in its own namespace/folder, separated by headers (H) and implementations (C, I.H)
• Plugin-style build via OpenFOAM’s wmake/Allwmake conventions
• Case directory separation of concerns: mesh, control parameters, boundary/initial conditions
d. Key technologies/frameworks
• OpenFOAM 7 (C++ CFD framework)
• GNU Make / Allwmake build scripts
• Python (post-processing, data plotting)
• ParaView (paraFoam) for visualization