Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
e2ee122a
Commit
e2ee122a
authored
May 23, 2008
by
Mattijs Janssens
Browse files
Merge branch 'master' of /home/noisy2/OpenFOAM/OpenFOAM-dev/
parents
ffa93995
4e787f11
Changes
139
Hide whitespace changes
Inline
Side-by-side
applications/solvers/molecularDynamics/gnemdFoam/Make/files
0 → 100755
View file @
e2ee122a
gnemdFoam.C
EXE = $(FOAM_APPBIN)/gnemdFoam
applications/solvers/molecularDynamics/gnemdFoam/Make/options
0 → 100755
View file @
e2ee122a
EXE_INC = \
-I$(LIB_SRC)/lagrangian/molecule/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lmeshTools \
-lfiniteVolume \
-llagrangian \
-lmolecule
applications/solvers/molecularDynamics/gnemdFoam/gnemdFoam.C
0 → 100755
View file @
e2ee122a
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Application
gnemdFOAM
Description
MD for Fluid Mechanics and hybridising with a continuum solver.
\*---------------------------------------------------------------------------*/
#include
"fvCFD.H"
#include
"md.H"
int
main
(
int
argc
,
char
*
argv
[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
moleculeCloud
molecules
(
mesh
);
# include "createMDFields.H"
molecules
.
removeHighEnergyOverlaps
();
# include "temperatureAndPressureVariables.H"
label
nAveragingSteps
=
0
;
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
runTime
++
;
nAveragingSteps
++
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
endl
;
molecules
.
integrateEquationsOfMotion
();
# include "meanMomentumEnergyAndNMols.H"
# include "temperatureAndPressure.H"
# include "calculateMDFields.H"
# include "averageMDFields.H"
runTime
.
write
();
# include "resetMDFields.H"
if
(
runTime
.
outputTime
())
{
nAveragingSteps
=
0
;
}
Info
<<
"ExecutionTime = "
<<
runTime
.
elapsedCpuTime
()
<<
" s"
<<
" ClockTime = "
<<
runTime
.
elapsedClockTime
()
<<
" s"
<<
nl
<<
endl
;
}
Info
<<
"End
\n
"
<<
endl
;
return
(
0
);
}
applications/solvers/molecularDynamics/mdEquilibrationFoam/Make/files
0 → 100755
View file @
e2ee122a
mdEquilibrationFoam.C
EXE = $(FOAM_APPBIN)/mdEquilibrationFoam
applications/solvers/molecularDynamics/mdEquilibrationFoam/Make/options
0 → 100755
View file @
e2ee122a
EXE_INC = \
-I$(LIB_SRC)/lagrangian/molecule/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lmeshTools \
-lfiniteVolume \
-llagrangian \
-lmolecule
applications/solvers/molecularDynamics/mdEquilibrationFoam/mdEquilibrationFoam.C
0 → 100755
View file @
e2ee122a
/*---------------------------------------------------------------------------*\
========= |
\\ / 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
Application
mdEquilibrationFOAM
Description
Equilibrates and/or preconditions MD systems
\*---------------------------------------------------------------------------*/
#include
"fvCFD.H"
#include
"md.H"
int
main
(
int
argc
,
char
*
argv
[])
{
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
moleculeCloud
molecules
(
mesh
);
molecules
.
removeHighEnergyOverlaps
();
# include "temperatureAndPressureVariables.H"
# include "readmdEquilibrationDict.H"
label
nAveragingSteps
=
0
;
Info
<<
"
\n
Starting time loop
\n
"
<<
endl
;
while
(
runTime
.
run
())
{
runTime
++
;
nAveragingSteps
++
;
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
endl
;
molecules
.
integrateEquationsOfMotion
();
# include "meanMomentumEnergyAndNMols.H"
# include "temperatureAndPressure.H"
# include "temperatureEquilibration.H"
runTime
.
write
();
if
(
runTime
.
outputTime
())
{
nAveragingSteps
=
0
;
}
Info
<<
"ExecutionTime = "
<<
runTime
.
elapsedCpuTime
()
<<
" s"
<<
" ClockTime = "
<<
runTime
.
elapsedClockTime
()
<<
" s"
<<
nl
<<
endl
;
}
Info
<<
"End
\n
"
<<
endl
;
return
(
0
);
}
applications/solvers/molecularDynamics/mdEquilibrationFoam/readmdEquilibrationDict.H
0 → 100755
View file @
e2ee122a
Info
<<
"Reading MD Equilibration Dictionary"
<<
nl
<<
endl
;
IOdictionary
mdEquilibrationDict
(
IOobject
(
"mdEquilibrationDict"
,
runTime
.
system
(),
mesh
,
IOobject
::
MUST_READ
,
IOobject
::
NO_WRITE
)
);
scalar
targetTemperature
=
readScalar
(
mdEquilibrationDict
.
lookup
(
"equilibrationTargetTemperature"
)
);
applications/utilities/postProcessing/field/components/components.C
View file @
e2ee122a
...
...
@@ -35,44 +35,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
<
class
Type
>
void
writeComponents
(
const
IOobject
&
header
,
const
fvMesh
&
mesh
,
bool
&
processed
)
{
typedef
GeometricField
<
Type
,
fvPatchField
,
volMesh
>
fieldType
;
if
(
header
.
headerClassName
()
==
fieldType
::
typeName
)
{
Info
<<
" Reading "
<<
header
.
name
()
<<
endl
;
fieldType
field
(
header
,
mesh
);
for
(
direction
i
=
0
;
i
<
Type
::
nComponents
;
i
++
)
{
Info
<<
" Calculating "
<<
header
.
name
()
<<
Type
::
componentNames
[
i
]
<<
endl
;
volScalarField
componentField
(
IOobject
(
header
.
name
()
+
word
(
Type
::
componentNames
[
i
]),
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
),
field
.
component
(
i
)
);
componentField
.
write
();
}
processed
=
true
;
}
}
#include
"writeComponentFields.C"
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
@@ -115,10 +78,15 @@ int main(int argc, char *argv[])
mesh
.
readUpdate
();
bool
processed
=
false
;
writeComponents
<
vector
>
(
fieldHeader
,
mesh
,
processed
);
writeComponents
<
sphericalTensor
>
(
fieldHeader
,
mesh
,
processed
);
writeComponents
<
symmTensor
>
(
fieldHeader
,
mesh
,
processed
);
writeComponents
<
tensor
>
(
fieldHeader
,
mesh
,
processed
);
writeComponentFields
<
vector
>
(
fieldHeader
,
mesh
,
processed
);
writeComponentFields
<
sphericalTensor
>
(
fieldHeader
,
mesh
,
processed
);
writeComponentFields
<
symmTensor
>
(
fieldHeader
,
mesh
,
processed
);
writeComponentFields
<
tensor
>
(
fieldHeader
,
mesh
,
processed
);
if
(
!
processed
)
{
FatalError
...
...
applications/utilities/postProcessing/field/components/writeComponentFields.C
0 → 100644
View file @
e2ee122a
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Application
components
Description
Writes scalar fields corresponding to each component of the supplied
field (name) for each time.
\*---------------------------------------------------------------------------*/
#include
"fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
<
class
Type
>
void
writeComponentFields
(
const
IOobject
&
header
,
const
fvMesh
&
mesh
,
bool
&
processed
)
{
typedef
GeometricField
<
Type
,
fvPatchField
,
volMesh
>
fieldType
;
if
(
header
.
headerClassName
()
==
fieldType
::
typeName
)
{
Info
<<
" Reading "
<<
header
.
name
()
<<
endl
;
fieldType
field
(
header
,
mesh
);
for
(
direction
i
=
0
;
i
<
Type
::
nComponents
;
i
++
)
{
Info
<<
" Calculating "
<<
header
.
name
()
<<
Type
::
componentNames
[
i
]
<<
endl
;
volScalarField
componentField
(
IOobject
(
header
.
name
()
+
word
(
Type
::
componentNames
[
i
]),
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
),
field
.
component
(
i
)
);
componentField
.
write
();
}
processed
=
true
;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
applications/utilities/postProcessing/field/mag/mag.C
View file @
e2ee122a
...
...
@@ -34,39 +34,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
<
class
Type
>
void
writeMagField
(
const
IOobject
&
header
,
const
fvMesh
&
mesh
,
bool
&
processed
)
{
typedef
GeometricField
<
Type
,
fvPatchField
,
volMesh
>
fieldType
;
if
(
header
.
headerClassName
()
==
fieldType
::
typeName
)
{
Info
<<
" Reading "
<<
header
.
name
()
<<
endl
;
fieldType
field
(
header
,
mesh
);
Info
<<
" Calculating mag"
<<
header
.
name
()
<<
endl
;
volScalarField
magField
(
IOobject
(
"mag"
+
header
.
name
(),
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
),
mag
(
field
)
);
magField
.
write
();
processed
=
true
;
}
}
#include
"writeMagField.C"
int
main
(
int
argc
,
char
*
argv
[])
{
...
...
applications/utilities/postProcessing/field/mag/writeMagField.C
0 → 100644
View file @
e2ee122a
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2007 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
Application
mag
Description
Calculates and writes the magnitude of a field for each time
\*---------------------------------------------------------------------------*/
#include
"fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template
<
class
Type
>
void
writeMagField
(
const
IOobject
&
header
,
const
fvMesh
&
mesh
,
bool
&
processed
)
{
typedef
GeometricField
<
Type
,
fvPatchField
,
volMesh
>
fieldType
;
if
(
header
.
headerClassName
()
==
fieldType
::
typeName
)
{
Info
<<
" Reading "
<<
header
.
name
()
<<
endl
;
fieldType
field
(
header
,
mesh
);
Info
<<
" Calculating mag"
<<
header
.
name
()
<<
endl
;
volScalarField
magField
(
IOobject
(
"mag"
+
header
.
name
(),
mesh
.
time
().
timeName
(),
mesh
,
IOobject
::
NO_READ
),
mag
(
field
)
);
magField
.
write
();
processed
=
true
;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
applications/utilities/postProcessing/field/magGrad/magGrad.C
View file @
e2ee122a
...
...
@@ -26,23 +26,26 @@ Application
magGrad
Description
Calculates and writes the
scalar
magnitude of
a scalar or vector field
at each
time
Calculates and writes the magnitude of
the gradient of a field for each
time
\*---------------------------------------------------------------------------*/
#include
"fvCFD.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Main program:
#include
"writeMagGradField.C"
int
main
(
int
argc
,
char
*
argv
[])
{
argList
::
validArgs
.
append
(
"field"
);
argList
::
validArgs
.
append
(
"field
Name
"
);
# include "addTimeOptions.H"
# include "setRootCase.H"
word
fieldName
(
args
.
additionalArgs
()[
0
]);
# include "createTime.H"
// Get times list
...
...
@@ -51,8 +54,6 @@ int main(int argc, char *argv[])
// set startTime and endTime depending on -time and -latestTime options
# include "checkTimeOptions.H"
const
word
fieldName
(
args
.
additionalArgs
()[
0
]);
runTime
.
setTime
(
Times
[
startTime
],
startTime
);
# include "createMesh.H"
...
...
@@ -63,7 +64,7 @@ int main(int argc, char *argv[])
Info
<<
"Time = "
<<
runTime
.
timeName
()
<<
endl
;
IOobject
h
eader
IOobject
fieldH
eader
(
fieldName
,
runTime
.
timeName
(),
...
...
@@ -71,56 +72,33 @@ int main(int argc, char *argv[])
IOobject
::
MUST_READ
);
// Check
U
exists
if
(
h
eader
.
headerOk
())
// Check
field "fieldName"
exists
if
(
fieldH
eader
.
headerOk
())
{
mesh
.
readUpdate
();
if
(
header
.
headerClassName
()
==
volVectorField
::
typeName
)
bool
processed
=
false
;
writeMagGradField
<
scalar
>
(
fieldHeader
,
mesh
,
processed
);
writeMagGradField
<
vector
>
(
fieldHeader
,
mesh
,
processed
);
if
(
!
processed
)
{
Info
<<
" Reading "
<<
fieldName
<<
endl
;
volVectorField
U
(
header
,
mesh
);
volScalarField
magGrad
(
IOobject
(
"magGrad"
+
fieldName
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
),
mag
(
fvc
::
grad
(
U
))
);
Info
<<
" Calculating "
<<
magGrad
.
name
()
<<
endl
;
magGrad
.
write
();
}
else
if
(
header
.
headerClassName
()
==
volScalarField
::
typeName
)
{
Info
<<
" Reading "
<<
fieldName
<<
endl
;
volScalarField
U
(
header
,
mesh
);
volScalarField
magGrad
(
IOobject
(
"magGrad"
+
fieldName
,
runTime
.
timeName
(),
mesh
,
IOobject
::
NO_READ
),
mag
(
fvc
::
grad
(
U
))
);
Info
<<
" Calculating "
<<
magGrad
.
name
()
<<
endl
;
magGrad
.
write
();
FatalError
<<
"Unable to process "
<<
fieldName
<<
nl
<<
"No call to magGrad for fields of type "
<<
fieldHeader
.
headerClassName
()
<<
nl
<<
nl
<<
exit
(
FatalError
);
}
}
else
{
Info
<<
" No "
<<
fieldName