Skip to content
Snippets Groups Projects
Commit 32de0b6e authored by Konstantin Kutscher's avatar Konstantin Kutscher
Browse files

No commit message

No commit message
parent 7fcc62cd
No related branches found
No related tags found
No related merge requests found
import os
import string
file_name = 'lib.h'
folder='c:/Projects/bFluid/source/lib'
if os.path.exists(file_name):
os.remove(file_name)
fo=file(file_name,'w')
folder='c:/Projects/bFluid/source/lib'
for roots,dirs,files in os.walk(folder):
for header in files:
if header.endswith(('.h','.hpp')):
header=str(os.path.join(roots,header))
header_new = header.lstrip(folder)
x=header_new.replace('\\','/')
y=str('#include <'+x+'>\n')
y=y.replace('</','<')
fo.write(y)
fo.close()
print 'lib.h is generated!'
import os
os.system("date")
pathin = "/gfs1/work/niivfcpu/scratch/kucher/BKanaltest/steps/step*"
pathout = "/gfs1/work/niivfcpu/scratch/kucher/BKanaltest/tar/step"
tar = "tar -cvf "
start = 281750
step = 2250
stop = start + step * 10
print stop
for i in range(start, stop, step):
command = tar + pathout + str(i) + ".tar " + pathin + str(i) + "*"
#print command
os.system(command)
\ No newline at end of file
print 30*27
print 675/27
print 3*1*9
bMaxX1 = 10
bMaxX2 = 10
bMaxX3 = 10
minX1 = 0
minX2 = 0
minX3 = 0
maxX1 = bMaxX1 - 1
maxX2 = bMaxX2 - 1
maxX3 = bMaxX3 - 1
lMin1X1 = maxX1 - 6
lMax1X1 = lMin1X1 + 4
lMin1X3 = maxX3 - 6
lMax1X3 = lMin1X3
lMin2X1 = maxX1 - 6
lMax2X1 = lMin2X1
lMin2X3 = maxX3 - 6
lMax2X3 = lMin2X3 + 4
lMin1X2 = minX2;
lMax1X2 = maxX2 + - 1;
print 'FC send: ' + str(((lMax1X1-lMin1X1+1)*(lMax1X2-lMin1X2+1)*(lMax1X3-lMin1X3+1) + (lMax2X1-lMin2X1+1)*(lMax1X2-lMin1X2+1)*(lMax2X3-lMin2X3+1)) / 2)
lMin1X1 = maxX1 - 3
lMax1X1 = lMin1X1 + 2
lMin1X3 = maxX3 - 3
lMax1X3 = lMin1X3
lMin2X1 = maxX1 - 3
lMax2X1 = lMin2X1
lMin2X3 = maxX3 - 3
lMax2X3 = lMin2X3 + 2
lMin1X2 = minX2
lMax1X2 = 4
print 'CF receive: ' + str(((lMax1X1-lMin1X1+1)*(lMax1X2-lMin1X2+1)*(lMax1X3-lMin1X3+1) + (lMax2X1-lMin2X1+1)*(lMax1X2-lMin1X2+1)*(lMax2X3-lMin2X3+1)))
import os
os.system("date")
pathin = "/hpc3lustre/work/koskuche/SFB880/BKanalTestBerlin/tar/step"
pathout = "/hpc3lustre/work/koskuche/SFB880/BKanalTestBerlin/steps"
tar = "tar -xvf "
start = 491000
step = 2250
stop = start + step * 2
print stop
for i in range(start, stop, step):
command = tar + pathin + str(i) + ".tar -C " + pathout + " --strip-components=7"
#print command
os.system(command)
\ No newline at end of file
#script create data file for maximum strain rate in path lines
from paraview.simple import *
file='d:/temp/pathLine/pathLine.pvtu'
print file
#read data set file
reader = XMLPartitionedUnstructuredGridReader(FileName=file)
threshold = Threshold(reader)
threshold.Scalars = 'ID'
r=1.0
threshold.ThresholdRange = [r, r]
print threshold.ThresholdRange
#help(threshold)
pcalc = PythonCalculator(threshold)
pcalc.Expression = 'max(tauxy)'
pcalc.UpdatePipeline()
#pcalc.GetOutput()
#help(pcalc)
#pcalc.inputs[0].Points[:,0]
print pcalc.PointData.Points
points = pcalc.Points
#help(points)
print pcalc.GetPointDataInformation().GetArray("result").GetRange()[0]
\ No newline at end of file
#script create data file for surface averaged velocity plot
from paraview.simple import *
file='/hpc3lustre/work/sonjaOutputs/BKanaltest0Ref2nue0312/steps/stepAV_150000.pvtu'
print file
#read data set file
reader = XMLPartitionedUnstructuredGridReader(FileName=file)
#create slice filter for z
sliceFilter = Slice(reader)
sliceFilter.SliceType.Normal = [0, 0, 1]
#create calculator filter for calculate surface of elements
calc = Calculator(sliceFilter)
calc.ResultArrayName = "one"
calc.Function = "1"
#create integrate variables filter for integration of velocity (integration = summation * surface of elements)
intVal = IntegrateVariables(calc)
f = open('/work/koskuche/SFB880/BKanalPlotData/BKanalAvVx400s2.dat', 'w')
f.write("z")
f.write(" ")
f.write("avVx")
f.write(" ")
f.write("avVxx")
f.write(" ")
f.write("avVyy")
f.write(" ")
f.write("avVzz")
f.write(" ")
f.write("avVxz")
f.write("\n")
#for i in range (1, 400, 1):
z = 0.995
while z <= 396:
#shift a slice
sliceFilter.SliceType.Origin = [298.668884754181, 198.835281848907, z]
sliceFilter.UpdatePipeline()
print z
numPoints=sliceFilter.GetDataInformation().GetNumberOfPoints()
print numPoints
intVal.UpdatePipeline()
pointData=intVal.GetPointDataInformation()
vxArray=pointData.GetArray("vx")
vxxArray=pointData.GetArray("vxx")
vyyArray=pointData.GetArray("vyy")
vzzArray=pointData.GetArray("vzz")
vxzArray=pointData.GetArray("vxz")
sArray =pointData.GetArray("one")
surface =sArray.GetRange()[0]
if numPoints > 0:
avVx=vxArray.GetRange()[0]/surface
avVxx=vxxArray.GetRange()[0]/surface
avVyy=vyyArray.GetRange()[0]/surface
avVzz=vzzArray.GetRange()[0]/surface
avVxz=vxzArray.GetRange()[0]/surface
f.write(str(z))
f.write(" ")
f.write(str(avVx))
f.write(" ")
f.write(str(avVxx))
f.write(" ")
f.write(str(avVyy))
f.write(" ")
f.write(str(avVzz))
f.write(" ")
f.write(str(avVxz))
f.write("\n")
if z < 280:
z=z+1.99005
else:
z=z+3.9801
f.close()
print "!!!ready!!!"
\ No newline at end of file
(* Content-type: application/vnd.wolfram.mathematica *)
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 10.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 158, 7]
NotebookDataLength[ 10447, 365]
NotebookOptionsPosition[ 9362, 321]
NotebookOutlinePosition[ 9705, 336]
CellTagsIndexPosition[ 9662, 333]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Expand", "[",
RowBox[{
RowBox[{"(",
RowBox[{"ux", "-", "Ux"}], ")"}], "^", "3"}], "]"}]], "Input",
CellChangeTimes->{{3.6652333854347067`*^9, 3.665233411326749*^9}}],
Cell[BoxData[
RowBox[{
SuperscriptBox["ux", "3"], "-",
RowBox[{"3", " ",
SuperscriptBox["ux", "2"], " ", "Ux"}], "+",
RowBox[{"3", " ", "ux", " ",
SuperscriptBox["Ux", "2"]}], "-",
SuperscriptBox["Ux", "3"]}]], "Output",
CellChangeTimes->{3.665233412534567*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Expand", "[",
RowBox[{
RowBox[{"(",
RowBox[{"ux", "-", "Ux"}], ")"}], "*",
RowBox[{"(",
RowBox[{"uy", "-", "Uy"}], ")"}], "*",
RowBox[{"(",
RowBox[{"uz", "-", "Uz"}], ")"}]}], "]"}]], "Input",
CellChangeTimes->{{3.665234958289308*^9, 3.665234978795968*^9}}],
Cell[BoxData[
RowBox[{
RowBox[{"ux", " ", "uy", " ", "uz"}], "-",
RowBox[{"Ux", " ", "uy", " ", "uz"}], "-",
RowBox[{"ux", " ", "Uy", " ", "uz"}], "+",
RowBox[{"Ux", " ", "Uy", " ", "uz"}], "-",
RowBox[{"ux", " ", "uy", " ", "Uz"}], "+",
RowBox[{"Ux", " ", "uy", " ", "Uz"}], "+",
RowBox[{"ux", " ", "Uy", " ", "Uz"}], "-",
RowBox[{"Ux", " ", "Uy", " ", "Uz"}]}]], "Output",
CellChangeTimes->{3.6652349812057548`*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Expand", "[",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"ux", "-", "Ux"}], ")"}], "^", "2"}], "*",
RowBox[{"(",
RowBox[{"uy", "-", "Uy"}], ")"}]}], "]"}]], "Input",
CellChangeTimes->{{3.6652350670376253`*^9, 3.665235078036113*^9}}],
Cell[BoxData[
RowBox[{
RowBox[{
SuperscriptBox["ux", "2"], " ", "uy"}], "-",
RowBox[{"2", " ", "ux", " ", "Ux", " ", "uy"}], "+",
RowBox[{
SuperscriptBox["Ux", "2"], " ", "uy"}], "-",
RowBox[{
SuperscriptBox["ux", "2"], " ", "Uy"}], "+",
RowBox[{"2", " ", "ux", " ", "Ux", " ", "Uy"}], "-",
RowBox[{
SuperscriptBox["Ux", "2"], " ", "Uy"}]}]], "Output",
CellChangeTimes->{3.6652350792380753`*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Expand", "[",
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{"ux", "-", "Ux"}], ")"}], "^", "2"}], "*",
RowBox[{"(",
RowBox[{"ux", "-", "Ux"}], ")"}]}], "]"}]], "Input",
CellChangeTimes->{{3.665235285108924*^9, 3.665235288876026*^9}}],
Cell[BoxData[
RowBox[{
SuperscriptBox["ux", "3"], "-",
RowBox[{"3", " ",
SuperscriptBox["ux", "2"], " ", "Ux"}], "+",
RowBox[{"3", " ", "ux", " ",
SuperscriptBox["Ux", "2"]}], "-",
SuperscriptBox["Ux", "3"]}]], "Output",
CellChangeTimes->{3.665235291918062*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Expand", "[",
RowBox[{
RowBox[{"1", "/", "n"}], "*",
RowBox[{"Sum", "[",
RowBox[{
RowBox[{
RowBox[{
RowBox[{"(",
RowBox[{
RowBox[{"ux", "[", "i", "]"}], "-", "Ux"}], ")"}], "^", "2"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"uz", "[", "i", "]"}], "-", "Uz"}], ")"}]}], ",",
RowBox[{"{",
RowBox[{"i", ",", "0", ",", "n"}], "}"}]}], "]"}]}], "]"}]], "Input",
CellChangeTimes->{{3.6652353351359625`*^9, 3.6652353384183865`*^9}, {
3.665235469081513*^9, 3.665235491832822*^9}, {3.6652355801722608`*^9,
3.6652356889244556`*^9}, {3.66523574166329*^9, 3.6652357781472335`*^9}}],
Cell[BoxData[
FractionBox[
RowBox[{
UnderoverscriptBox["\[Sum]",
RowBox[{"i", "=", "0"}], "n"],
RowBox[{
SuperscriptBox[
RowBox[{"(",
RowBox[{
RowBox[{"-", "Ux"}], "+",
RowBox[{"ux", "[", "i", "]"}]}], ")"}], "2"], " ",
RowBox[{"(",
RowBox[{
RowBox[{"-", "Uz"}], "+",
RowBox[{"uz", "[", "i", "]"}]}], ")"}]}]}], "n"]], "Output",
CellChangeTimes->{
3.6652353396467347`*^9, 3.6652355168932877`*^9, {3.665235673513936*^9,
3.665235690097102*^9}, 3.6652357791478987`*^9}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{
RowBox[{
RowBox[{"Sum", "[",
RowBox[{
RowBox[{"Expand", "[",
RowBox[{
RowBox[{"1", "/", "n"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"ux", "[", "i", "]"}], "-", "Ux"}], ")"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"uy", "[", "i", "]"}], "-", "Uy"}], ")"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"uz", "[", "i", "]"}], "-", "Uz"}], ")"}]}], "]"}], ",",
RowBox[{"{",
RowBox[{"i", ",", "1", ",", "n"}], "}"}]}], "]"}], "/.",
RowBox[{
RowBox[{"uy", "[", "i", "]"}], "\[Rule]",
RowBox[{"ux", "[", "i", "]"}]}]}], "/.",
RowBox[{"Uy", "\[Rule]", "Ux"}]}]], "Input",
CellChangeTimes->{{3.665236764045683*^9, 3.6652367697271566`*^9}, {
3.665237436328154*^9, 3.665237442171824*^9}, {3.6652374810518904`*^9,
3.6652374987393093`*^9}}],
Cell[BoxData[
RowBox[{
UnderoverscriptBox["\[Sum]",
RowBox[{"i", "=", "1"}], "n"],
RowBox[{"(",
RowBox[{
RowBox[{"-",
FractionBox[
RowBox[{
SuperscriptBox["Ux", "2"], " ", "Uz"}], "n"]}], "+",
FractionBox[
RowBox[{"2", " ", "Ux", " ", "Uz", " ",
RowBox[{"ux", "[", "i", "]"}]}], "n"], "-",
FractionBox[
RowBox[{"Uz", " ",
SuperscriptBox[
RowBox[{"ux", "[", "i", "]"}], "2"]}], "n"], "+",
FractionBox[
RowBox[{
SuperscriptBox["Ux", "2"], " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"], "-",
FractionBox[
RowBox[{"2", " ", "Ux", " ",
RowBox[{"ux", "[", "i", "]"}], " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"], "+",
FractionBox[
RowBox[{
SuperscriptBox[
RowBox[{"ux", "[", "i", "]"}], "2"], " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"]}], ")"}]}]], "Output",
CellChangeTimes->{
3.6652367708783035`*^9, 3.665237448476756*^9, {3.665237486558442*^9,
3.665237499752672*^9}}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Sum", "[",
RowBox[{
RowBox[{"Expand", "[",
RowBox[{
RowBox[{"1", "/", "n"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"ux", "[", "i", "]"}], "-", "Ux"}], ")"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"uy", "[", "i", "]"}], "-", "Uy"}], ")"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"uz", "[", "i", "]"}], "-", "Uz"}], ")"}]}], "]"}], ",",
RowBox[{"{",
RowBox[{"i", ",", "1", ",", "n"}], "}"}]}], "]"}]], "Input",
CellChangeTimes->{{3.6652367948266797`*^9, 3.665236831166998*^9}}],
Cell[BoxData[
RowBox[{
UnderoverscriptBox["\[Sum]",
RowBox[{"i", "=", "1"}], "n"],
RowBox[{"(",
RowBox[{
RowBox[{"-",
FractionBox[
RowBox[{"Ux", " ", "Uy", " ", "Uz"}], "n"]}], "+",
FractionBox[
RowBox[{"Uy", " ", "Uz", " ",
RowBox[{"ux", "[", "i", "]"}]}], "n"], "+",
FractionBox[
RowBox[{"Ux", " ", "Uz", " ",
RowBox[{"uy", "[", "i", "]"}]}], "n"], "-",
FractionBox[
RowBox[{"Uz", " ",
RowBox[{"ux", "[", "i", "]"}], " ",
RowBox[{"uy", "[", "i", "]"}]}], "n"], "+",
FractionBox[
RowBox[{"Ux", " ", "Uy", " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"], "-",
FractionBox[
RowBox[{"Uy", " ",
RowBox[{"ux", "[", "i", "]"}], " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"], "-",
FractionBox[
RowBox[{"Ux", " ",
RowBox[{"uy", "[", "i", "]"}], " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"], "+",
FractionBox[
RowBox[{
RowBox[{"ux", "[", "i", "]"}], " ",
RowBox[{"uy", "[", "i", "]"}], " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"]}], ")"}]}]], "Output",
CellChangeTimes->{{3.665236806892251*^9, 3.6652368327940598`*^9}}]
}, Open ]],
Cell[CellGroupData[{
Cell[BoxData[
RowBox[{"Sum", "[",
RowBox[{
RowBox[{"Expand", "[",
RowBox[{
RowBox[{"1", "/", "n"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"ux", "[", "i", "]"}], "-", "Ux"}], ")"}], "*",
RowBox[{"(",
RowBox[{
RowBox[{"uz", "[", "i", "]"}], "-", "Uz"}], ")"}]}], "]"}], ",",
RowBox[{"{",
RowBox[{"i", ",", "1", ",", "n"}], "}"}]}], "]"}]], "Input",
CellChangeTimes->{{3.666867798745492*^9, 3.6668678014904623`*^9}, {
3.6668679338550305`*^9, 3.6668679547564764`*^9}}],
Cell[BoxData[
RowBox[{
UnderoverscriptBox["\[Sum]",
RowBox[{"i", "=", "1"}], "n"],
RowBox[{"(",
RowBox[{
FractionBox[
RowBox[{"Ux", " ", "Uz"}], "n"], "-",
FractionBox[
RowBox[{"Uz", " ",
RowBox[{"ux", "[", "i", "]"}]}], "n"], "-",
FractionBox[
RowBox[{"Ux", " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"], "+",
FractionBox[
RowBox[{
RowBox[{"ux", "[", "i", "]"}], " ",
RowBox[{"uz", "[", "i", "]"}]}], "n"]}], ")"}]}]], "Output",
CellChangeTimes->{3.666867803381354*^9, 3.666867956606307*^9}]
}, Open ]]
},
WindowSize->{944, 981},
WindowMargins->{{Automatic, 0}, {Automatic, 0}},
FrontEndVersion->"10.0 for Microsoft Windows (64-bit) (December 4, 2014)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)
(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[580, 22, 201, 5, 31, "Input"],
Cell[784, 29, 282, 8, 31, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[1103, 42, 311, 9, 31, "Input"],
Cell[1417, 53, 442, 10, 31, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[1896, 68, 278, 8, 31, "Input"],
Cell[2177, 78, 426, 12, 31, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[2640, 95, 276, 8, 31, "Input"],
Cell[2919, 105, 282, 8, 31, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[3238, 118, 682, 18, 31, "Input"],
Cell[3923, 138, 543, 17, 49, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[4503, 160, 879, 25, 31, "Input"],
Cell[5385, 187, 1022, 32, 55, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[6444, 224, 575, 17, 31, "Input"],
Cell[7022, 243, 1184, 35, 93, "Output"]
}, Open ]],
Cell[CellGroupData[{
Cell[8243, 283, 530, 15, 31, "Input"],
Cell[8776, 300, 570, 18, 88, "Output"]
}, Open ]]
}
]
*)
(* End of internal cache information *)
from virtualfluids import *
config=virtualfluids.load("config.txt")
u_real = 17
u_LB = 0.1
deltax = 0.078125
number_of_timesteps = 84000
deltat=(u_LB/u_real)*deltax
print 'delta t =', deltat, 's'
print 'simulated time =', deltat*number_of_timesteps, 'sec'
print 'simulated time =', deltat*number_of_timesteps/60.0, 'min'
import math
k = 0.41
u1=1.2
u2=0
y1=6
y2=0.05
u_tau = k/2.3 * (u2 - u1) / math.log10(y1/y2)
print 'u_tau = ', u_tau
import math
u = 0.0154946
nu = 7.05882e-05 * pow(2,4)
y0 = 0.00595276
deltax = 0.078125
q = y0/deltax
utau = math.sqrt(nu*(u/q))
yplus = (utau*q)/nu
print 'u_tau = ', utau
print 'y_plus = ', yplus
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment