Sunday, September 15, 2019

notes about rhocentralfoam

https://www.openfoam.com/documentation/tutorial-guide/tutorialse6.php

https://curiosityfluids.com/2016/04/01/pressure-driven-nozzle-flow-with-shock-rhocentralfoam/

Saturday, September 14, 2019

Grids for Use with Open Foam

Grids for OpenFoam

Creating Grids with BlockMesh:


How to create a grid with blockMesh in OpenFOAM - tutorial

Creating a Grid with GMSH:

https://openfoamwiki.net/index.php/2D_Mesh_Tutorial_using_GMSH

Gmsh Tutorial Part 1 - Fundamentals and 2-D Meshing

https://www.youtube.com/watch?v=xL2LmDsDLYw

Gmsh Tutorial Part 2 - 3-D Meshing

https://www.youtube.com/watch?v=laKHzos3EbU

Gmsh Tutorial Part 3 - Scripting and Controlling Mesh Resolution

https://www.youtube.com/watch?v=laKHzos3EbU

Monday, May 27, 2019

Constructing a Face

Constructing mesh with non-default patches of size:
    inletFace    11
    inletWall    194
    inletsourceFace    1067
    inletdestinationFace    1067
    fineMeshWall    89
    fineMeshSourceFace    50000
    fineMeshdestinationFace    50000
    fineMeshSymmetryWall    500
    fineMeshOutletLeft    500
    fineMeshOutletBottom    100

Adding cell and face zones
 Face Zone fineMeshInlet     11
 Face Zone inletboundaries     11

Friday, May 10, 2019

Blinking in Unison

Both the Eggtimer LCD and Eggtimer RX blink in unison with the Eggfinder Mini, but I am stuck with "Waiting for Fix" with the Eggtimer LCD and data that looks like

http://raptorlicious.blogspot.com/2018/12/nmea-data.html

for the Eggtimer RX.

Monday, May 6, 2019

Holo Host Investigation

Looking at Holo Host Stuff:

https://nixos.org/releases/nix/nix-0.5/manual/manual.html

https://github.com/Holo-Host/holoportos

Thursday, April 25, 2019

steps to work with CFD

1) Load Mesh File | Compound_Mesh_1.unv in brentscavity2_0.0126L.tar.gz
1.5) Transform to polymesh ideasToUNVFoam
2) transformPoints -scale '(0.00006 0.00006 0.00006)'
compare dimensions of the grid in pixels to grid dimensions in Holly's Paper
3) Use configuration files in 0 and system for pisoFoam
4) Run the Simulation for 1 to 2 days
5) Change the Configuration file for System to SimpleFoam
----------------------------------------------------------
Run SimpleFoam
Plot over line in pisoFoam
----------------------------------------------------------

For step 3 see the video:
https://www.youtube.com/watch?v=IPExwi2Ar-g

Mistakes::: I think that the configuration files

uref = 17.3 m/s ==> k = 1.122
uref = 8.7 m/s  ==> k = 0.284





k = 1.122 m/s ==> epsilon = 4293.94

k = 0.284 m/s ==> epsilon = 546.10


epsilon = 546.10 ==> omega = 1924.001
epsilon = 4293.94 ==> omega = 3825.89

So now I have U, p, k, and epsilon covered.

nut and T were worked out in:
https://github.com/bshambaugh/brentscavity3.bkcup/tree/master/0

R is generated

Sunday, April 14, 2019

CFD stuff

Step 1: run simulation with pisoFoam
Step 2: run selected time step with SimpleFoam

Make sure that you scale the mesh correctly.

Sunday, March 17, 2019

Velocity decay plot


Look at videos showing how to plot.

Monday, March 11, 2019

Creating new components in KiCad links

https://learn.sparkfun.com/tutorials/beginners-guide-to-kicad/creating-custom-kicad-schematic-components

http://kicadhowto.org/MakeCompFootP.htm

Saturday, February 16, 2019

Friday, February 15, 2019

How to find empty boundary file folders in linux

find ./*/0 -type d -empty

Following: https://stackoverflow.com/questions/9417967/how-to-list-empty-folders-in-linux

Thursday, February 14, 2019

Creating Mesh for CFD

Create Mesh in Salome Meca

Export to UNV

transformPoints -scale '(0.00002955 0.00002955 0.00002955)'


Debugging recursive program with gdb Listing 5.10 in Sams Teach Yourself C in days

Debugging Listing 5.10 in Sam's Teach Yourself C++ in 21 days by Jesse Liberty with GDB. Referencing: https://www.thegeekstuff.com/2010/03/debug-c-program-using-gdb/
https://cets.seas.upenn.edu/answers/gcc.html

Output: g++ -d listing5.1.c
Output: $ gdb a.out

(gdb) break 21
Breakpoint 1 at 0x40096e: file listing5.10.c, line 21.
(gdb) run
Starting program: /home/brent/Downloads/Cpp/Debugger/a.out
Enter number to find: 5



Breakpoint 1, fib (n=5) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) print n
$1 = 5
(gdb) c
Continuing.
Processing fib(5)... Call fib(3) and fib(4).

Breakpoint 1, fib (n=3) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) print n
$2 = 3
(gdb) c
Continuing.
Processing fib(3)... Call fib(1) and fib(2).

Breakpoint 1, fib (n=1) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) print n
$3 = 1
(gdb) c
Continuing.
Processing fib(1)... Return 1!

Breakpoint 1, fib (n=2) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) c
Continuing.
Processing fib(2)... Return 1!

Breakpoint 1, fib (n=4) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) print n
$4 = 4
(gdb) c
Continuing.
Processing fib(4)... Call fib(2) and fib(3).

Breakpoint 1, fib (n=2) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) print n
$5 = 2
(gdb) c
Continuing.
Processing fib(2)... Return 1!

Breakpoint 1, fib (n=3) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) print n
$6 = 3
(gdb) c
Continuing.
Processing fib(3)... Call fib(1) and fib(2).

Breakpoint 1, fib (n=1) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) print n
$7 = 1
(gdb) c
Continuing.
Processing fib(1)... Return 1!

Breakpoint 1, fib (n=2) at listing5.10.c:24
24       std::cout << "Processing fib(" << n << ")... ";
(gdb) print n
$8 = 2
(gdb) c
Continuing.
Processing fib(2)... Return 1!
5 is the 5th Fibonacci number
[Inferior 1 (process 19913) exited normally]

Wednesday, February 6, 2019

Boundary Condition and Solver Study for OpenFoam

Interesting Source to Reference:
1Lecture 5 - Solution MethodsApplied Computational Fluid Dynamics ,
Instructor: André Bakker
http://www.bakker.org/dartmouth06/engs150/05-solv.pdf

From the OpenFoam user manual:

rhoSimpleFoam Steady-state solver for turbulent flow of compressible fluids.

rhoPimpleFoam of compressible fluids for HVAC and similar applications, with optional
mesh motion and mesh topology changes.

potentialFoam Potential flow solver which solves for the velocity potential, to calculate the
flux-field, from which the velocity field is obtained by reconstructing the flux.

simpleFoam Steady-state solver for incompressible, turbulent flow, using the SIMPLE algo-
rithm.

pisoFoam Transient solver for incompressible, turbulent flow, using the PISO algorithm.

icoFoam Transient solver for incompressible, laminar flow of Newtonian fluids.


===================================================



5.2.3.2
Entrainment boundary conditions
The combination of the totalPressure condition on pressure and pressureInletOutletVelocity
on velocity is extremely common for patches where some inflow occurs and the inlet flow
velocity is not known. That includes the atmosphere boundary in the damBreak tutorial,
inlet conditions where only pressure is known, outlets where flow reversal may occur, and
where flow in entrained, e.g. on boundaries surrounding a jet through a nozzle.
The totalPressure condition specifies
(
p 0
for outflow
p =
(5.2)
p 0 − 12 |U 2 | for inflow (incompressible, subsonic)
where the user specifies p 0 through the p0 keyword. The pressureInletOutletVelocity condition
specifies zeroGradient at all times, except on the tangential component which is set to fixed-
Value for inflow, with the tangentialVelocity defaulting to 0.

Source: http://foam.sourceforge.net/docs/Guides-a4/OpenFOAMUserGuide-A4.pdf

Compare to:
https://www.afs.enea.it/project/neptunius/docs/fluent/html/ug/node244.htm

=================================================

 https://www.openfoam.com/documentation/user-guide/standard-boundaryconditions.php
pressureDirectedInletOutletVelocity
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is specified. A zero-gradient condtion is applied for outflow (as defined by the flux); for inflow, the velocity is obtained from the flux with the specified inlet direction
pressureDirectedInletVelocity
This velocity inlet boundary condition is applied to patches where the pressure is specified. The inflow velocity is obtained from the flux with the specified inlet direction” direction
pressureInletOutletParSlipVelocity
This velocity inlet/outlet boundary condition for pressure boundary where the pressure is specified. A zero-gradient is applied for outflow (as defined by the flux); for inflow, the velocity is obtained from the flux with the specified inlet direction
pressureInletOutletVelocity
This velocity inlet/outlet boundary condition is applied to pressure boundaries where the pressure is specified. A zero-gradient condition is applied for outflow (as defined by the flux); for inflow, the velocity is obtained from the patch-face normal component of the internal-cell value
pressureInletUniformVelocity
This velocity inlet boundary condition is applied to patches where the pressure is specified. The uniform inflow velocity is obtained by averaging the flux over the patch, and then applying it in the direction normal to the patch faces
pressureInletVelocity
This velocity inlet boundary condition is applied to patches where the pressure is specified. The inflow velocity is obtained from the flux with a direction normal to the patch faces
pressureNormalInletOutletVelocity
This velocity inlet/outlet boundary condition is applied to patches where the pressure is specified. A zero-gradient condition is applied for outflow (as defined by the flux); for inflow, the velocity is obtained from the flux with a direction normal to the patch faces
pressurePIDControlInletVelocity
This boundary condition tries to generate an inlet velocity that maintains a specified pressure drop between two face zones downstream. The zones should fully span a duct through which all the inlet flow passes


https://cfd.direct/openfoam/user-guide/v6-turbulence/

Thursday, January 31, 2019

Sunday, January 27, 2019

Ogive Curve -- Tangent ogive












Points

https://gist.github.com/bshambaugh/317a4839bdf8c2ac317438cb95ce6197

https://en.wikipedia.org/wiki/Nose_cone_design

Saturday, January 26, 2019

What is the characteristic length?

https://www.quora.com/What-is-the-characteristic-length-in-fluid-mechanics

Friday, January 25, 2019

Calculix, FEA, et al.

https://www.youtube.com/watch?v=wAJe1R5NDGw

FreeCAD FEM/Civil/Structural/Arch Tutorial-1-An Introduction
https://www.youtube.com/watch?v=OVd5j71cdXM

CalculiX Launcher 3beta - Bolted Connection ( non standard) with contact and bolt preload

https://www.youtube.com/watch?v=VA0eg0LWfWM

CalculiX is a different program than Code Aster

https://www.youtube.com/watch?v=7p5mQuJIZdI  (simulation of a beam with Code Aster)

https://www.youtube.com/watch?v=rOjhvq_TnpY

https://www.youtube.com/watch?v=9Ztbq4gLf0w

Thursday, January 24, 2019

pisoFoam

https://www.openfoam.com/documentation/user-guide/fvSolution.php

Residual Control

Wednesday, January 23, 2019

Is this solver really producing a steady state solution, is it showing variance with time???

Solution Modes in Autodesk CFD: Steady State vs Transient

https://www.youtube.com/watch?v=PVUFmYOyGkA 

Takeaways:
 -- Use Transient solver for things occurring over a time scale.
-- A steady state solution should look the same at different screenshots of the simulation.

Questions:
-- How do I calculate characteristic lengths?

"Transient Parameters :
Time Step Size:
-- Must be small enough to resolve flow and heat transfer detail
1/20th the time to required for the particle of fluid to traverse the characteristic length
-- 3 degrees rotation."
http://www.youtube.com/watch?v=PVUFmYOyGkA&t=15m48s

Also takeaway: The characteristic length is probably the width of the channel "b" that the air is exiting from.

If the residuals do not vary with time length, then this is a good sign of a steady state?

Also for a timescale consider the CFL number.
https://www.simscale.com/blog/2017/08/cfl-condition/
https://en.wikipedia.org/wiki/Courant%E2%80%93Friedrichs%E2%80%93Lewy_condition


 "You need a time step that is small enough to no affect your solution, but no finer"
http://www.youtube.com/watch?v=PVUFmYOyGkA&t=17m18s

"Allow the solution to converge at each time step"

OpenFOAM v6 User Guide: 4.3 Time and data input/output control
https://cfd.direct/openfoam/user-guide/v6-controldict/

https://www.openfoam.com/documentation/user-guide/standard-boundaryconditions.php

Standard solvers in OpenFoam:
https://www.openfoam.com/documentation/user-guide/standard-solvers.php

"
Time = 29.8

smoothSolver:  Solving for Ux, Initial residual = 0.017473, Final residual = 1.15283e-06, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.00734311, Final residual = 2.32227e-07, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 0.00668358, Final residual = 2.10882e-07, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.00352915, Final residual = 9.89991e-07, No Iterations 10
time step continuity errors : sum local = 2.90912e-08, global = -4.95109e-10, cumulative = 1.09353e-06
smoothSolver:  Solving for epsilon, Initial residual = 3.88718e-06, Final residual = 3.88718e-06, No Iterations 0
smoothSolver:  Solving for k, Initial residual = 1.34953e-07, Final residual = 1.34953e-07, No Iterations 0
ExecutionTime = 8.87 s  ClockTime = 9 s

Time = 29.85

smoothSolver:  Solving for Ux, Initial residual = 0.0178206, Final residual = 1.18761e-06, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.00734977, Final residual = 2.29515e-07, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 0.0066527, Final residual = 2.1099e-07, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.00487037, Final residual = 6.93437e-07, No Iterations 11
time step continuity errors : sum local = 1.41454e-08, global = -4.01892e-11, cumulative = 1.09349e-06
smoothSolver:  Solving for epsilon, Initial residual = 3.88704e-06, Final residual = 3.88704e-06, No Iterations 0
smoothSolver:  Solving for k, Initial residual = 1.34358e-07, Final residual = 1.34358e-07, No Iterations 0
ExecutionTime = 8.88 s  ClockTime = 9 s

Time = 29.9

smoothSolver:  Solving for Ux, Initial residual = 0.0171088, Final residual = 1.27743e-06, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.00736379, Final residual = 2.29103e-07, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 0.00658612, Final residual = 2.10184e-07, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.00551106, Final residual = 8.0959e-07, No Iterations 15
time step continuity errors : sum local = 1.49522e-08, global = -1.07481e-10, cumulative = 1.09338e-06
smoothSolver:  Solving for epsilon, Initial residual = 3.88686e-06, Final residual = 3.88686e-06, No Iterations 0
smoothSolver:  Solving for k, Initial residual = 1.33787e-07, Final residual = 1.33787e-07, No Iterations 0
ExecutionTime = 8.89 s  ClockTime = 9 s

Time = 29.95

smoothSolver:  Solving for Ux, Initial residual = 0.0172835, Final residual = 1.37212e-06, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.00735385, Final residual = 2.29564e-07, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 0.00652096, Final residual = 2.10925e-07, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.00581243, Final residual = 9.67356e-07, No Iterations 19
time step continuity errors : sum local = 1.71268e-08, global = 1.81731e-10, cumulative = 1.09356e-06
smoothSolver:  Solving for epsilon, Initial residual = 3.88666e-06, Final residual = 3.88666e-06, No Iterations 0
smoothSolver:  Solving for k, Initial residual = 1.33208e-07, Final residual = 1.33208e-07, No Iterations 0
ExecutionTime = 8.91 s  ClockTime = 9 s

Time = 30

smoothSolver:  Solving for Ux, Initial residual = 0.0172485, Final residual = 1.43144e-06, No Iterations 2
smoothSolver:  Solving for Uy, Initial residual = 0.00733651, Final residual = 2.31141e-07, No Iterations 2
smoothSolver:  Solving for Uz, Initial residual = 0.00645853, Final residual = 2.11267e-07, No Iterations 2
GAMG:  Solving for p, Initial residual = 0.00658114, Final residual = 7.78764e-07, No Iterations 21
time step continuity errors : sum local = 1.3355e-08, global = -9.46949e-10, cumulative = 1.09262e-06
smoothSolver:  Solving for epsilon, Initial residual = 3.88643e-06, Final residual = 3.88643e-06, No Iterations 0
smoothSolver:  Solving for k, Initial residual = 1.32581e-07, Final residual = 1.32581e-07, No Iterations 0
ExecutionTime = 8.93 s  ClockTime = 9 s

End
"
perhaps this relates, time Execution Time, and ClockTime. time is shown in Paraview. Using a timer tells me that the ClockTime is close to the time the simulation is running
https://stackoverflow.com/questions/7335920/what-specifically-are-wall-clock-time-user-cpu-time-and-system-cpu-time-in-uni

Compare this:

To the PitzDaily Case:







Thursday, January 10, 2019

CIrcuits

Circuit Simulation: A Quick Look At QUCS
https://www.youtube.com/watch?v=T4-Sf9rYgCg


QUCS Tutorial Ep. 1: Basic Use (DC, AC, and Transient simulations)

How to Solder properly || Through-hole (THT) & Surface-mount (SMD) -Great Scott!
https://www.youtube.com/watch?v=VxMV6wGS3NY


Tuesday, January 1, 2019

Converged???

/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-06;
        relTol          1e-06;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps     2;
        cacheAgglomeration on;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 10;
        mergeLevels     1;
    }

    "(U|k|epsilon|omega|R)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-06;
        relTol          1e-6;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
}

relaxationFactors
{
   fields
   {
         p           0.6;
   }

    equations
    {
        U               0.4;
        k               0.4;
        epsilon         0.4;
        omega           0.4;
        R               0.4;
    }
}

potentialFlow
{
    nNonOrthogonalCorrectors 10;
}

// ************************************************************************* //


Working on Convergence


/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.1                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      fvSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

solvers
{
    p
    {
        solver          GAMG;
        tolerance       1e-06;
        relTol          1e-06;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps     2;
        cacheAgglomeration on;
        agglomerator    faceAreaPair;
        nCellsInCoarsestLevel 10;
        mergeLevels     1;
    }

    "(U|k|epsilon|omega|R)"
    {
        solver          smoothSolver;
        smoother        symGaussSeidel;
        tolerance       1e-06;
        relTol          1e-6;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
}

relaxationFactors
{
   fields
   {
         p           0.65;
   }

    equations
    {
        U               0.35;
        k               0.35;
        epsilon         0.35;
        omega           0.35;
        R               0.35;
    }
}

potentialFlow
{
    nNonOrthogonalCorrectors 10;
}

==================

This error still exists::

https://www.cfd-online.com/Forums/main/211208-specifying-initial-conditions-cyclic-boundary-conditions.html