|
[Sponsors] | |||||
|
|
|
#1 |
|
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 121
Rep Power: 4 ![]() |
Hello everybody,
I would like to link the temperature of a boundary (a wall patch) with the solver solution. In other word, the solver has be able to change the value of the patch temperature. In rhoPimpleFoam, the temperature field is created by a sub function and not by the createfield.h. Therefor, I cannot access/change directly the temperature field in the solver. I can read the temperature field by using: Code:
thermo.T() Code:
const volScalarField& T = db().lookupObject<volScalarField>("T");
My dream is to get something like: Code:
label patchWall = mesh.boundaryMesh().findPatchID("wall"); //patchID = id of the patch wall
const fvPatch& cPatch = mesh.boundary()[patchWall];
forAll(cPatch, facei) //facei = id of the face
{
T.boundaryField()[patchWall][facei] = .......... ;
};
|
|
|
|
|
|
|
|
|
#2 |
|
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 121
Rep Power: 4 ![]() |
I've just found another topic talking about my problem: Get access to temperature in Openfoam
But if anybody has a solution, I'm still open. |
|
|
|
|
|
|
|
|
#3 |
|
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 121
Rep Power: 4 ![]() |
As told in the other topic, I'm getting close to the solution BUT I HAVE A BUG WITH THE THERMO MODEL.
Here is the procedure I used: 1) open a text editor in admin by writing in the terminal: "sudo gedit" 2) with this text editor, open: "basicThermo.C" located in /opt/openfoam220/src/thermophysicalModels/basic/basicThermo 3) Add the following line in the Member Functions (I put it at line 396 after the "basicThermo::T()" ): Code:
// Add this
//- Temperature [K]
// Non-const access allowed
Foam::volScalarField& Foam::basicThermo::T()
{
return T_;
}
5) Add the following line after the comment "Fields derived from thermodynamic state variables" (I put it at line 316 after the other Temperature member ): Code:
// Add this
//- Temperature [K]
// Non-const access allowed for transport equations
virtual volScalarField& T();
7) Go to /opt/openfoam220/src/thermophysicalModels and open a terminal 8) With the terminal located in this folder, we now want to get the full root access. To do so, write: "sudo -s". After typing your password, you will see that the command line will start with "root". 9) We need to recompile the thermo model of openfoam. To do so, simply write "./Allwmake". This step might take few minutes depending of your system (for me with virtualization, it took about 1 or 2 minutes). But I think there is a problem with the new compilation because even a simple rhoSimplecFoam doesn't work anymore. |
|
|
|
|
|
|
|
|
#4 |
|
Senior Member
Christian Lucas
Join Date: Aug 2009
Location: Braunschweig, Germany
Posts: 146
Rep Power: 5 ![]() |
Hi,
an easy solution might be. Define the temperature field in basicThermo as mutable (so that can change the field in a constant function) Add a function that changes the values in the temperature field in the file called by the solver when the thermo class is constructed (basicPsiThermo in OF 2.1) Regards, Christian |
|
|
|
|
|
|
|
|
#5 | |
|
Senior Member
Join Date: Nov 2012
Posts: 137
Rep Power: 2 ![]() |
I also used that method, but I had the similar problem:
#0 Foam::error: rintStack(Foam::Ostream&) in "/home/hz283/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"#1 Foam::sigSegv::sigHandler(int) in "/home/hz283/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libOpenFOAM.so" #2 in "/lib64/libc.so.6" #3 Foam::hPsiThermo<Foam: ureMixture<Foam::sutherlan dTransport<Foam::specieThermo<Foam::hConstThermo<F oam: erfectGas> > > > >::Cv() const in "/home/hz283/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libbasicThermophysicalModels.so"#4 Foam::compressible::LESModel::muEff() const in "/home/hz283/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libcompressibleLESModels.so" #5 Foam::compressible::LESModels::GenEddyVisc::divDev RhoBeff(Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const in "/home/hz283/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libcompressibleLESModels.so" #6 Foam::compressible::LESModel::divDevRhoReff(Foam:: GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh>&) const in "/home/hz283/OpenFOAM/OpenFOAM-2.1.1/platforms/linux64GccDPOpt/lib/libcompressibleLESModels.so" #7 in "/home/hz283/OpenFOAM/hz283-2.1.1/platforms/linux64GccDPOpt/bin/cmcSgasFoam-0DCMC" #8 __libc_start_main in "/lib64/libc.so.6" #9 at /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/x86_64/elf/start.S:116 Segmentation fault In my stuff, I calculate the density and temperature from my own model. That means I did not use rho=P_*psi() to update the density in Openfoam. Besides, I use the following thermoynamic models: thermoType hPsiThermo<pureMixture<sutherlandTransport<specieT hermo<hConstThermo<perfectGas>>>>>; In hPsiThermo.C, I comment the line 48: TCells[celli] = mixture_.TH(hCells[celli], TCells[celli]); but I have the same problem as I mentioned in the beginning. I am working on it and keep you posted. Thanks. Quote:
|
||
|
|
|
||
|
|
|
#6 | |
|
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 121
Rep Power: 4 ![]() |
Quote:
Thx |
||
|
|
|
||
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| domain imbalance for enrgy equation | happy | CFX | 14 | September 6, 2012 01:54 |
| Solver not "seeing" temperature change. | Canesin | OpenFOAM | 0 | October 20, 2011 17:06 |
| Domain Imbalance | HMR | CFX | 3 | March 6, 2011 20:10 |
| increasing mesh quality is leading to poor convergence | tippo | CFX | 2 | May 5, 2009 10:55 |
| Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... | 2 | July 15, 2005 04:15 |