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

Lookup tables without timesteps

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 29, 2019, 11:17
Default Lookup tables without timesteps
  #1
New Member
 
Mohamad
Join Date: Apr 2017
Location: Oxford, UK
Posts: 10
Rep Power: 9
mhasif02 is on a distinguished road
Hi all,

I need to find Ct value based on a table (example below):

tableA.dat
surgeAmplitude(m) Ct
0.10 0.58
0.35 0.35
0.52 0.79
0.79 0.91

I'm using OF 4.1 and I want to code something like:

newTurbineForce.C

// * * * * * * * Member Functions * * * * * * * //

...

{
// position of the turbine hub (vector (x,y,z)) at every timestep
turbinePosition = motion.transform(hubPosition_);

// calculate surgeAmplitude (m)
scalar surgeAmp = turbinePosition.x() - hubPosition_.x();

// if surgeAmp = 0.1 {
// lookup tableA.dat
// Ct = 0.58}
// elseif surgeAmp = 0.35 {
// lookup tableA.dat
// Ct = 0.35}
// elseif surgeAmp = 0.2 {
// lookup tableA.dat // need to do some interpolation
// Ct = interpolated value}

}

I am quite new in coding using OF. I searched the forum and found some thread on lookup tables based on timestep. However, in my case, I only want to lookup the tableA.dat based on the surgeAmp value, not timestep. Can someone help/guide me with this? Or have anyone done something similar?

Regards,
Mohamad
mhasif02 is offline   Reply With Quote

Reply

Tags
lookup table


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
[swak4Foam] groovyBC lookup tables for Reynolds stress R tensor field rdbisme OpenFOAM Community Contributions 3 July 19, 2021 03:37
Long output in terminal. ssa_cfd OpenFOAM Running, Solving & CFD 1 March 18, 2019 06:25
DPMFoam - Serious Error --particle-laden flow in simple geometric config benz25 OpenFOAM Running, Solving & CFD 27 December 19, 2017 21:47
Lookup tables ali.m.1 OpenFOAM Running, Solving & CFD 2 May 13, 2016 08:11
Convergence on anisotropic tetahedral meshes pbo OpenFOAM Running, Solving & CFD 12 December 14, 2010 12:59


All times are GMT -4. The time now is 17:55.