Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
dumux-repositories
dumux
Commits
741bbd77
Commit
741bbd77
authored
8 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[box] Simplify Darcys law using axpy operator
parent
8acc6b85
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!617
[WIP] Next
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dumux/discretization/box/darcyslaw.hh
+7
-18
7 additions, 18 deletions
dumux/discretization/box/darcyslaw.hh
with
7 additions
and
18 deletions
dumux/discretization/box/darcyslaw.hh
+
7
−
18
View file @
741bbd77
...
...
@@ -113,23 +113,13 @@ public:
rho
+=
volVars
.
density
(
phaseIdx
)
*
shapeValues
[
scv
.
index
()][
0
];
// the global shape function gradient
DimVector
gradI
;
jacInvT
.
mv
(
shapeJacobian
[
scv
.
index
()][
0
],
gradI
);
gradI
*=
volVars
.
pressure
(
phaseIdx
);
gradP
+=
gradI
;
DimVector
gradN
;
jacInvT
.
mv
(
shapeJacobian
[
scv
.
index
()][
0
],
gradN
);
gradP
.
axpy
(
volVars
.
pressure
(
phaseIdx
),
gradN
);
}
if
(
enableGravity
)
{
// gravitational acceleration
DimVector
g
(
problem
.
gravityAtPos
(
scvf
.
center
()));
// turn gravity into a force
g
*=
rho
;
// subtract from pressure gradient
gradP
-=
g
;
}
if
(
enableGravity
)
gradP
.
axpy
(
-
rho
,
problem
.
gravityAtPos
(
scvf
.
center
()));
// apply the permeability and return the flux
auto
KGradP
=
applyPermeability_
(
K
,
gradP
);
...
...
@@ -137,15 +127,14 @@ public:
}
private
:
static
DimVector
applyPermeability_
(
const
DimWorldMatrix
&
K
,
const
DimVector
&
gradI
)
inline
static
DimVector
applyPermeability_
(
const
DimWorldMatrix
&
K
,
const
DimVector
&
gradI
)
{
DimVector
result
(
0.0
);
K
.
mv
(
gradI
,
result
);
return
result
;
}
static
DimVector
applyPermeability_
(
const
Scalar
k
,
const
DimVector
&
gradI
)
inline
static
DimVector
applyPermeability_
(
const
Scalar
k
,
const
DimVector
&
gradI
)
{
DimVector
result
(
gradI
);
result
*=
k
;
...
...
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