Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Development
openfoam
Commits
f117f4b8
Commit
f117f4b8
authored
15 years ago
by
graham
Browse files
Options
Downloads
Patches
Plain Diff
ENH: magneticFoam. Adding option to control HdotGradH output.
parent
6e206f49
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
applications/solvers/electromagnetics/magneticFoam/magneticFoam.C
+48
-22
48 additions, 22 deletions
...ions/solvers/electromagnetics/magneticFoam/magneticFoam.C
with
48 additions
and
22 deletions
applications/solvers/electromagnetics/magneticFoam/magneticFoam.C
+
48
−
22
View file @
f117f4b8
...
@@ -29,7 +29,8 @@ Description
...
@@ -29,7 +29,8 @@ Description
A Poisson's equation for the magnetic scalar potential psi is solved
A Poisson's equation for the magnetic scalar potential psi is solved
from which the magnetic field intensity H and magnetic flux density B
from which the magnetic field intensity H and magnetic flux density B
are obtained.
are obtained. The paramagnetic particle force field (H dot grad(H))
is optionally available.
\*---------------------------------------------------------------------------*/
\*---------------------------------------------------------------------------*/
...
@@ -42,8 +43,23 @@ Description
...
@@ -42,8 +43,23 @@ Description
int
main
(
int
argc
,
char
*
argv
[])
int
main
(
int
argc
,
char
*
argv
[])
{
{
argList
::
addBoolOption
(
"noH"
,
"do not write the magnetic field"
);
argList
::
addBoolOption
argList
::
addBoolOption
(
"noB"
,
"do not write the magnetic field"
);
(
"noH"
,
"do not write the magnetic field intensity field"
);
argList
::
addBoolOption
(
"noB"
,
"do not write the magnetic flux density field"
);
argList
::
addBoolOption
(
"HdotGradH"
,
"write the paramagnetic particle force field"
);
#include
"setRootCase.H"
#include
"setRootCase.H"
#include
"createTime.H"
#include
"createTime.H"
...
@@ -64,10 +80,8 @@ int main(int argc, char *argv[])
...
@@ -64,10 +80,8 @@ int main(int argc, char *argv[])
psi
.
write
();
psi
.
write
();
if
(
!
args
.
optionFound
(
"noH"
))
if
(
!
args
.
optionFound
(
"noH"
)
||
args
.
optionFound
(
"HdotGradH"
)
)
{
{
Info
<<
nl
<<
"Creating field H for time "
<<
runTime
.
timeName
()
<<
endl
;
volVectorField
H
volVectorField
H
(
(
IOobject
IOobject
...
@@ -79,30 +93,42 @@ int main(int argc, char *argv[])
...
@@ -79,30 +93,42 @@ int main(int argc, char *argv[])
fvc
::
reconstruct
(
fvc
::
snGrad
(
psi
)
*
mesh
.
magSf
())
fvc
::
reconstruct
(
fvc
::
snGrad
(
psi
)
*
mesh
.
magSf
())
);
);
H
.
write
();
if
(
!
args
.
optionFound
(
"noH"
))
{
Info
<<
nl
<<
"Creating field H for time "
<<
runTime
.
timeName
()
<<
endl
;
Info
<<
nl
H
.
write
();
<<
"Creating field HdotGradH for time "
}
<<
runTime
.
timeName
()
<<
endl
;
volVectorField
HdotGradH
if
(
args
.
optionFound
(
"HdotGradH"
))
(
{
IOobject
Info
<<
nl
(
<<
"Creating field HdotGradH for time "
"HdotGradH"
,
<<
runTime
.
timeName
()
<<
endl
;
runTime
.
timeName
(),
mesh
),
H
&
fvc
::
grad
(
H
)
);
HdotGradH
.
write
();
volVectorField
HdotGradH
(
IOobject
(
"HdotGradH"
,
runTime
.
timeName
(),
mesh
),
H
&
fvc
::
grad
(
H
)
);
HdotGradH
.
write
();
}
}
}
if
(
!
args
.
optionFound
(
"noB"
))
if
(
!
args
.
optionFound
(
"noB"
))
{
{
Info
<<
nl
Info
<<
nl
<<
"Creating field B for time "
<<
runTime
.
timeName
()
<<
endl
;
<<
"Creating field B for time "
<<
runTime
.
timeName
()
<<
endl
;
volVectorField
B
volVectorField
B
(
(
IOobject
IOobject
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment