|
[Sponsors] |
Better understanding of some unknown parameters in scalarcodedsource |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 6, 2015, 15:25 |
Better understanding of some unknown parameters in scalarcodedsource
|
#1 |
Senior Member
Mehdi Asghari
Join Date: Feb 2010
Posts: 127
Rep Power: 16 |
Hello everyone!
I used scalarCodedSource for definition of a transient heat source. However, I can't understand the usage of some parameters assigned within the code. For example, what is meaning of the -= sign at codeAddSup? If It adds an additional source term to main S= S_u + S_p x, what's philosophy of the minus sign at it? Or as second question, is codeAddSup an absolute quantity or a specific one? Or as third question, what’s the meaning of sourceTimeCoeffs in this dynamic code? Also, these ambiguous parameters are highlighted with red color at a sample scalarCodedSource as follows: Code:
energySource { type scalarCodedSource; activetrue; selectionMode all; scalarCodedSourceCoeffs { fieldNames(h); redirectType sourceTime; codeInclude #{ #}; codeCorrect #{ Pout<< "**codeCorrect**" << endl; #}; codeAddSup #{ const Time& time = mesh().time(); const scalarField& V = mesh_.V(); scalarField& heSource = eqn.source(); heSource -= 0.1*sqr(time.value())*V; // Is specific or absolute? #}; codeSetValue #{ Pout<< "**codeSetValue**" << endl; #}; // Dummy entry. Make dependent on above to trigger recompilation code #{ $codeInclude $codeCorrect $codeAddSup $codeSetValue #}; } sourceTimeCoeffs { // Dummy entry } } Last edited by Asghari_M; June 6, 2015 at 18:32. |
|
June 8, 2015, 05:50 |
|
#3 |
Senior Member
Mehdi Asghari
Join Date: Feb 2010
Posts: 127
Rep Power: 16 |
Ok, of cource this is obvious.
However I didn't get my answer. As a better explanation of my questions, I can restate it as following question: Suppose there is an energy source term in a simple solid conduction problem according to the following form: S(h)= t/(t+1)*0.5 (unit is watt/m3 ) :: specific energy source, and Simple Conduction Equation: ddt(rho, h) - laplacian (k/Cp, h) = enthalpy source term Now, I want to use scalarCodedSource for definition of heat (enthalpy) source term. How can I do this operation? Moreover, the meaning of other unkown parameters such as codeCorrect and sourceTimeCoeffs are still ambiguous for me. I have presented scalarCodedSource as follows: ( note that I have pointed all of my questions and doubted options for source term and other unknown parameters with red color) Code:
energySource { type scalarCodedSource; active true; selectionMode all; scalarCodedSourceCoeffs { fieldNames(h); redirectType sourceTime; codeInclude #{ #}; codeCorrect #{ Pout<< "**codeCorrect**" << endl; #}; codeAddSup #{ const Time& time = mesh().time(); const scalarField& V = mesh_.V(); scalarField& heSource = eqn.source(); // which expression is correct for above mentioned energy source term??: // heSource = time.value()/(time.value()+1)*0.5; //first option (Is it answer?) // heSource = time.value()/(time.value()+1)*0.5*V; //second option(Is it answer?) // heSource -= time.value()/(time.value()+1)*0.5;// third option(Is it answer?) // heSource -= time.value()/(time.value()+1)*0.5*V;// forth option(Is it answer?) #}; codeSetValue #{ Pout<< "**codeSetValue**" << endl; #}; // Dummy entry. Make dependent on above to trigger recompilation code #{ $codeInclude $codeCorrect $codeAddSup $codeSetValue ? #}; } sourceTimeCoeffs ? { // Dummy entry } } Thanks a lot for any other help. Last edited by Asghari_M; June 27, 2015 at 03:53. |
|
July 30, 2015, 06:03 |
|
#4 |
New Member
nemo
Join Date: Jan 2015
Posts: 26
Rep Power: 11 |
I also face the same problem right now,do you get the answer?
|
|
July 30, 2015, 13:53 |
|
#5 |
Senior Member
Mehdi Asghari
Join Date: Feb 2010
Posts: 127
Rep Power: 16 |
Hi!
Just now, some similar discussions is being discussed in following thread: http://www.cfd-online.com/Forums/ope...rce-terms.html You might want to consult the above mentioned thread. |
|
July 30, 2015, 22:18 |
|
#6 |
New Member
nemo
Join Date: Jan 2015
Posts: 26
Rep Power: 11 |
Thank you very much.
I still do not understand this problem totally,I think I should read the source code and try to get the answer. |
|
October 16, 2018, 04:32 |
|
#7 |
New Member
Join Date: Feb 2018
Posts: 3
Rep Power: 8 |
Hi All,
I'm using reactingMultiphaseEulerfoam 3.0 with the fvOptions, scalarCodedSource. I would like to have two sources, one that is a sink and removes some phase 1 and another source that adds the same mass amount of phase 2. The mass removed should be dependent on the mass of phase 1. aka dm1/dt=m1*A Do someone has any idea how it would be best to do it? Thanks! |
|
Tags |
scalarcodedsource |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Commercial meshers] converting Fluent mesh to openfoam standard mesh | deepesh | OpenFOAM Meshing & Mesh Conversion | 31 | March 29, 2017 06:59 |
[Other] How to create an MRF zone ? | aminem | OpenFOAM Meshing & Mesh Conversion | 2 | December 8, 2014 11:45 |
Thermal Comfort Simulation in STAR CCM+ | anupmu | STAR-CCM+ | 1 | February 27, 2013 15:25 |
[OpenFOAM] Saving ParaFoam views and case | sail | ParaView | 9 | November 25, 2011 16:46 |
compressible two phase flow in CFX4.4 | youngan | CFX | 0 | July 2, 2003 00:32 |