diff --git a/olaflow/config.ini b/olaflow/config.ini index ca55a21..e00b97d 100644 --- a/olaflow/config.ini +++ b/olaflow/config.ini @@ -1,11 +1,17 @@ [swash] -np_out=../swash/inp_post +np_out=../swash/inp_post/real_spec_interp [bathy] bathy=../data/out_of/bathy.dat hstru=../data/out_of/hstru.dat scale=[0.5,1,1] out=out_bathy +level=4.5 [olaflow] -root=inp_of +path=/opt/OpenFOAM/OpenFOAM-9/bin:/opt/OpenFOAM/OpenFOAM-9/platforms/linux64GccDPInt32Opt/bin +root=of +out=out_of +t0 = 13900 +tf = 14100 +x0 = -150 diff --git a/olaflow/of/constant/waveDict b/olaflow/of/constant/waveDict new file mode 100644 index 0000000..0526843 --- /dev/null +++ b/olaflow/of/constant/waveDict @@ -0,0 +1,2449 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.3 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object waveDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +waveType wavemaker; + +waveTheory tveta; + +genAbs 1; + +absDir 0.0; + +nPaddles 1; + +timeSeries +802 +( +0.0 +0.25499999999919964 +0.4959999999991851 +0.75 +1.0049999999991996 +1.245999999999185 +1.5 +1.7549999999991996 +1.995999999999185 +2.25 +2.5049999999991996 +2.745999999999185 +3.0 +3.2549999999991996 +3.495999999999185 +3.75 +4.0049999999992 +4.245999999999185 +4.5 +4.7549999999992 +4.995999999999185 +5.25 +5.5049999999992 +5.745999999999185 +6.0 +6.2549999999992 +6.495999999999185 +6.75 +7.0049999999992 +7.245999999999185 +7.5 +7.7549999999992 +7.995999999999185 +8.25 +8.5049999999992 +8.745999999999185 +9.0 +9.2549999999992 +9.495999999999185 +9.75 +10.0049999999992 +10.245999999999185 +10.5 +10.7549999999992 +10.995999999999185 +11.25 +11.5049999999992 +11.745999999999185 +12.0 +12.2549999999992 +12.495999999999185 +12.75 +13.0049999999992 +13.245999999999185 +13.5 +13.7549999999992 +13.995999999999185 +14.25 +14.5049999999992 +14.745999999999185 +15.0 +15.2549999999992 +15.495999999999185 +15.75 +16.0049999999992 +16.245999999999185 +16.5 +16.7549999999992 +16.995999999999185 +17.25 +17.5049999999992 +17.745999999999185 +18.0 +18.2549999999992 +18.495999999999185 +18.75 +19.0049999999992 +19.245999999999185 +19.5 +19.7549999999992 +19.995999999999185 +20.25 +20.5049999999992 +20.745999999999185 +21.0 +21.2549999999992 +21.495999999999185 +21.75 +22.0049999999992 +22.245999999999185 +22.5 +22.7549999999992 +22.995999999999185 +23.25 +23.5049999999992 +23.745999999999185 +24.0 +24.2549999999992 +24.495999999999185 +24.75 +25.0049999999992 +25.245999999999185 +25.5 +25.7549999999992 +25.995999999999185 +26.25 +26.5049999999992 +26.745999999999185 +27.0 +27.2549999999992 +27.495999999999185 +27.75 +28.0049999999992 +28.245999999999185 +28.5 +28.7549999999992 +28.995999999999185 +29.25 +29.5049999999992 +29.745999999999185 +30.0 +30.2549999999992 +30.495999999999185 +30.75 +31.0049999999992 +31.245999999999185 +31.5 +31.7549999999992 +31.995999999999185 +32.25 +32.5049999999992 +32.745999999999185 +33.0 +33.2549999999992 +33.495999999999185 +33.75 +34.0049999999992 +34.245999999999185 +34.5 +34.7549999999992 +34.995999999999185 +35.25 +35.5049999999992 +35.745999999999185 +36.0 +36.2549999999992 +36.495999999999185 +36.75 +37.0049999999992 +37.245999999999185 +37.5 +37.7549999999992 +37.995999999999185 +38.25 +38.5049999999992 +38.745999999999185 +39.0 +39.2549999999992 +39.495999999999185 +39.75 +40.0049999999992 +40.245999999999185 +40.5 +40.7549999999992 +40.995999999999185 +41.25 +41.5049999999992 +41.745999999999185 +42.0 +42.2549999999992 +42.495999999999185 +42.75 +43.0049999999992 +43.245999999999185 +43.5 +43.7549999999992 +43.995999999999185 +44.25 +44.5049999999992 +44.745999999999185 +45.0 +45.2549999999992 +45.495999999999185 +45.75 +46.0049999999992 +46.245999999999185 +46.5 +46.7549999999992 +46.995999999999185 +47.25 +47.5049999999992 +47.745999999999185 +48.0 +48.2549999999992 +48.495999999999185 +48.75 +49.0049999999992 +49.245999999999185 +49.5 +49.7549999999992 +49.995999999999185 +50.25 +50.5049999999992 +50.745999999999185 +51.0 +51.2549999999992 +51.495999999999185 +51.75 +52.0049999999992 +52.245999999999185 +52.5 +52.7549999999992 +52.995999999999185 +53.25 +53.5049999999992 +53.745999999999185 +54.0 +54.2549999999992 +54.495999999999185 +54.75 +55.0049999999992 +55.245999999999185 +55.5 +55.7549999999992 +55.995999999999185 +56.25 +56.5049999999992 +56.745999999999185 +57.0 +57.2549999999992 +57.495999999999185 +57.75 +58.0049999999992 +58.245999999999185 +58.5 +58.7549999999992 +58.995999999999185 +59.25 +59.5049999999992 +59.745999999999185 +60.0 +60.2549999999992 +60.495999999999185 +60.75 +61.0049999999992 +61.245999999999185 +61.5 +61.7549999999992 +61.995999999999185 +62.25 +62.5049999999992 +62.745999999999185 +63.0 +63.2549999999992 +63.495999999999185 +63.75 +64.0049999999992 +64.24599999999919 +64.5 +64.7549999999992 +64.99599999999919 +65.25 +65.5049999999992 +65.74599999999919 +66.0 +66.2549999999992 +66.49599999999919 +66.75 +67.0049999999992 +67.24599999999919 +67.5 +67.7549999999992 +67.99599999999919 +68.25 +68.5049999999992 +68.74599999999919 +69.0 +69.2549999999992 +69.49599999999919 +69.75 +70.0049999999992 +70.24599999999919 +70.5 +70.7549999999992 +70.99599999999919 +71.25 +71.5049999999992 +71.74599999999919 +72.0 +72.2549999999992 +72.49599999999919 +72.75 +73.0049999999992 +73.24599999999919 +73.5 +73.7549999999992 +73.99599999999919 +74.25 +74.5049999999992 +74.74599999999919 +75.0 +75.2549999999992 +75.49599999999919 +75.75 +76.0049999999992 +76.24599999999919 +76.5 +76.7549999999992 +76.99599999999919 +77.25 +77.5049999999992 +77.74599999999919 +78.0 +78.2549999999992 +78.49599999999919 +78.75 +79.0049999999992 +79.24599999999919 +79.5 +79.7549999999992 +79.99599999999919 +80.25 +80.5049999999992 +80.74599999999919 +81.0 +81.2549999999992 +81.49599999999919 +81.75 +82.0049999999992 +82.24599999999919 +82.5 +82.7549999999992 +82.99599999999919 +83.25 +83.5049999999992 +83.74599999999919 +84.0 +84.2549999999992 +84.49599999999919 +84.75 +85.0049999999992 +85.24599999999919 +85.5 +85.7549999999992 +85.99599999999919 +86.25 +86.5049999999992 +86.74599999999919 +87.0 +87.2549999999992 +87.49599999999919 +87.75 +88.0049999999992 +88.24599999999919 +88.5 +88.7549999999992 +88.99599999999919 +89.25 +89.5049999999992 +89.74599999999919 +90.0 +90.2549999999992 +90.49599999999919 +90.75 +91.0049999999992 +91.24599999999919 +91.5 +91.7549999999992 +91.99599999999919 +92.25 +92.5049999999992 +92.74599999999919 +93.0 +93.2549999999992 +93.49599999999919 +93.75 +94.0049999999992 +94.24599999999919 +94.5 +94.7549999999992 +94.99599999999919 +95.25 +95.5049999999992 +95.74599999999919 +96.0 +96.2549999999992 +96.49599999999919 +96.75 +97.0049999999992 +97.24599999999919 +97.5 +97.7549999999992 +97.99599999999919 +98.25 +98.5049999999992 +98.74599999999919 +99.0 +99.2549999999992 +99.49599999999919 +99.75 +100.0049999999992 +100.24599999999919 +100.5 +100.7549999999992 +100.99599999999919 +101.25 +101.5049999999992 +101.74599999999919 +102.0 +102.2549999999992 +102.49599999999919 +102.75 +103.0049999999992 +103.24599999999919 +103.5 +103.7549999999992 +103.99599999999919 +104.25 +104.5049999999992 +104.74599999999919 +105.0 +105.2549999999992 +105.49599999999919 +105.75 +106.0049999999992 +106.24599999999919 +106.5 +106.7549999999992 +106.99599999999919 +107.25 +107.5049999999992 +107.74599999999919 +108.0 +108.2549999999992 +108.49599999999919 +108.75 +109.0049999999992 +109.24599999999919 +109.5 +109.7549999999992 +109.99599999999919 +110.25 +110.5049999999992 +110.74599999999919 +111.0 +111.2549999999992 +111.49599999999919 +111.75 +112.0049999999992 +112.24599999999919 +112.5 +112.7549999999992 +112.99599999999919 +113.25 +113.5049999999992 +113.74599999999919 +114.0 +114.2549999999992 +114.49599999999919 +114.75 +115.0049999999992 +115.24599999999919 +115.5 +115.7549999999992 +115.99599999999919 +116.25 +116.5049999999992 +116.74599999999919 +117.0 +117.2549999999992 +117.49599999999919 +117.75 +118.0049999999992 +118.24599999999919 +118.5 +118.7549999999992 +118.99599999999919 +119.25 +119.5049999999992 +119.74599999999919 +120.0 +120.2549999999992 +120.49599999999919 +120.75 +121.0049999999992 +121.24599999999919 +121.5 +121.7549999999992 +121.99599999999919 +122.25 +122.5049999999992 +122.74599999999919 +123.0 +123.2549999999992 +123.49599999999919 +123.75 +124.0049999999992 +124.24599999999919 +124.5 +124.7549999999992 +124.99599999999919 +125.25 +125.5049999999992 +125.74599999999919 +126.0 +126.2549999999992 +126.49599999999919 +126.75 +127.0049999999992 +127.24599999999919 +127.5 +127.7549999999992 +127.99599999999919 +128.25 +128.5049999999992 +128.74599999999919 +129.0 +129.2549999999992 +129.49599999999919 +129.75 +130.0049999999992 +130.24599999999919 +130.5 +130.7549999999992 +130.99599999999919 +131.25 +131.5049999999992 +131.74599999999919 +132.0 +132.2549999999992 +132.49599999999919 +132.75 +133.0049999999992 +133.24599999999919 +133.5 +133.7549999999992 +133.99599999999919 +134.25 +134.5049999999992 +134.74599999999919 +135.0 +135.2549999999992 +135.49599999999919 +135.75 +136.0049999999992 +136.24599999999919 +136.5 +136.7549999999992 +136.99599999999919 +137.25 +137.5049999999992 +137.74599999999919 +138.0 +138.2549999999992 +138.49599999999919 +138.75 +139.0049999999992 +139.24599999999919 +139.5 +139.7549999999992 +139.99599999999919 +140.25 +140.5049999999992 +140.74599999999919 +141.0 +141.2549999999992 +141.49599999999919 +141.75 +142.0049999999992 +142.24599999999919 +142.5 +142.7549999999992 +142.99599999999919 +143.25 +143.5049999999992 +143.74599999999919 +144.0 +144.2549999999992 +144.49599999999919 +144.75 +145.0049999999992 +145.24599999999919 +145.5 +145.7549999999992 +145.99599999999919 +146.25 +146.5049999999992 +146.74599999999919 +147.0 +147.2549999999992 +147.49599999999919 +147.75 +148.0049999999992 +148.24599999999919 +148.5 +148.7549999999992 +148.99599999999919 +149.25 +149.5049999999992 +149.74599999999919 +150.0 +150.2549999999992 +150.49599999999919 +150.75 +151.0049999999992 +151.24599999999919 +151.5 +151.7549999999992 +151.99599999999919 +152.25 +152.5049999999992 +152.74599999999919 +153.0 +153.2549999999992 +153.49599999999919 +153.75 +154.0049999999992 +154.24599999999919 +154.5 +154.7549999999992 +154.99599999999919 +155.25 +155.5049999999992 +155.74599999999919 +156.0 +156.2549999999992 +156.49599999999919 +156.75 +157.0049999999992 +157.24599999999919 +157.5 +157.7549999999992 +157.99599999999919 +158.25 +158.5049999999992 +158.74599999999919 +159.0 +159.2549999999992 +159.49599999999919 +159.75 +160.0049999999992 +160.24599999999919 +160.5 +160.7549999999992 +160.99599999999919 +161.25 +161.5049999999992 +161.74599999999919 +162.0 +162.2549999999992 +162.49599999999919 +162.75 +163.0049999999992 +163.24599999999919 +163.5 +163.7549999999992 +163.99599999999919 +164.25 +164.5049999999992 +164.74599999999919 +165.0 +165.2549999999992 +165.49599999999919 +165.75 +166.0049999999992 +166.24599999999919 +166.5 +166.7549999999992 +166.99599999999919 +167.25 +167.5049999999992 +167.74599999999919 +168.0 +168.2549999999992 +168.49599999999919 +168.75 +169.0049999999992 +169.24599999999919 +169.5 +169.7549999999992 +169.99599999999919 +170.25 +170.5049999999992 +170.74599999999919 +171.0 +171.2549999999992 +171.49599999999919 +171.75 +172.0049999999992 +172.24599999999919 +172.5 +172.7549999999992 +172.99599999999919 +173.25 +173.5049999999992 +173.74599999999919 +174.0 +174.2549999999992 +174.49599999999919 +174.75 +175.0049999999992 +175.24599999999919 +175.5 +175.7549999999992 +175.99599999999919 +176.25 +176.5049999999992 +176.74599999999919 +177.0 +177.2549999999992 +177.49599999999919 +177.75 +178.0049999999992 +178.24599999999919 +178.5 +178.7549999999992 +178.99599999999919 +179.25 +179.5049999999992 +179.74599999999919 +180.0 +180.2549999999992 +180.49599999999919 +180.75 +181.0049999999992 +181.24599999999919 +181.5 +181.7549999999992 +181.99599999999919 +182.25 +182.5049999999992 +182.74599999999919 +183.0 +183.2549999999992 +183.49599999999919 +183.75 +184.0049999999992 +184.24599999999919 +184.5 +184.7549999999992 +184.99599999999919 +185.25 +185.5049999999992 +185.74599999999919 +186.0 +186.2549999999992 +186.49599999999919 +186.75 +187.0049999999992 +187.24599999999919 +187.5 +187.7549999999992 +187.99599999999919 +188.25 +188.5049999999992 +188.74599999999919 +189.0 +189.2549999999992 +189.49599999999919 +189.75 +190.0049999999992 +190.24599999999919 +190.5 +190.7549999999992 +190.99599999999919 +191.25 +191.5049999999992 +191.74599999999919 +192.0 +192.2549999999992 +192.49599999999919 +192.75 +193.0049999999992 +193.24599999999919 +193.5 +193.7549999999992 +193.99599999999919 +194.25 +194.5049999999992 +194.74599999999919 +195.0 +195.2549999999992 +195.49599999999919 +195.75 +196.0049999999992 +196.24599999999919 +196.5 +196.7549999999992 +196.99599999999919 +197.25 +197.5049999999992 +197.74599999999919 +198.0 +198.2549999999992 +198.49599999999919 +198.75 +199.0049999999992 +199.24599999999919 +199.5 +199.7549999999992 +199.99599999999919 +200.25 +); + +paddleVelocity +802 +( +-0.9322925 +-1.0766824 +-1.2049251 +-1.3263367 +-1.4262202 +-1.493435 +-1.5265559 +-1.5070274 +-1.4278208 +-1.2699289 +-1.0374863 +-0.76266 +-0.42969653 +-0.07286313 +0.2712851 +0.6344259 +0.9840938 +1.2901301 +1.5768057 +1.8057141 +1.9487743 +2.0038054 +1.9471716 +1.795519 +1.5480808 +1.2373455 +0.90972376 +0.54465085 +0.17999941 +-0.1478299 +-0.4654706 +-0.7403796 +-0.9535176 +-1.1279303 +-1.2490191 +-1.316101 +-1.3414695 +-1.3246491 +-1.2760204 +-1.1952949 +-1.0910064 +-0.97510004 +-0.8370472 +-0.68735534 +-0.5398836 +-0.38148707 +-0.22842136 +-0.09595227 +0.024659503 +0.1174274 +0.1745677 +0.19950588 +0.18684366 +0.141535 +0.060772937 +-0.04943848 +-0.17530073 +-0.3263215 +-0.4874505 +-0.63991505 +-0.7926803 +-0.92491037 +-1.0213553 +-1.0864186 +-1.1083643 +-1.0886788 +-1.0266254 +-0.9263742 +-0.80269456 +-0.6476512 +-0.4766118 +-0.3080257 +-0.1269757 +0.05218976 +0.21710245 +0.3869772 +0.5498317 +0.69419324 +0.8341063 +0.95441645 +1.0434958 +1.1058904 +1.1301215 +1.1157904 +1.0638713 +0.98014367 +0.88083565 +0.7635421 +0.64367765 +0.5356481 +0.43187395 +0.34458378 +0.28186688 +0.2405084 +0.22956559 +0.24977252 +0.30404228 +0.38916668 +0.49179778 +0.61629456 +0.7467098 +0.8656478 +0.979057 +1.0713327 +1.1331925 +1.1679945 +1.1679239 +1.1346087 +1.0640955 +0.95874244 +0.83017 +0.665923 +0.47786176 +0.28399304 +0.065562665 +-0.1603058 +-0.3755408 +-0.6039581 +-0.8304316 +-1.0413302 +-1.2627785 +-1.4805006 +-1.6792957 +-1.8789322 +-2.0588257 +-2.2018743 +-2.3179436 +-2.3921998 +-2.4241748 +-2.4235637 +-2.3972268 +-2.3587718 +-2.3123364 +-2.2637703 +-2.2161348 +-2.1592839 +-2.0895114 +-2.0074856 +-1.9003754 +-1.7731019 +-1.6352036 +-1.4687047 +-1.2770302 +-1.0682131 +-0.81184334 +-0.52012634 +-0.21850324 +0.121173255 +0.46893364 +0.7922746 +1.1196004 +1.4179195 +1.6618801 +1.8730285 +2.0284038 +2.1211653 +2.1634345 +2.1506119 +2.0918393 +1.9841537 +1.8351711 +1.6634434 +1.4558252 +1.2325164 +1.0181199 +0.7964439 +0.590519 +0.4175865 +0.26007846 +0.1309687 +0.034824066 +-0.042017374 +-0.09457998 +-0.12300598 +-0.13139956 +-0.11800654 +-0.08654529 +-0.035305306 +0.030714318 +0.102349326 +0.18383577 +0.2659448 +0.33986455 +0.41160297 +0.4739693 +0.5231012 +0.5652293 +0.5982514 +0.62312776 +0.6456929 +0.6672799 +0.6890026 +0.71513957 +0.7447611 +0.774833 +0.80664563 +0.83466876 +0.85300404 +0.8585225 +0.8437134 +0.8062753 +0.73696744 +0.63433117 +0.5068771 +0.34096205 +0.14867644 +-0.049461316 +-0.2693364 +-0.48910624 +-0.6873538 +-0.8816844 +-1.0532973 +-1.1900866 +-1.3060889 +-1.3897406 +-1.43829 +-1.4582014 +-1.4461653 +-1.4058247 +-1.3320981 +-1.2273448 +-1.1029841 +-0.9486575 +-0.77869284 +-0.6118236 +-0.43491593 +-0.2657362 +-0.11952983 +0.016487632 +0.1279705 +0.20728722 +0.26241282 +0.28726438 +0.2842513 +0.2560923 +0.20683867 +0.1463833 +0.07318806 +-0.0030133147 +-0.07216042 +-0.13786379 +-0.19123878 +-0.22719175 +-0.24819192 +-0.2506585 +-0.23654358 +-0.2053028 +-0.1593283 +-0.10455997 +-0.036647763 +0.038295474 +0.111898035 +0.18885206 +0.25922108 +0.31432953 +0.35619003 +0.37710288 +0.3758081 +0.35225564 +0.30772874 +0.24984935 +0.175847 +0.09436753 +0.016571637 +-0.060510438 +-0.124836385 +-0.16702679 +-0.18666112 +-0.1767772 +-0.14005755 +-0.074380495 +0.013778596 +0.111603834 +0.22493088 +0.3412137 +0.4484995 +0.55516887 +0.64979935 +0.7240806 +0.78377795 +0.8207574 +0.833197 +0.8224852 +0.7886255 +0.7385341 +0.6701507 +0.59096813 +0.5106165 +0.42227423 +0.3326862 +0.24750125 +0.15508732 +0.05890817 +-0.036969088 +-0.14624062 +-0.26436687 +-0.38341466 +-0.51698536 +-0.6542573 +-0.78216815 +-0.9101596 +-1.0223893 +-1.1069827 +-1.1692162 +-1.2004552 +-1.2021118 +-1.1773157 +-1.1289638 +-1.0649127 +-0.9784427 +-0.87192374 +-0.75041366 +-0.5946125 +-0.40792185 +-0.20379624 +0.038721904 +0.2980968 +0.5459666 +0.80002105 +1.0313416 +1.2176065 +1.372571 +1.4761003 +1.5231584 +1.5199429 +1.4654096 +1.3722159 +1.2350111 +1.065411 +0.8833016 +0.6746469 +0.46061268 +0.2645959 +0.072732106 +-0.09354833 +-0.22266082 +-0.33137462 +-0.41593778 +-0.48000577 +-0.5385005 +-0.59204406 +-0.64026105 +-0.68867815 +-0.73131716 +-0.76203895 +-0.7805459 +-0.78200406 +-0.7677473 +-0.7378619 +-0.6964148 +-0.65019876 +-0.5968829 +-0.5419968 +-0.49126735 +-0.44066855 +-0.39581054 +-0.36093578 +-0.3337462 +-0.318384 +-0.31555775 +-0.32488626 +-0.34569034 +-0.37338027 +-0.407689 +-0.44249767 +-0.47151953 +-0.4950359 +-0.50958604 +-0.5159836 +-0.51796776 +-0.51894045 +-0.5223478 +-0.5304093 +-0.5428767 +-0.5561151 +-0.5673678 +-0.5707325 +-0.5633213 +-0.54388034 +-0.5155112 +-0.48565695 +-0.45638335 +-0.43439153 +-0.42281 +-0.42052132 +-0.42685947 +-0.43752387 +-0.44914976 +-0.45554483 +-0.45188588 +-0.43459424 +-0.4029606 +-0.3618422 +-0.30942795 +-0.25126302 +-0.19307478 +-0.12686877 +-0.05332006 +0.026299767 +0.12594081 +0.24383958 +0.37181914 +0.52368855 +0.6875673 +0.8476441 +1.0179572 +1.1822082 +1.3254228 +1.4591757 +1.5674361 +1.6403229 +1.6815752 +1.6812993 +1.6410058 +1.5559891 +1.4310381 +1.2831787 +1.1031193 +0.91026556 +0.7268253 +0.53861713 +0.3634442 +0.21312265 +0.06892754 +-0.06074968 +-0.17098872 +-0.2761249 +-0.36791524 +-0.4401936 +-0.49989563 +-0.541028 +-0.5639949 +-0.57512146 +-0.57783633 +-0.5780028 +-0.580652 +-0.5895188 +-0.60509926 +-0.6288014 +-0.6570199 +-0.6834322 +-0.7060437 +-0.7183243 +-0.7179369 +-0.70447206 +-0.67846787 +-0.6434896 +-0.59491915 +-0.53283954 +-0.45975885 +-0.36432284 +-0.24981418 +-0.12591712 +0.0194332 +0.17388368 +0.32224986 +0.47728038 +0.62383693 +0.7492513 +0.8648719 +0.9588531 +1.0253654 +1.071554 +1.0924953 +1.0900316 +1.0655673 +1.0207804 +0.96214855 +0.88440365 +0.7925659 +0.6947141 +0.5799581 +0.45547178 +0.33091447 +0.1927185 +0.05112449 +-0.08229533 +-0.22055636 +-0.35111532 +-0.46332288 +-0.5680306 +-0.65564746 +-0.72155976 +-0.77362233 +-0.80666995 +-0.8194849 +-0.8122867 +-0.78250974 +-0.7339098 +-0.66227674 +-0.5739105 +-0.48027098 +-0.37541357 +-0.27091247 +-0.17777123 +-0.088782966 +-0.0137740495 +0.041593898 +0.082558095 +0.10440123 +0.107608594 +0.09324149 +0.061620656 +0.017168168 +-0.04445454 +-0.1195048 +-0.20075853 +-0.29607755 +-0.3976208 +-0.4955847 +-0.5985523 +-0.6967107 +-0.78192574 +-0.86276895 +-0.93246603 +-0.98738146 +-1.0339566 +-1.067523 +-1.085709 +-1.0884717 +-1.0714636 +-1.0352482 +-0.9739313 +-0.88899785 +-0.7888972 +-0.66429615 +-0.5258576 +-0.38866067 +-0.24229294 +-0.10216658 +0.018537024 +0.13050425 +0.22304864 +0.2917624 +0.34621742 +0.38382694 +0.4066231 +0.42075425 +0.42786887 +0.43087146 +0.4323267 +0.43341047 +0.43451187 +0.43562755 +0.43624368 +0.4361078 +0.4354988 +0.43566224 +0.43868017 +0.4484041 +0.4694796 +0.5046378 +0.5636234 +0.64970845 +0.7577589 +0.900688 +1.0674615 +1.2378837 +1.4201039 +1.5878501 +1.7175525 +1.8118932 +1.8521944 +1.8380712 +1.7717022 +1.6595021 +1.5194331 +1.341805 +1.1409985 +0.93607444 +0.7062805 +0.469283 +0.24500996 +0.011984105 +-0.20819849 +-0.39699727 +-0.57208997 +-0.7170288 +-0.82494694 +-0.91073227 +-0.9698264 +-1.0043969 +-1.0220321 +-1.021711 +-1.0065308 +-0.97525465 +-0.9296359 +-0.8755528 +-0.8096345 +-0.7398667 +-0.6759433 +-0.61557126 +-0.56814384 +-0.538868 +-0.52633965 +-0.53343153 +-0.55709153 +-0.59760755 +-0.6498787 +-0.70528746 +-0.76585245 +-0.8237951 +-0.87288094 +-0.9168542 +-0.9499697 +-0.96823454 +-0.9694375 +-0.9463717 +-0.8979862 +-0.81560314 +-0.70167446 +-0.5685041 +-0.40395978 +-0.22045222 +-0.034344055 +0.1737162 +0.3880122 +0.5904653 +0.80006903 +0.9968716 +1.1640792 +1.3169574 +1.4400567 +1.5263225 +1.585692 +1.6120363 +1.607667 +1.5738207 +1.512286 +1.4317616 +1.3253806 +1.2016531 +1.0735791 +0.9297451 +0.78237027 +0.64395773 +0.50022036 +0.3622339 +0.23905733 +0.11609882 +0.0013820429 +-0.099596865 +-0.20051879 +-0.2962093 +-0.38265452 +-0.47161722 +-0.55816144 +-0.6374715 +-0.71914035 +-0.79758924 +-0.86803705 +-0.93918276 +-1.0069729 +-1.0686828 +-1.1334199 +-1.1987958 +-1.2620775 +-1.3320174 +-1.4052855 +-1.4773089 +-1.5566785 +-1.637253 +-1.7111322 +-1.7820666 +-1.8372624 +-1.8665382 +-1.8659171 +-1.8293499 +-1.7648331 +-1.6727619 +-1.5669363 +-1.4625682 +-1.3503859 +-1.2362665 +-1.1237957 +-0.9946344 +-0.85280526 +-0.70827174 +-0.5469254 +-0.38389498 +-0.2350823 +-0.0874485 +0.045531098 +0.15555559 +0.2565407 +0.34327105 +0.4155671 +0.48826826 +0.5642834 +0.6464018 +0.75219816 +0.8822544 +1.028218 +1.2058781 +1.4005698 +1.5908983 +1.7891583 +1.9698049 +2.1113036 +2.2206855 +2.282391 +2.2978632 +2.2749064 +2.218957 +2.1421223 +2.0395002 +1.9185425 +1.7905306 +1.6420239 +1.4837326 +1.3293115 +1.1637971 +1.0014614 +0.85539836 +0.71011156 +0.576102 +0.45953724 +0.34345695 +0.23179133 +0.12703021 +0.012158084 +-0.10981096 +-0.2333552 +-0.37507206 +-0.5272199 +-0.6783216 +-0.8443488 +-1.012272 +-1.1685466 +-1.3296473 +-1.4839226 +-1.622758 +-1.764465 +-1.901323 +-2.026172 +-2.1542087 +-2.2761488 +-2.3835995 +-2.487684 +-2.5797305 +-2.6547818 +-2.722932 +-2.780224 +-2.8235483 +-2.8534477 +-2.8564205 +-2.8224618 +-2.73689 +-2.5961938 +-2.4161975 +-2.1806202 +-1.9057155 +-1.6160752 +-1.2807536 +-0.92259526 +-0.5693168 +-0.18037842 +0.22049932 +0.6073135 +1.0256177 +1.4447762 +1.8279008 +2.2014298 +2.5092196 +2.7045736 +2.7791567 +2.7049356 +2.5149078 +2.2224433 +1.876225 +1.5290246 +1.1573976 +0.7966097 +0.47543398 +0.16005914 +-0.12441191 +-0.36173415 +-0.5808948 +-0.76687455 +-0.9133604 +-1.0413615 +-1.1438849 +-1.219394 +-1.278838 +-1.3174117 +-1.3347538 +-1.333547 +-1.314006 +-1.2819357 +-1.2379049 +-1.1888838 +-1.1426867 +-1.0974667 +-1.0590719 +-1.0306821 +-1.0094228 +-0.99746233 +-0.99467206 +-1.00061 +-1.0160024 +-1.0394949 +-1.0742954 +); + +paddleEta +802 +( +-0.68505776 +-0.52828526 +-0.34979725 +-0.11640027 +0.1713216 +0.49441692 +0.8844389 +1.298514 +1.6784344 +2.0414119 +2.354151 +2.6207347 +2.906333 +3.2200174 +3.5493464 +3.9279537 +4.3132014 +4.649452 +4.9340763 +5.089094 +5.062704 +4.804989 +4.301434 +3.6450887 +2.8375876 +2.006602 +1.2631481 +0.54804957 +-0.07932062 +-0.5930307 +-1.0666587 +-1.4745464 +-1.8027508 +-2.094221 +-2.3288753 +-2.5013149 +-2.6380076 +-2.7312183 +-2.7816403 +-2.7968314 +-2.7745423 +-2.7239342 +-2.6474938 +-2.56006 +-2.4801269 +-2.4096973 +-2.3634012 +-2.346583 +-2.3580818 +-2.3968396 +-2.452182 +-2.521295 +-2.5881014 +-2.6354628 +-2.6549597 +-2.6295018 +-2.5551798 +-2.4170356 +-2.217369 +-1.978051 +-1.6798425 +-1.3516202 +-1.02998 +-0.6870189 +-0.34895867 +-0.03493043 +0.2985589 +0.63707644 +0.9640764 +1.323066 +1.6949612 +2.0553138 +2.4439442 +2.829142 +3.1773796 +3.5193603 +3.8198483 +4.0541973 +4.2406116 +4.3492994 +4.365651 +4.2745686 +4.055255 +3.7306824 +3.273967 +2.727419 +2.166768 +1.5615989 +0.9828471 +0.48787832 +0.032856427 +-0.33995086 +-0.6151737 +-0.83409727 +-0.990551 +-1.0955889 +-1.1782492 +-1.2447548 +-1.3013524 +-1.3606312 +-1.4220569 +-1.4833906 +-1.5534129 +-1.6293151 +-1.7065823 +-1.7945243 +-1.8866428 +-1.9737155 +-2.061669 +-2.139277 +-2.1982307 +-2.242346 +-2.2656121 +-2.26869 +-2.2539315 +-2.223579 +-2.1831088 +-2.1280966 +-2.0586543 +-1.9762242 +-1.865984 +-1.7301577 +-1.5816863 +-1.4121952 +-1.2490122 +-1.1228533 +-1.0401763 +-1.0240799 +-1.067889 +-1.158922 +-1.2655845 +-1.3509506 +-1.4023147 +-1.4015627 +-1.3567636 +-1.273166 +-1.1677637 +-1.0556089 +-0.9201553 +-0.7546408 +-0.556923 +-0.29411685 +0.017738942 +0.3414579 +0.700636 +1.066223 +1.4174598 +1.8046035 +2.2081878 +2.5941558 +2.9880548 +3.3323565 +3.5801299 +3.736908 +3.7707858 +3.691617 +3.5033283 +3.2267141 +2.9030108 +2.5040598 +2.0589285 +1.6089537 +1.1130269 +0.6168604 +0.16639127 +-0.2792101 +-0.6783826 +-1.0030539 +-1.2865293 +-1.5005997 +-1.635015 +-1.7062886 +-1.7080328 +-1.6547902 +-1.5539968 +-1.4250073 +-1.2944028 +-1.1619544 +-1.0491891 +-0.96931136 +-0.9172198 +-0.9005859 +-0.9164297 +-0.9636984 +-1.0372562 +-1.1242383 +-1.2272853 +-1.331702 +-1.4218874 +-1.4993151 +-1.5481582 +-1.5599427 +-1.5286858 +-1.4460641 +-1.3174498 +-1.1252176 +-0.87761915 +-0.5994123 +-0.26563424 +0.09358775 +0.43961573 +0.7976458 +1.1268754 +1.3943136 +1.6192052 +1.7729981 +1.8484485 +1.8556024 +1.7933187 +1.6806027 +1.5160306 +1.3185222 +1.1125857 +0.8805559 +0.64270127 +0.42226613 +0.20224479 +0.005605819 +-0.15487477 +-0.30056518 +-0.42338195 +-0.51786745 +-0.5913451 +-0.6302491 +-0.63041925 +-0.5911485 +-0.5162677 +-0.42258233 +-0.3117394 +-0.20439065 +-0.11974839 +-0.058911048 +-0.036315966 +-0.053835705 +-0.11330712 +-0.21035951 +-0.32873672 +-0.47303885 +-0.6246617 +-0.7633265 +-0.89602745 +-1.0046263 +-1.0779456 +-1.1188424 +-1.115669 +-1.067817 +-0.9656898 +-0.8099148 +-0.61673903 +-0.36857542 +-0.08689484 +0.19615567 +0.50036395 +0.7910484 +1.0368376 +1.2535102 +1.4120983 +1.5006274 +1.529009 +1.4943831 +1.4141114 +1.2927084 +1.150408 +1.0108781 +0.86745363 +0.735658 +0.6251997 +0.5241896 +0.4431427 +0.39031315 +0.3669339 +0.3858747 +0.44842875 +0.5648284 +0.7297851 +0.9215625 +1.1505487 +1.3871261 +1.5975056 +1.7872834 +1.9235418 +1.9900169 +1.987611 +1.908674 +1.7681727 +1.5563912 +1.2910938 +1.0042061 +0.67356 +0.33105004 +0.011181764 +-0.31278154 +-0.608324 +-0.8513663 +-1.0648401 +-1.227175 +-1.3314972 +-1.3925312 +-1.4080613 +-1.390163 +-1.349648 +-1.3020399 +-1.2627783 +-1.2336909 +-1.2152889 +-1.1973156 +-1.1612642 +-1.0902874 +-0.97863746 +-0.8042784 +-0.57196546 +-0.307285 +0.009232515 +0.34445882 +0.662668 +0.9953859 +1.3226013 +1.6294048 +1.9556785 +2.2753334 +2.5546827 +2.805335 +2.98471 +3.074646 +3.0859585 +3.0221686 +2.911574 +2.7608771 +2.5935984 +2.4307957 +2.2542295 +2.0679939 +1.8730736 +1.632242 +1.3485723 +1.0457655 +0.70303595 +0.36579123 +0.07922849 +-0.17120883 +-0.3547479 +-0.46506 +-0.5245087 +-0.5418732 +-0.5395143 +-0.53688586 +-0.5481483 +-0.5751082 +-0.6181493 +-0.6689553 +-0.7182244 +-0.76922894 +-0.8191129 +-0.8667823 +-0.9197197 +-0.97470784 +-1.0258697 +-1.0750732 +-1.113502 +-1.1353378 +-1.1406379 +-1.1278597 +-1.1031861 +-1.0711944 +-1.0433629 +-1.0296038 +-1.0335824 +-1.0546517 +-1.0807508 +-1.0993123 +-1.0902026 +-1.0417507 +-0.9395035 +-0.784111 +-0.5967985 +-0.3707809 +-0.13896498 +0.065170825 +0.25418952 +0.41202042 +0.5385932 +0.6605479 +0.7785584 +0.8886025 +0.99961984 +1.0917249 +1.1442778 +1.1438848 +1.0677083 +0.91962695 +0.6904646 +0.41244227 +0.13632013 +-0.13881333 +-0.3667007 +-0.5219723 +-0.6176151 +-0.6447977 +-0.616734 +-0.54251814 +-0.43509007 +-0.3120509 +-0.16263479 +0.0045760144 +0.17761429 +0.37605238 +0.58460295 +0.78272843 +0.98420334 +1.1621304 +1.2931509 +1.3771715 +1.3890874 +1.3248134 +1.1742318 +0.94698656 +0.6789118 +0.35825968 +0.02325148 +-0.2869666 +-0.5948383 +-0.8657143 +-1.0748875 +-1.2376862 +-1.3317847 +-1.3561051 +-1.3197168 +-1.2339727 +-1.1282269 +-1.0141795 +-0.9221188 +-0.8698065 +-0.8563554 +-0.8798645 +-0.9233525 +-0.9767448 +-1.0233935 +-1.0525453 +-1.0643082 +-1.0584521 +-1.0421997 +-1.0191274 +-0.991073 +-0.9539473 +-0.8896848 +-0.78370345 +-0.6337241 +-0.41556662 +-0.13966373 +0.16398555 +0.51989734 +0.89637655 +1.2593961 +1.6464124 +2.0277548 +2.374054 +2.718423 +3.026176 +3.2710505 +3.4735875 +3.6099465 +3.6754174 +3.6795468 +3.6217186 +3.5166306 +3.3599665 +3.165041 +2.95255 +2.7005138 +2.4250216 +2.1474504 +1.8372076 +1.5168028 +1.2123474 +0.8932485 +0.5858215 +0.31199813 +0.04011801 +-0.2119386 +-0.43177894 +-0.6466314 +-0.839507 +-0.99673295 +-1.1337409 +-1.2385069 +-1.3106298 +-1.3662527 +-1.4089456 +-1.4437234 +-1.4777335 +-1.5071433 +-1.5265577 +-1.53355 +-1.5229352 +-1.4957774 +-1.449805 +-1.3889288 +-1.3210163 +-1.2403493 +-1.1526986 +-1.0642574 +-0.9633071 +-0.8537917 +-0.7416538 +-0.6123316 +-0.47352493 +-0.33704114 +-0.19115153 +-0.052011233 +0.06465424 +0.16513725 +0.23536515 +0.2722857 +0.28423005 +0.27682698 +0.2625171 +0.24991354 +0.24730703 +0.2563591 +0.27642682 +0.30277056 +0.32863525 +0.35323524 +0.37239224 +0.3848083 +0.3931657 +0.39948863 +0.40722662 +0.420846 +0.44168228 +0.46692544 +0.49636096 +0.5238004 +0.5435788 +0.5544764 +0.55200124 +0.53500366 +0.49846727 +0.43941385 +0.36004007 +0.24775979 +0.10618152 +-0.05160141 +-0.23982772 +-0.43980074 +-0.6275928 +-0.81293195 +-0.96874064 +-1.0753554 +-1.1340799 +-1.127395 +-1.0560379 +-0.9084083 +-0.687214 +-0.41404718 +-0.05960806 +0.35219282 +0.77842677 +1.2488058 +1.7022834 +2.0747175 +2.372611 +2.5416536 +2.574324 +2.493751 +2.320757 +2.0981112 +1.8208076 +1.5195953 +1.2258081 +0.9109378 +0.59893095 +0.3112777 +0.014056837 +-0.27347642 +-0.5341671 +-0.79761773 +-1.0407445 +-1.2420008 +-1.4148176 +-1.5334873 +-1.5875273 +-1.578341 +-1.5014038 +-1.3713102 +-1.1794741 +-0.9428959 +-0.6901984 +-0.40199327 +-0.10619205 +0.16749783 +0.44058675 +0.6818137 +0.8672892 +1.0082645 +1.0822179 +1.0865313 +1.0224496 +0.8941346 +0.72509503 +0.5096734 +0.2770884 +0.062487233 +-0.14035115 +-0.3001086 +-0.40161496 +-0.45497733 +-0.45545542 +-0.4119828 +-0.32111758 +-0.1803287 +0.0055993665 +0.26875934 +0.6043855 +0.9841051 +1.4443226 +1.9434208 +2.4250698 +2.9209895 +3.3714137 +3.730948 +4.027973 +4.228874 +4.3298283 +4.3487787 +4.2819457 +4.1436744 +3.918999 +3.618639 +3.2740574 +2.8517435 +2.3889828 +1.9359653 +1.4570949 +0.99963564 +0.6014459 +0.22061312 +-0.11442694 +-0.39027792 +-0.6473222 +-0.87509084 +-1.0700042 +-1.2630243 +-1.4464966 +-1.6133235 +-1.7860892 +-1.9553299 +-2.1122391 +-2.277225 +-2.4407008 +-2.5921965 +-2.7475023 +-2.8913345 +-3.009463 +-3.1090147 +-3.174902 +-3.2014728 +-3.1888423 +-3.1319635 +-3.0363708 +-2.888514 +-2.6923456 +-2.4658518 +-2.1889057 +-1.8910729 +-1.6130385 +-1.3439372 +-1.1158216 +-0.934793 +-0.7560941 +-0.5619061 +-0.34394485 +-0.06665894 +0.2502443 +0.5666075 +0.8971567 +1.1989906 +1.4443147 +1.6617008 +1.8407998 +1.9825366 +2.1111104 +2.2194662 +2.3022213 +2.367981 +2.4102411 +2.430068 +2.4336195 +2.4245648 +2.410894 +2.399862 +2.404262 +2.4346623 +2.5060687 +2.6223507 +2.7656403 +2.930676 +3.0705566 +3.1388752 +3.1096683 +2.9628878 +2.7304623 +2.4139447 +2.0624452 +1.7217491 +1.3634765 +1.0130243 +0.6895912 +0.34928298 +0.00821705 +-0.3158552 +-0.66348165 +-1.0123508 +-1.3385003 +-1.6780243 +-2.0045104 +-2.293942 +-2.5760908 +-2.8261304 +-3.0278184 +-3.2033727 +-3.3376775 +-3.4267569 +-3.4838507 +-3.5061321 +-3.5002074 +-3.4716268 +-3.4269702 +-3.3759232 +-3.3159318 +-3.2501397 +-3.1794486 +-3.0894542 +-2.9796333 +-2.857058 +-2.7083287 +-2.544671 +-2.3818445 +-2.2049887 +-2.0281296 +-1.8608654 +-1.674597 +-1.466521 +-1.2406876 +-0.96992534 +-0.6868354 +-0.4391991 +-0.21838576 +-0.043360427 +0.0991993 +0.25196922 +0.42274082 +0.6075021 +0.83569705 +1.1059939 +1.4094291 +1.7947698 +2.253138 +2.754518 +3.3587763 +4.0236654 +4.677793 +5.3500366 +5.9095106 +6.217207 +6.181122 +5.734167 +5.008541 +4.0641127 +3.0776772 +2.186483 +1.3147624 +0.5314147 +-0.12576087 +-0.74437463 +-1.288971 +-1.742307 +-2.1699426 +-2.550249 +-2.8713665 +-3.178905 +-3.4566538 +-3.695719 +-3.932539 +-4.159543 +-4.370641 +-4.595446 +-4.8187814 +-5.0211773 +-5.2178183 +-5.384452 +-5.505131 +-5.5881643 +-5.6206636 +-5.603936 +-5.5368586 +-5.421232 +-5.270652 +-5.068842 +-4.825583 +-4.559137 +-4.235612 +); + +// ************************************************************************* // diff --git a/olaflow/of/constant/waveDict.org b/olaflow/of/constant/waveDict_irregular.org similarity index 100% rename from olaflow/of/constant/waveDict.org rename to olaflow/of/constant/waveDict_irregular.org diff --git a/olaflow/of/constant/waveDict_paddle.org b/olaflow/of/constant/waveDict_paddle.org new file mode 100644 index 0000000..77c14e8 --- /dev/null +++ b/olaflow/of/constant/waveDict_paddle.org @@ -0,0 +1,46 @@ +/*---------------------------------------------------------------------------*\ +| ========= | | +| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | +| \\ / O peration | Version: 1.3 | +| \\ / A nd | Web: http://www.openfoam.org | +| \\/ M anipulation | | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object waveDict; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +waveType wavemaker; + +waveTheory tveta; + +genAbs 1; + +absDir 0.0; + +nPaddles 1; + +timeSeries +{n} +( +{t} +); + +paddleVelocity +{n} +( +{v} +); + +paddleEta +{n} +( +{eta} +); + +// ************************************************************************* // diff --git a/olaflow/of/system/blockMeshDict b/olaflow/of/system/blockMeshDict index 66c2764..7ef5587 100644 --- a/olaflow/of/system/blockMeshDict +++ b/olaflow/of/system/blockMeshDict @@ -1,5 +1,4 @@ -/*--------------------------------*- C++ -*----------------------------------*\ -| ========= | | +/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 1.7.1 | | \\ / A nd | Web: www.OpenFOAM.com | @@ -48,14 +47,14 @@ boundary (0 4 7 3) ); } - outlet + /*outlet { type patch; faces ( (1 5 6 2) ); - } + }*/ wall1 { type wall; @@ -70,6 +69,7 @@ boundary faces ( (3 2 6 7) + (1 5 6 2) ); } ); diff --git a/olaflow/of/system/controlDict b/olaflow/of/system/controlDict index 8c12c73..deb00f5 100644 --- a/olaflow/of/system/controlDict +++ b/olaflow/of/system/controlDict @@ -24,7 +24,7 @@ startTime 0; stopAt endTime; -endTime 60; +endTime 200; deltaT 0.1; diff --git a/olaflow/of/system/setFieldsDict b/olaflow/of/system/setFieldsDict index 0b55e5b..b914c76 100644 --- a/olaflow/of/system/setFieldsDict +++ b/olaflow/of/system/setFieldsDict @@ -18,6 +18,7 @@ FoamFile defaultFieldValues ( volScalarFieldValue alpha.water 0 + volVectorFieldValue U (0 0 0) volScalarFieldValue porosityIndex 0 ); @@ -32,6 +33,15 @@ regions volScalarFieldValue alpha.water 1 ); } + boxToCell + { + box (-100 0 0) (-100 1 1); + + fieldValues + ( + volVectorFieldValue U (1 0 0) + ); + } surfaceToCell { file "./constant/triSurface/poro.stl"; diff --git a/olaflow/processing/run_ola.py b/olaflow/processing/run_ola.py new file mode 100644 index 0000000..a9338e6 --- /dev/null +++ b/olaflow/processing/run_ola.py @@ -0,0 +1,47 @@ +import argparse +import configparser +import logging +import os +import pathlib +import shutil +from subprocess import run, STDOUT + +parser = argparse.ArgumentParser(description="Run olaFlow model") +parser.add_argument("-v", "--verbose", action="count", default=0) +parser.add_argument("-c", "--config", default="config.ini") +args = parser.parse_args() + +logging.basicConfig(level=max((10, 20 - 10 * args.verbose))) +log = logging.getLogger("sws_ola") + +log.info("Starting olaFlow model") +config = configparser.ConfigParser() +config.read(args.config) + +root = pathlib.Path(config.get("olaflow", "root")) +out = pathlib.Path(config.get("olaflow", "out")) +logs = out.joinpath("log") + +shutil.copytree(root, out) +logs.mkdir() + +path = config.get("olaflow", "path") +env = {"PATH": f"{path}:{os.environ['PATH']}"} + +def ola_run(cmd): + with logs.joinpath(f"{cmd[0]}.log").open("wt") as logfile: + run( + cmd, + cwd=out, + env=env, + stdout=logfile, + stderr=STDOUT, + ).check_returncode() + +ola_run(("blockMesh",)) +ola_run(("snappyHexMesh", "-overwrite")) +shutil.copytree(root.joinpath("0.org"), root.joinpath("0")) +ola_run(("setFields",)) +ola_run(("decomposePar",)) +ola_run(("mpirun", "-np", "4", "olaFlow", "-parallel")) +ola_run(("reconstructPar",)) diff --git a/olaflow/processing/sws_ola.py b/olaflow/processing/sws_ola.py index 7e69222..4c035ae 100644 --- a/olaflow/processing/sws_ola.py +++ b/olaflow/processing/sws_ola.py @@ -12,6 +12,7 @@ from .olaflow import OFModel parser = argparse.ArgumentParser(description="Convert swash output to olaFlow input") parser.add_argument("-v", "--verbose", action="count", default=0) parser.add_argument("-c", "--config", default="config.ini") +parser.add_argument("-o", "--output", type=pathlib.Path) args = parser.parse_args() logging.basicConfig(level=max((10, 20 - 10 * args.verbose))) @@ -28,35 +29,36 @@ def data(var): return np.load(sws_out.joinpath(f"{var}.npy")) +t0 = config.getfloat("olaflow", "t0") x = data("x") t = data("t") +arg_t0 = np.argmin(np.abs(t - t0*1e3)) + watl = data("watl") zk = data("zk") velk, _ = data("velk") vz = data("vz") -olaflow_root = pathlib.Path(config.get("olaflow", "root")) +olaflow_root = args.output model = OFModel(olaflow_root) model.read_mesh() -watl_t = interpolate.interp1d(x, watl[680]) +watl_t = interpolate.interp1d(x, watl[arg_t0] + config.getfloat("bathy", "level", fallback=0.)) alpha_water = np.where(model.z < watl_t(model.x), 1, 0) -zk_t = interpolate.interp1d(x, zk[680]) -velk_t = interpolate.interp1d(x, velk[680, :, :])(model.x) -vz_t = interpolate.interp1d(x, vz[680])(model.x) +zk_t = interpolate.interp1d(x, zk[arg_t0]) +velk_t = interpolate.interp1d(x, velk[arg_t0, :, :])(model.x) +vz_t = interpolate.interp1d(x, vz[arg_t0])(model.x) zk_tl = zk_t(model.x) -print(velk.shape) ux = np.zeros(model.x.shape) uy = np.zeros(model.x.shape) uz = np.zeros(model.x.shape) -print(zk_tl.shape, velk.shape, vz.shape) for zk_l, velk_l, vz_l in zip(zk_tl, velk_t, vz_t): ux = np.where(model.z < zk_l, velk_l, ux) uz = np.where(model.z < zk_l, vz_l, uz) -print(np.stack((ux, uy, uz)).T) model.write_field("alpha.water", alpha_water) model.write_vector_field("U", np.stack((ux, uy, uz)).T) +plt.savefig("test.pdf") diff --git a/olaflow/processing/sws_wavedict.py b/olaflow/processing/sws_wavedict_irregular.py similarity index 82% rename from olaflow/processing/sws_wavedict.py rename to olaflow/processing/sws_wavedict_irregular.py index ebb7ef2..f115957 100644 --- a/olaflow/processing/sws_wavedict.py +++ b/olaflow/processing/sws_wavedict_irregular.py @@ -19,6 +19,7 @@ logging.basicConfig(level=max((10, 20 - 10 * args.verbose))) log = logging.getLogger("sws_ola") log.info("Starting sws -> olaFlow converter") +log.warning("This does not provide the correct boundary condition") config = configparser.ConfigParser() config.read(args.config) @@ -30,22 +31,22 @@ def data(var): x = data("x") -t = data("t") +t = data("t")[-100:] watl = data("watl") arg_x0 = np.argmin(np.abs(x + 1250)) -wl = watl[:, arg_x0] +wl = watl[-100:, arg_x0] f = fft.rfftfreq(t.size, np.diff(t).mean())[1:] -w_fft = fft.rfft(wl)[1:] +w_fft = fft.rfft(wl, norm="forward")[1:] amp = np.abs(w_fft) phi = np.angle(w_fft) olaflow_root = pathlib.Path(config.get("olaflow", "root")) -org = olaflow_root.joinpath("constant", "waveDict.org").read_text() -org = org.replace("{n}", str(t.size)) +org = olaflow_root.joinpath("constant", "waveDict_irregular.org").read_text() +org = org.replace("{n}", str(f.size)) org = org.replace("{wh}", "\n".join(amp.astype(np.str_))) org = org.replace("{wph}", "\n".join(phi.astype(np.str_))) org = org.replace("{wper}", "\n".join((1 / f).astype(np.str_))) diff --git a/olaflow/processing/sws_wavedict_paddle.py b/olaflow/processing/sws_wavedict_paddle.py new file mode 100644 index 0000000..02ba15e --- /dev/null +++ b/olaflow/processing/sws_wavedict_paddle.py @@ -0,0 +1,58 @@ +import argparse +import configparser +import logging +import pathlib + +import matplotlib.pyplot as plt +import numpy as np +from scipy import interpolate +from scipy import fft + +from .olaflow import OFModel + +parser = argparse.ArgumentParser(description="Convert swash output to olaFlow input") +parser.add_argument("-v", "--verbose", action="count", default=0) +parser.add_argument("-c", "--config", default="config.ini") +parser.add_argument("-o", "--output", type=pathlib.Path) +args = parser.parse_args() + +logging.basicConfig(level=max((10, 20 - 10 * args.verbose))) +log = logging.getLogger("sws_ola") + +log.info("Starting sws -> olaFlow converter") +config = configparser.ConfigParser() +config.read(args.config) +level = config.getfloat("bathy", "level", fallback=0.) + +sws_out = pathlib.Path(config.get("swash", "np_out")) + + +def data(var): + return np.load(sws_out.joinpath(f"{var}.npy")) + + +x = data("x") +t_ = data("t") + +vel = data("vel") +watl = data("watl") + +x0 = config.getfloat("olaflow", "x0") +arg_x0 = np.argmin(np.abs(x - x0)) +t0 = config.getfloat("olaflow", "t0") +tf = config.getfloat("olaflow", "tf") +arg_t0 = -np.argmax(t_[::-1] < (t0 * 1e3)) +arg_tf = np.argmax(t_ > (tf * 1e3)) + 1 + +t = t_[arg_t0:arg_tf] * 1e-3 +t = t - t.min() +wl = watl[arg_t0:arg_tf, arg_x0] +v = vel[0, arg_t0:arg_tf, arg_x0] + +olaflow_root = args.output +org = olaflow_root.joinpath("constant", "waveDict_paddle.org").read_text() +org = org.replace("{n}", str(t.size)) +org = org.replace("{t}", "\n".join(t.astype(np.str_))) +org = org.replace("{v}", "\n".join(v.astype(np.str_))) +org = org.replace("{eta}", "\n".join(wl.astype(np.str_))) +olaflow_root.joinpath("constant", "waveDict").write_text(org) diff --git a/olaflow/run_ola.sh b/olaflow/run_ola.sh new file mode 100755 index 0000000..4cfbf13 --- /dev/null +++ b/olaflow/run_ola.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env sh +echo START +export inp="of" +read -p "Output: " out + +cp -r --reflink $inp $out +cd $out +source /opt/OpenFOAM/OpenFOAM-9/etc/bashrc +mkdir log +echo Generating mesh +blockMesh > log/blockMesh.log +echo Refining mesh +snappyHexMesh -overwrite > log/snappyHexMesh.log +cp -r 0.org 0 +echo Setting initial fields +setFields > log/setFields.log + +pushd .. +echo Converting swash output to initial condition +python -m processing.sws_ola -o $out +echo Converting swash output to boundary condition +python -m processing.sws_wavedict_paddle -o $out +popd + +echo Generating parallel cases +decomposePar > log/decomposePar.log +echo Running model +mpirun -np 4 olaFlow -parallel > log/olaFlow.log +echo Merging parallel cases +reconstructPar > log/reconstructPar.log + +echo END