Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
2abe1ca6
Commit
2abe1ca6
authored
Jan 21, 2015
by
Daniele de Grazia
Committed by
Dave Moxey
Jul 12, 2016
Browse files
Modification in BCs for CFS
(cherry picked from commit
29e72c99
)
parent
48493f1d
Changes
5
Hide whitespace changes
Inline
Side-by-side
solvers/CompressibleFlowSolver/EquationSystems/CompressibleFlowSystem.cpp
View file @
2abe1ca6
...
...
@@ -326,6 +326,7 @@ namespace Nektar
const
int
n
,
const
NekDouble
time
,
int
&
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
inarray
)
{
std
::
string
varName
;
...
...
@@ -335,48 +336,48 @@ namespace Nektar
{
if
(
boost
::
iequals
(
userDefStr
,
"Wall"
))
{
WallBC
(
n
,
cnt
,
inarray
);
WallBC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"WallViscous"
)
||
boost
::
iequals
(
userDefStr
,
"WallAdiabatic"
))
{
// Wall Boundary Condition
WallViscousBC
(
n
,
cnt
,
inarray
);
WallViscousBC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"Symmetry"
))
{
// Symmetric Boundary Condition
SymmetryBC
(
n
,
cnt
,
inarray
);
SymmetryBC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"RiemannInvariant"
))
{
// Riemann invariant characteristic Boundary Condition
RiemannInvariantBC
(
n
,
cnt
,
inarray
);
RiemannInvariantBC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"PressureOutflowNonReflective"
))
{
// Pressure outflow non-reflective Boundary Condition
PressureOutflowNonReflectiveBC
(
n
,
cnt
,
inarray
);
PressureOutflowNonReflectiveBC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"PressureOutflow"
))
{
// Pressure outflow Boundary Condition
PressureOutflowBC
(
n
,
cnt
,
inarray
);
PressureOutflowBC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"PressureOutflowFile"
))
{
// Pressure outflow Boundary Condition from file
PressureOutflowFileBC
(
n
,
cnt
,
inarray
);
PressureOutflowFileBC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"PressureInflowFile"
))
{
// Pressure inflow Boundary Condition from file
PressureInflowFileBC
(
n
,
cnt
,
inarray
);
PressureInflowFileBC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"ExtrapOrder0"
))
{
// Extrapolation of the data at the boundaries
ExtrapOrder0BC
(
n
,
cnt
,
inarray
);
ExtrapOrder0BC
(
n
,
cnt
,
Fwd
,
inarray
);
}
else
if
(
boost
::
iequals
(
userDefStr
,
"TimeDependent"
))
{
...
...
@@ -401,6 +402,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
WallBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
;
...
...
@@ -410,14 +412,6 @@ namespace Nektar
const
Array
<
OneD
,
const
int
>
&
traceBndMap
=
m_fields
[
0
]
->
GetTraceBndMap
();
// Get physical values of the forward trace
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
// Adjust the physical values of the trace to take
// user defined boundaries into account
int
e
,
id1
,
id2
,
nBCEdgePts
,
eMax
;
...
...
@@ -498,6 +492,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
WallViscousBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
;
...
...
@@ -507,14 +502,6 @@ namespace Nektar
const
Array
<
OneD
,
const
int
>
&
traceBndMap
=
m_fields
[
0
]
->
GetTraceBndMap
();
// Get physical values of the forward trace
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
// Take into account that for PDE based shock capturing, eps = 0 at the
// wall. Adjust the physical values of the trace to take user defined
// boundaries into account
...
...
@@ -573,6 +560,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
SymmetryBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
;
...
...
@@ -582,14 +570,6 @@ namespace Nektar
const
Array
<
OneD
,
const
int
>
&
traceBndMap
=
m_fields
[
0
]
->
GetTraceBndMap
();
// Get physical values of the forward trace (from exp to phys)
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
// Take into account that for PDE based shock capturing, eps = 0 at the
// wall.
int
e
,
id1
,
id2
,
nBCEdgePts
,
eMax
;
...
...
@@ -669,6 +649,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
RiemannInvariantBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
,
j
;
...
...
@@ -706,14 +687,6 @@ namespace Nektar
Vmath
::
Vadd
(
nTracePts
,
VnInf
,
1
,
tmp2
,
1
,
VnInf
,
1
);
}
// Get physical values of the forward trace
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
// Computing the normal velocity for characteristics coming
// from inside the computational domain
Array
<
OneD
,
NekDouble
>
Vn
(
nTracePts
,
0.0
);
...
...
@@ -926,6 +899,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
PressureOutflowNonReflectiveBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
,
j
;
...
...
@@ -962,14 +936,6 @@ namespace Nektar
Vmath
::
Vadd
(
nTracePts
,
VnInf
,
1
,
tmp2
,
1
,
VnInf
,
1
);
}
// Get physical values of the forward trace
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
// Computing the normal velocity for characteristics coming
// from inside the computational domain
Array
<
OneD
,
NekDouble
>
Vn
(
nTracePts
,
0.0
);
...
...
@@ -1086,6 +1052,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
PressureOutflowBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
,
j
;
...
...
@@ -1122,14 +1089,6 @@ namespace Nektar
Vmath
::
Vadd
(
nTracePts
,
VnInf
,
1
,
tmp2
,
1
,
VnInf
,
1
);
}
// Get physical values of the forward trace
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
// Computing the normal velocity for characteristics coming
// from inside the computational domain
Array
<
OneD
,
NekDouble
>
Vn
(
nTracePts
,
0.0
);
...
...
@@ -1247,6 +1206,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
PressureOutflowFileBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
,
j
;
...
...
@@ -1283,15 +1243,6 @@ namespace Nektar
Vmath
::
Vadd
(
nTracePts
,
VnInf
,
1
,
tmp2
,
1
,
VnInf
,
1
);
}
// Get physical values of the forward trace
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
,
0.0
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
// Computing the normal velocity for characteristics coming
// from inside the computational domain
Array
<
OneD
,
NekDouble
>
Vn
(
nTracePts
,
0.0
);
...
...
@@ -1411,6 +1362,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
PressureInflowFileBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
,
j
;
...
...
@@ -1447,15 +1399,6 @@ namespace Nektar
Vmath
::
Vadd
(
nTracePts
,
VnInf
,
1
,
tmp2
,
1
,
VnInf
,
1
);
}
// Get physical values of the forward trace
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
,
0.0
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
// Computing the normal velocity for characteristics coming
// from inside the computational domain
Array
<
OneD
,
NekDouble
>
Vn
(
nTracePts
,
0.0
);
...
...
@@ -1574,6 +1517,7 @@ namespace Nektar
void
CompressibleFlowSystem
::
ExtrapOrder0BC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
)
{
int
i
,
j
;
...
...
@@ -1586,14 +1530,6 @@ namespace Nektar
const
Array
<
OneD
,
const
int
>
&
traceBndMap
=
m_fields
[
0
]
->
GetTraceBndMap
();
// Get physical values of the forward trace
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nVariables
);
for
(
i
=
0
;
i
<
nVariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
physarray
[
i
],
Fwd
[
i
]);
}
int
eMax
;
eMax
=
m_fields
[
0
]
->
GetBndCondExpansions
()[
bcRegion
]
->
GetExpSize
();
...
...
solvers/CompressibleFlowSolver/EquationSystems/CompressibleFlowSystem.h
View file @
2abe1ca6
...
...
@@ -164,43 +164,53 @@ namespace Nektar
const
int
n
,
const
NekDouble
time
,
int
&
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
inarray
);
void
WallBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
WallViscousBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
SymmetryBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
RiemannInvariantBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
PressureOutflowNonReflectiveBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
PressureOutflowBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
PressureOutflowFileBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
PressureInflowFileBC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
ExtrapOrder0BC
(
int
bcRegion
,
int
cnt
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
Fwd
,
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physarray
);
void
GetVelocityVector
(
const
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
&
physfield
,
...
...
solvers/CompressibleFlowSolver/EquationSystems/EulerADCFE.cpp
View file @
2abe1ca6
...
...
@@ -275,6 +275,15 @@ namespace Nektar
std
::
string
varName
;
int
cnt
=
0
;
int
nTracePts
=
GetTraceTotPoints
();
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nvariables
);
for
(
int
i
=
0
;
i
<
nvariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
inarray
[
i
],
Fwd
[
i
]);
}
// loop over Boundary Regions
for
(
int
n
=
0
;
n
<
m_fields
[
0
]
->
GetBndConditions
().
num_elements
();
++
n
)
{
...
...
@@ -289,12 +298,12 @@ namespace Nektar
}
else
{
SetCommonBC
(
type
,
n
,
time
,
cnt
,
inarray
);
SetCommonBC
(
type
,
n
,
time
,
cnt
,
inarray
);
}
// no User Defined conditions provided so skip cnt
// this line is left in case solver specific condition is added.
cnt
+=
m_fields
[
0
]
->
GetBndCondExpansions
()[
n
]
->
GetExpSize
();
// no User Defined conditions provided so skip cnt
// this line is left in case solver specific condition is added.
cnt
+=
m_fields
[
0
]
->
GetBndCondExpansions
()[
n
]
->
GetExpSize
();
}
}
}
solvers/CompressibleFlowSolver/EquationSystems/EulerCFE.cpp
View file @
2abe1ca6
...
...
@@ -223,6 +223,14 @@ namespace Nektar
{
std
::
string
varName
;
int
cnt
=
0
;
int
nTracePts
=
GetTraceTotPoints
();
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nvariables
);
for
(
int
i
=
0
;
i
<
nvariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
inarray
[
i
],
Fwd
[
i
]);
}
std
::
string
userDefStr
;
int
nreg
=
m_fields
[
0
]
->
GetBndConditions
().
num_elements
();
...
...
@@ -249,7 +257,7 @@ namespace Nektar
else
{
// set up userdefined BC common to all solvers
SetCommonBC
(
userDefStr
,
n
,
time
,
cnt
,
inarray
);
SetCommonBC
(
userDefStr
,
n
,
time
,
cnt
,
Fwd
,
inarray
);
}
}
...
...
solvers/CompressibleFlowSolver/EquationSystems/NavierStokesCFE.cpp
View file @
2abe1ca6
...
...
@@ -251,12 +251,20 @@ namespace Nektar
{
std
::
string
varName
;
int
cnt
=
0
;
int
nTracePts
=
GetTraceTotPoints
();
Array
<
OneD
,
Array
<
OneD
,
NekDouble
>
>
Fwd
(
nvariables
);
for
(
int
i
=
0
;
i
<
nvariables
;
++
i
)
{
Fwd
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
nTracePts
);
m_fields
[
i
]
->
ExtractTracePhys
(
inarray
[
i
],
Fwd
[
i
]);
}
// loop over Boundary Regions
for
(
int
n
=
0
;
n
<
m_fields
[
0
]
->
GetBndConditions
().
num_elements
();
++
n
)
{
std
::
string
type
=
m_fields
[
0
]
->
GetBndConditions
()[
n
]
->
GetUserDefined
();
SetCommonBC
(
type
,
n
,
time
,
cnt
,
inarray
);
SetCommonBC
(
type
,
n
,
time
,
cnt
,
Fwd
,
inarray
);
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment