|
[Sponsors] |
January 3, 2012, 14:49 |
specify temperature in cell (in solver)
|
#1 |
Member
ak
Join Date: May 2011
Posts: 64
Rep Power: 15 |
Hi
I'd like to modify the ignition file and specify temperature in the cell (in place of enthalpy). I tried to do so, but got the following error on compilation: ignite.H:16: error: assignment of read-only location â((const Foam::volScalarField*)T)->Foam::GeometricField<double, Foam::fvPatchField, Foam::volMesh>::<anonymous>.Foam:imensionedField <double, Foam::volMesh>::<anonymous>.Foam::Field<double>::< anonymous>.Foam::List<double>::<anonymous>.Foam::U List<T>:perator[] [with T = double](ignCell)â Any idea on how to get rid of the error? Many thanks, amit |
|
January 3, 2012, 16:38 |
|
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Temperature is a protected (or private, can't remember exactly offhand) member of thermo, and as such cannot be changed directly (not be default anyway). Implementing an ignition source via temperature depends on the solver you are using.
I see that OF2.1 has the ability to use sources through a dictionary. Have a look at the release notes for OF2.1, under the heading "Numerical Methods" which may be useful to you. |
|
January 4, 2012, 00:38 |
|
#3 | |||
Senior Member
Adhiraj
Join Date: Sep 2010
Location: Karnataka, India
Posts: 187
Rep Power: 16 |
Just my 2 cents.
In the file createFields.H you will find Quote:
Then add to your createFields.H Quote:
Quote:
Last edited by adhiraj; January 4, 2012 at 00:40. Reason: typo |
||||
January 4, 2012, 12:50 |
|
#4 | |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Quote:
You might also try using swak4Foam first; this would allow you test the temperature change before mucking about in the source code. |
||
March 26, 2012, 10:24 |
|
#5 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19 |
Have you succeded in fixing a temperature in a cell?
|
|
March 28, 2012, 02:41 |
|
#6 |
Senior Member
|
Just use the setValues of fvMatrix
fvScalarMatrix TEqn (.....); //list is the cell id list (labelList) that you want to fixed the temperature, the the valueList is the value of the temperature you want to set TEqn.setValue(list, valuelist); TEqn.solve(); |
|
March 28, 2012, 03:48 |
|
#7 |
Senior Member
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 19 |
Dear Su,
thanks for answering. Actually, I und what you mean, but there is a problem: in the buoyantSimpleFoam (and buoyantPimpleFoam) solver I do not have the TEqn.H file. What I did is to impose the enthalpy. The point is that what I did works for the buoyantSimpleFoam, but it doesn't for the buoyantPimpleFoam. I attach both the solvers (modified): could you check them, please? Also, if you think that your advice is smarter, could you explain me what to do? Thanks in advance. Samuele |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
thobois class engineTopoChangerMesh error | Peter_600 | OpenFOAM | 4 | August 2, 2014 10:52 |
temperature limited warning in 1 cell | Shamoon Jamshed | FLUENT | 1 | April 3, 2014 05:00 |
Which solver for temperature | fred | OpenFOAM Running, Solving & CFD | 7 | December 5, 2006 10:56 |
Divergencr in AMG solver: temperature | shashikant | FLUENT | 1 | July 10, 2006 13:38 |
drastic increase of temperature in one cell | ravi | FLUENT | 7 | August 30, 2004 23:58 |