diff --git a/applications/utilities/preProcessing/molConfig/Make/files b/applications/utilities/preProcessing/molConfig/Make/files new file mode 100755 index 0000000000..6501e68426 --- /dev/null +++ b/applications/utilities/preProcessing/molConfig/Make/files @@ -0,0 +1,8 @@ +latticeStructures = latticeStructures +velocityDistributions = velocityDistributions + +createMolecules.C +molConfig.C +genMolConfig.C + +EXE = $(FOAM_APPBIN)/molConfig diff --git a/applications/utilities/preProcessing/molConfig/correctVelocities.H b/applications/utilities/preProcessing/molConfig/correctVelocities.H new file mode 100644 index 0000000000..0c69f15c7c --- /dev/null +++ b/applications/utilities/preProcessing/molConfig/correctVelocities.H @@ -0,0 +1,21 @@ +for (molN = totalMols; molN < totalMols + totalZoneMols; molN++) +{ + + // Remove bulk momentum introduced by random numbers and add + // desired bulk velocity + + // For systems with molecules of significantly differing masses, this may + // need to be an iterative process or employ a better algorithm for + // removing an appropriate share of the excess momentum from each molecule. + + initialVelocities(molN) += bulkVelocity - momentumSum/totalZoneMols/mass; +} + +// momentumSum = vector::zero; +// +// for (molN = totalMols; molN < totalMols + totalZoneMols; molN++) +// { +// momentumSum += mass*initialVelocities(molN); +// } +// +// Info << "Check momentum adjustment: " << momentumSum << endl; diff --git a/applications/utilities/preProcessing/molConfig/createMolecules.C b/applications/utilities/preProcessing/molConfig/createMolecules.C new file mode 100644 index 0000000000..20318f06d6 --- /dev/null +++ b/applications/utilities/preProcessing/molConfig/createMolecules.C @@ -0,0 +1,253 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*----------------------------------------------------------------------------*/ + +#include "molConfig.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +void Foam::molConfig::createMolecules() +{ + Info<< nl << "Creating molecules from zone specifications\n" << endl; + + DynamicList initialPositions(0); + + DynamicList