|
[Sponsors] |
September 21, 2022, 04:27 |
Impose a square function on fvOptions
|
#1 |
New Member
Giulia
Join Date: Feb 2022
Posts: 19
Rep Power: 4 |
Hello,
I am using OpenFOAM version 6 and chtmuliregionfoam. I am using the following code to impose a sinusoidal heat source on my solid region throughout my fvOptions file: Code:
energySource { type scalarCodedSource; active yes; timeStart 0; duration 1e6; name sourceTime; selectionMode all; scalarCodedSourceCoeffs { selectionMode all; volumeMode specific; fields (h); codeInclude #{ #}; codeCorrect #{ Pout<< "**codeCorrect**" << endl; #}; codeAddSup #{ const Time& time = mesh().time(); const scalarField& V = mesh_.V(); const vectorField& C = mesh_.C(); scalarField& heSource = eqn.source(); heSource += 2.729e6*sin(2*3.14*0.1*time.value())*V; Pout << "***codeAddSup***" << endl; #}; codeSetValue #{ Pout<< "**codeSetValue**" << endl; #}; // Dummy entry. Make dependent on above to trigger recompilation code #{ $codeInclude $codeCorrect $codeAddSup $codeSetValue #}; } Thank you in advance!! |
|
Tags |
chtmultiregionfoam, fvoptions, heat source, sinusoidal, square wave |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Other] refineWallLayer Error | Yuby | OpenFOAM Meshing & Mesh Conversion | 2 | November 11, 2021 12:04 |
[swak4Foam] installation problem with version 0.2.3 | Claudio87 | OpenFOAM Community Contributions | 9 | May 8, 2013 11:20 |
latest OpenFOAM-1.6.x from git failed to compile | phsieh2005 | OpenFOAM Bugs | 25 | February 9, 2010 05:37 |
Compilation errors in ThirdPartymallochoard | feng_w | OpenFOAM Installation | 1 | January 25, 2009 07:59 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |