|
[Sponsors] |
March 2, 2021, 23:27 |
|
#21 | |
Member
Jonathan Wells
Join Date: Oct 2020
Location: Indiana
Posts: 44
Rep Power: 6 |
Quote:
First, do I make a file called "fvOptions" in the /system folder, or do I add this code to the controlDict file in the functions section? Looking at the OpenFOAM API here https://www.openfoam.com/documentati...e.html#details it says to put it in the controlDict file. When I do this, the case runs as normal, but there is no difference in the output. I am wondering if there is a problem with my code that is causing an issue. Here is my code: Code:
energySource { type scalarCodedSource; active yes; scalarCodedSourceCoeffs { selectionMode all; fieldNames (h); name sourceTime; codeInclude #{ #}; codeCorrect #{ Pout<< "**codeCorrect**" << endl; #}; codeAddSup #{ const Time& time = mesh().time(); const volScalarField& rhoS = mesh_.lookupObject<volScalarField>("rho"); const volVectorField& uS = mesh_.lookupObject<volVectorField>("U"); const volScalarField& pS = mesh_.lookupObject<volScalarField>("p"); const vectorField& C = mesh_.C(); const scalarField& V = mesh_.V(); scalarField& SoS = sqrt(1.4*(pS/rhoS)); scalarField& mach = uS/SoS; scalarField& qq = -(pS*(1-(mach*mach))1005)/(1.4*(mach*mach)*287.058); scalarField& heSource = eqn.source(); heSource += fvc::ddt(qq); #}; codeSetValue #{ Pout<< "**codeSetValue**" << endl; #}; // Dummy entry. Make dependent on above to trigger recompilation code #{ $codeInclude $codeCorrect $codeAddSup $codeSetValue #}; } sourceTimeCoeffs { // Dummy entry } } |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using PengRobinsonGas EoS with sprayFoam | Jabo | OpenFOAM Running, Solving & CFD | 36 | July 16, 2024 04:52 |
[OpenFOAM.com] swak4foam compiling issues on a cluster | saj216 | OpenFOAM Installation | 5 | January 17, 2023 17:05 |
Periodic flow using Cyclic - comparison with Fluent | nusivares | OpenFOAM Running, Solving & CFD | 30 | December 12, 2017 06:35 |
SparceImage v1.7.x Issue on MAC OS X | rcarmi | OpenFOAM Installation | 4 | August 14, 2014 07:42 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |