|
[Sponsors] |
[waves2Foam] Want to directly input my own calculated spectral values (S) from a text file |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 16, 2016, 10:29 |
Want to directly input my own calculated spectral values (S) from a text file
|
#1 |
Senior Member
ArielJ
Join Date: Aug 2015
Posts: 127
Rep Power: 11 |
Hi all,
I have some ocean data that I have taken the spectrum for. What I want to do is: Calculate the amplitudes like this: Code:
// Amplitude is the square root of the trapezoidal integral amp_[i - 1] = Foam::sqrt ( (S[i-1] + S[i]) *(nodeFrequency[i] - nodeFrequency[i - 1]) ); This will be my first time altering any OpenFOAM code and I'm nervous about messing everything up and I don't know where to start on this task... does anyone have any advice on this? I imagine it will be something like: Include the text file (in the place where the current JONSWAP or Pierson-Moscowitz calculation is), and calculate the amp, freq, etc from my S values in the text file. First of all, is it possible to include a text file like that? If so, how might I do it? |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Custom Thermophysical Properties | wsmith02 | OpenFOAM | 4 | June 1, 2023 15:30 |
[foam-extend.org] Problems installing foam-extend-4.0 on openSUSE 42.2 and Ubuntu 16.04 | ordinary | OpenFOAM Installation | 19 | September 3, 2019 19:13 |
[swak4Foam] groovyBC in openFOAM-2.0 for parabolic velocity bc | ofslcm | OpenFOAM Community Contributions | 25 | March 6, 2017 11:03 |
[Other] How to use finite area method in official OpenFOAM 2.2.0? | Detian Liu | OpenFOAM Meshing & Mesh Conversion | 4 | November 3, 2015 04:04 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |