|
[Sponsors] |
How to read data into fvModels for energy source term |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 14, 2023, 13:15 |
How to read data into fvModels for energy source term
|
#1 |
New Member
S Abrahams
Join Date: Mar 2022
Location: UK
Posts: 15
Rep Power: 4 |
I'm using compressibleInterFoam with OF9. I have defined an energy source term in fvModels using codeAddRhoSup. I'd like my source term to be time dependent, interpolated from external data. How can I read my data into codeAddRhoSup in fvModels so that I can use it in my source term?
To give more detail, I have data with a list of times and a list of values e.g. Code:
tData = (1 2 3 4 5) PData = (8 9 10 11 12) Can anyone help me to read in the data? Or as an alternative, how can I define the lists inside the fvModels file? Here's my fvModels file Code:
energySource { type coded; selectionMode all; field T; codeAddRhoSup #{ Pout<< "**codeAddRhoSup**" << endl; scalar P = FUNCTION OF TIME INTERPOLATED FROM DATA; const volScalarField& alpha = mesh(). lookupObject<volScalarField>("alpha.water"); //alpha field const scalarField& V = mesh().V(); //cell volumes scalar time = mesh().time().value(); //time without dimensions scalarField& heSource = eqn.source(); // heat eqn source term forAll(V, i) { heSource[i] -= P*V[i]*alpha[i]; }; #}; } |
|
Tags |
data, energy source term, fvmodels, interpolation data, source term |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFD by anderson, chp 10.... supersonic flow over flat plate | varunjain89 | Main CFD Forum | 18 | May 11, 2018 08:31 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 11:52 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |
Problem in running ICEM grid in Openfoam | Tarak | OpenFOAM | 6 | September 9, 2011 18:51 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |