CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Community Contributions

[waves2Foam] Want to directly input my own calculated spectral values (S) from a text file

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 16, 2016, 10:29
Default 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
arieljeds is on a distinguished road
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])
            );
(from JONSWAP.C) BUT instead of using the values from a traditional already implemented spectrum, I want to directly input my own calculated spectral values (S) from a text file.

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?
arieljeds is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 01:14.