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
0a5d1589
Commit
0a5d1589
authored
8 years ago
by
Andrew Heather
Browse files
Options
Downloads
Patches
Plain Diff
ENH: scalarTransport function object updates
parent
e0244a74
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/functionObjects/solvers/scalarTransport/scalarTransport.C
+5
-94
5 additions, 94 deletions
...functionObjects/solvers/scalarTransport/scalarTransport.C
src/functionObjects/solvers/scalarTransport/scalarTransport.H
+0
-4
0 additions, 4 deletions
...functionObjects/solvers/scalarTransport/scalarTransport.H
with
5 additions
and
98 deletions
src/functionObjects/solvers/scalarTransport/scalarTransport.C
+
5
−
94
View file @
0a5d1589
...
@@ -188,7 +188,6 @@ Foam::functionObjects::scalarTransport::scalarTransport
...
@@ -188,7 +188,6 @@ Foam::functionObjects::scalarTransport::scalarTransport
fvMeshFunctionObject
(
name
,
runTime
,
dict
),
fvMeshFunctionObject
(
name
,
runTime
,
dict
),
fieldName_
(
dict
.
lookupOrDefault
<
word
>
(
"field"
,
"s"
)),
fieldName_
(
dict
.
lookupOrDefault
<
word
>
(
"field"
,
"s"
)),
phiName_
(
dict
.
lookupOrDefault
<
word
>
(
"phi"
,
"phi"
)),
phiName_
(
dict
.
lookupOrDefault
<
word
>
(
"phi"
,
"phi"
)),
UPhiName_
(
dict
.
lookupOrDefault
<
word
>
(
"UPhi"
,
"none"
)),
rhoName_
(
dict
.
lookupOrDefault
<
word
>
(
"rho"
,
"rho"
)),
rhoName_
(
dict
.
lookupOrDefault
<
word
>
(
"rho"
,
"rho"
)),
nutName_
(
dict
.
lookupOrDefault
<
word
>
(
"nut"
,
"none"
)),
nutName_
(
dict
.
lookupOrDefault
<
word
>
(
"nut"
,
"none"
)),
phaseName_
(
dict
.
lookupOrDefault
<
word
>
(
"phase"
,
"none"
)),
phaseName_
(
dict
.
lookupOrDefault
<
word
>
(
"phase"
,
"none"
)),
...
@@ -231,7 +230,6 @@ bool Foam::functionObjects::scalarTransport::read(const dictionary& dict)
...
@@ -231,7 +230,6 @@ bool Foam::functionObjects::scalarTransport::read(const dictionary& dict)
dict
.
readIfPresent
(
"phi"
,
phiName_
);
dict
.
readIfPresent
(
"phi"
,
phiName_
);
dict
.
readIfPresent
(
"rho"
,
rhoName_
);
dict
.
readIfPresent
(
"rho"
,
rhoName_
);
dict
.
readIfPresent
(
"UPhi"
,
UPhiName_
);
dict
.
readIfPresent
(
"nut"
,
nutName_
);
dict
.
readIfPresent
(
"nut"
,
nutName_
);
dict
.
readIfPresent
(
"phase"
,
phaseName_
);
dict
.
readIfPresent
(
"phase"
,
phaseName_
);
dict
.
readIfPresent
(
"bounded01"
,
bounded01_
);
dict
.
readIfPresent
(
"bounded01"
,
bounded01_
);
...
@@ -260,65 +258,11 @@ bool Foam::functionObjects::scalarTransport::execute()
...
@@ -260,65 +258,11 @@ bool Foam::functionObjects::scalarTransport::execute()
{
{
Log
<<
type
()
<<
" write:"
<<
endl
;
Log
<<
type
()
<<
" write:"
<<
endl
;
tmp
<
surfaceScalarField
>
tPhi
(
new
surfaceScalarField
(
IOobject
(
"phi"
,
mesh_
.
time
().
timeName
(),
mesh_
.
time
(),
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
,
false
),
mesh_
,
dimensionedScalar
(
"tPhi"
,
dimMass
/
dimTime
,
0
.
0
)
)
);
surfaceScalarField
&
phi
=
tPhi
.
ref
();
const
dimensionSet
dim
(
mesh_
.
lookupObject
<
surfaceScalarField
>
(
phiName_
).
dimensions
()
);
bool
compressible
=
true
;
if
(
dim
==
dimVolume
/
dimTime
)
{
compressible
=
false
;
phi
.
dimensions
().
reset
(
dimVolume
/
dimTime
);
}
// Obtain phi from phiName or constructed from UPhiName
if
(
phiName_
!=
"none"
)
{
phi
=
const_cast
<
surfaceScalarField
&>
(
mesh_
.
lookupObject
<
surfaceScalarField
>
(
phiName_
)
);
}
else
if
(
UPhiName_
!=
"none"
)
{
const
volVectorField
&
Uphi
=
mesh_
.
lookupObject
<
volVectorField
>
(
UPhiName_
);
if
(
!
compressible
)
{
phi
=
fvc
::
interpolate
(
Uphi
)
&
mesh_
.
Sf
();
}
else
{
const
volScalarField
&
rho
=
mesh_
.
lookupObject
<
volScalarField
>
(
rhoName_
);
phi
=
fvc
::
interpolate
(
rho
*
Uphi
)
&
mesh_
.
Sf
();
}
}
volScalarField
&
s
=
transportedField
();
volScalarField
&
s
=
transportedField
();
const
surfaceScalarField
&
phi
=
mesh_
.
lookupObject
<
surfaceScalarField
>
(
phiName_
);
// Calculate the diffusivity
// Calculate the diffusivity
volScalarField
D
(
this
->
D
(
s
,
phi
));
volScalarField
D
(
this
->
D
(
s
,
phi
));
...
@@ -342,40 +286,7 @@ bool Foam::functionObjects::scalarTransport::execute()
...
@@ -342,40 +286,7 @@ bool Foam::functionObjects::scalarTransport::execute()
mesh_
.
lookupObject
<
surfaceScalarField
>
(
phasePhiCompressedName_
);
mesh_
.
lookupObject
<
surfaceScalarField
>
(
phasePhiCompressedName_
);
D
*=
pos
(
alpha
-
0
.
99
);
D
*=
pos
(
alpha
-
0
.
99
);
/*
surfaceScalarField phic(2.0*mag(phi/mesh_.magSf()));
const volVectorField gradAlpha(fvc::grad(alpha, "nHat"));
surfaceVectorField gradAlphaf(fvc::interpolate(gradAlpha));
dimensionedScalar deltaN
(
"deltaN", 1e-8/pow(average(mesh_.V()), 1.0/3.0)
);
surfaceVectorField nHatfv(gradAlphaf/(mag(gradAlphaf) + deltaN));
surfaceScalarField nHat(nHatfv & mesh_.Sf());
surfaceScalarField phir(phic*nHat);
surfaceScalarField limitedPhiAlpa
(
fvc::flux
(
phi,
alpha,
"div(phi,s)"
)
+ fvc::flux
(
-fvc::flux(-phir, (1-alpha), "div(phirb,s)"),
alpha,
"div(phirb,s)"
)
);
*/
// Reset D dimensions consistent with limitedPhiAlpa
// Reset D dimensions consistent with limitedPhiAlpa
D
.
dimensions
().
reset
(
limitedPhiAlpa
.
dimensions
()
/
dimLength
);
D
.
dimensions
().
reset
(
limitedPhiAlpa
.
dimensions
()
/
dimLength
);
...
@@ -404,7 +315,7 @@ bool Foam::functionObjects::scalarTransport::execute()
...
@@ -404,7 +315,7 @@ bool Foam::functionObjects::scalarTransport::execute()
MULES
::
explicitSolve
(
s
,
phi
,
tTPhiUD
.
ref
(),
1
,
0
);
MULES
::
explicitSolve
(
s
,
phi
,
tTPhiUD
.
ref
(),
1
,
0
);
}
}
}
}
else
if
(
compressibl
e
)
else
if
(
phi
.
dimensions
()
==
dimMass
/
dimTim
e
)
{
{
const
volScalarField
&
rho
=
lookupObject
<
volScalarField
>
(
rhoName_
);
const
volScalarField
&
rho
=
lookupObject
<
volScalarField
>
(
rhoName_
);
...
@@ -427,7 +338,7 @@ bool Foam::functionObjects::scalarTransport::execute()
...
@@ -427,7 +338,7 @@ bool Foam::functionObjects::scalarTransport::execute()
sEqn
.
solve
(
mesh_
.
solverDict
(
schemesField_
));
sEqn
.
solve
(
mesh_
.
solverDict
(
schemesField_
));
}
}
}
}
else
if
(
!
compressibl
e
)
else
if
(
phi
.
dimensions
()
==
dimVolume
/
dimTim
e
)
{
{
for
(
label
i
=
0
;
i
<=
nCorr_
;
i
++
)
for
(
label
i
=
0
;
i
<=
nCorr_
;
i
++
)
{
{
...
...
This diff is collapsed.
Click to expand it.
src/functionObjects/solvers/scalarTransport/scalarTransport.H
+
0
−
4
View file @
0a5d1589
...
@@ -165,10 +165,6 @@ class scalarTransport
...
@@ -165,10 +165,6 @@ class scalarTransport
//- Name of flux field (optional)
//- Name of flux field (optional)
word
phiName_
;
word
phiName_
;
//- Name of velocity field from which the flux is obtained if phiName is
// not given (optional)
word
UPhiName_
;
//- Name of density field (optional)
//- Name of density field (optional)
word
rhoName_
;
word
rhoName_
;
...
...
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