From 4c4192c52fc59fc0051c5de69faab3682f40c5c2 Mon Sep 17 00:00:00 2001
From: Felix <feh7@hi.is>
Date: Thu, 22 Apr 2021 11:49:06 +0000
Subject: [PATCH] notes for all lectures

---
 notes.txt | 52 ++++++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 42 insertions(+), 10 deletions(-)

diff --git a/notes.txt b/notes.txt
index 552a5ba..0818354 100644
--- a/notes.txt
+++ b/notes.txt
@@ -1,8 +1,11 @@
 # Notes on project 4: Tipps and explanations from the lectures
+- goal is actually heat transfer (from pipe to fluid)
 - given flow/ forced flow
 - given Reynolds number
   - in buoyancy example: specified via temp difference
   - otherwise look at system/transportProperties to choose something to adjust Reynold number
+  - possible: cylinder size, inlet velocity, viscosity nu
+- for run script see 13.4. 42:10
 
 # Case
 - $FOAM_TUTORIALS/heatTransfer/buoyantBoussinesqPimpleFoam/any of the two, he used BenardCells
@@ -10,17 +13,18 @@
 
  ## Linear system solver
 - try out different solvers for linear systems in system/fvSolution
+  - important if too slow
 - can find options by supplying an invalid option
 - GAMG best -> needs preconditioner. He used DICGaussSeidel
 - more in 2021_03_30 at 26:00 +- 15 min
 - then PCG with GAMG as preconditioner: see until 2021_03_30 35:00
 
 ## More processors
-- more in 2021_03_30 at 39:00
+- more in 2021_03_30 at 39:00 and 15.4. around 0:8:00
 - find out what I have:
 cat /proc/cpuinfo
-- look at processors
-- change setting in system/decomposeParDict
+- look at processors -> see that I have processors 0,1,2,3, so 4 instead of 6
+- change setting in system/decomposeParDict (take file from tubeBundle.zip)
 - numberOfSubdomains = number of processors to use
 - method scotch -> is simpliest, tries to be smart.
 - run
@@ -34,10 +38,21 @@ foamJob -p laplacianFoam # replace by my solver
 - choose CaseType - Decomposed Case on left side
 - or run
 reconstructPar
+- all together in run.sh in tubeBundle.zip/<...>/run.sh
+
+- also for speeding up: setting output format to binary somewhere (controlDict?)
 
 # Schemes
+- see system/fvSchemes
 - options and comments in 2021_03_30 ca. 1:02:00
-- in divSchemes div(phi,U) Gauss upwind; # is always stable but in the example case it's horrible
+- in divSchemes div(phi,U) Gauss upwind; # is always stable but in the example and project3 case it's horrible
+  - others: Gauss linearUpwiry grad(U)
+            Gauss limitedLinearV 1 <- was best
+            Gauss linear
+- for ddt Euler OK but more accuracy with Backwards Scheme or CrankNicolsson
+- for divSchemes: limitedLinear could be replaced by Gauss Upwind
+- for laplacian Scheme: "corrected" is importand (13.4. 31:15)
+- mention which schemes are used!
 
 # The equation
 - incompressible -> ρ (density) is constant -> equation of state is simple
@@ -54,9 +69,6 @@ reconstructPar
   - but experiments have shown: Pr_t = 0.9 gives better results (try both!)
 - parameters/ dimensionless numbers see slide 7 in heat_transfer pdf
 
-# Solver
-- in project 3 used icoFoam. When heat transfer is included, another solver is necessary
-
 # Calculate values
 - for Nu need to calculate values in openfoam
 - see 48:20 ff and previous
@@ -67,10 +79,18 @@ postProcess -func 'grad(T)' -latestTime
 - Filters-Data Analysis-Calculator -> mag(grad(T)), choose "Cell Data" -> shows values
 - calculate average: Filters-Data Analysis-Integrate Variables (tick "divide data by cell volume") -> shows values, choose Cell Data
 - for some reason he calculates the magnitude and uses it as if he had the n·∇T  -- hä?? (ca. 54:00)
+- all in command-line in run.sh in tubeBundle.zip
+- get values from last time step, assuming steady state
+- in order to know if we are close, compare N=1 to N=big (e.g. 8) -> present this!!!
+
+- plotting quickly in python with loadtxt and plot: 15.4. 50:00
+
+- temperature fluctuations can be looked at to see which mesh density is sufficiant, see 15.4. around 1:18
 
 # Mesh
 - choose L big enough such that walls are not affecting flow around cylinder -> L >= 20 to 100 * d
 - best mesh: icelandic flag, as in 9.4. 16:05
+- extra arc away from cylinder -> goal: all 5 cells at corner have about 1/5 of 360°
 - grading
   - for grading within a block that goes from many-little-many:
   - ((längenanteil kästchenanteil grading)(längentanteil kästchenanteil grading)) 1 1)
@@ -79,8 +99,14 @@ postProcess -func 'grad(T)' -latestTime
 
 - square around cylinder with slightly curved edges
 - finer close to cylinder
+- smaller mesh def possible with mirroring, see 13.4. 1:14:30ff
+
+- mention all boundary conditions in report!
 - in boundary conditions we have reference to a file. This is to be found under $FOAM_ETC/path (but we didn't really look at it)
 - p boundary conditions to be set in 0/p_rgh, not 0/p
+  - for p take all calculated, take file from tubeBundle.zip
+- p_rgh
+  - inlet: zeroGradient or fixedFluxPressure (fits to constant flux)
 - boundary: cylinder like in project 3
   - T = T_w
   - U: no-slip
@@ -90,10 +116,13 @@ postProcess -func 'grad(T)' -latestTime
   - fixed flux pressure as in project 3
   - Temperature = T_inf
 - boundary outlet: pressure = 0
-  - velocity zero gradient -> should not directly restrict velocity
+  - velocity zero gradient -> should not directly restrict velocity (in project3, maybe here as well: fluxCorrectedVelocity)
   - T = zero gradient
 - top, bottom: not wall, so flow in or out is possible
-  - one possibility: cyclic boundary condition
+  - one possibility: cyclic boundary condition (see 13.4. 1:14:30ff)
+  - not properly explained, better in https://www.openfoam.com/documentation/guides/latest/doc/guide-bcs-coupled-cyclic.html
+  - he uses "mapped", see 15:51 for inlet/outlet -> not for project4
+  - but use cyclic similar to tubeBundle.zip/finalSol/system/createPatchDict
   - T = zero gradient
   
 - alphat
@@ -119,12 +148,15 @@ postProcess -func 'grad(T)' -latestTime
   - Tref ok in buoyancy
   - Pr 1.0 -> 0.7
   - Prt 1.0 (maybe 0.9)
-- system/g <- gravitational acceleration
+- system/g <- gravitational acceleration (according to 15.4. 1:34:10 can set to 0)
 - system/controlDict -> functions -> data in postProcessing
 - system/turbulenceProperties: setup turbulence
   - replace simulationType laminar to simulationType RAS;
   - looks the same but alphat, epsilon, k as parameters are added and visible in paraFoam Fields (bottom left)
 
+- time step can be adjusted such that Courant Number stays <= 1:
+- system/controlDict: adjustTimeStep yes
+- maxCo 1
 # paraFoam
 - tools- geometric ... - ruler for checking distances for mesh quality
 - under tab name there is 2D button - looks better than 3D picture
-- 
GitLab