
[Sponsors] 
March 10, 2011, 04:13 

#181  
Senior Member
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 190
Rep Power: 17 
hi!
Quote:
Code:
globalBoundaryList = buildGlobalBoundaryList(fluidRegions[i]); aram 

March 10, 2011, 05:00 

#182 
Member
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16 
Hey Aram!
Thanks for your code, that was exactly, what I was looking for. Indeed, as I expected, one has to refer to the fluid regions (resp. their meshes) seperately. I just didn't know the correct syntax (learned some ANSI C some years ago, don't know the syntax of C++ too much) and the object structure of OpenFoam is still a miracle to me... Thanks a lot, I'm going to start some tests with that right now... Ciao Wolle P.S.: As I intended to calculate heat flux over the boundaries later on, this is also a nice tutorial and a good point to start I think... EDIT: Strange that I can only see your postings just after posting a reply myself  updating the browser page doesn't help so far? Strange...
__________________
CAELinux 2010  OpenFOAM 1.7 

March 10, 2011, 05:32 

#183 
Member
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16 
As boundary face normals point outwards of the domain, I suppose positive flux values should be read as a flux of mass leaving the domain?
__________________
CAELinux 2010  OpenFOAM 1.7 

March 10, 2011, 06:02 

#184 
Senior Member
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 190
Rep Power: 17 
correct! positive flux = out of the domain; negative flux into domain.
aram 

March 14, 2011, 04:40 

#185 
Member
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16 
Hi all,
I tried the waveTransmissive bc just for the ceiling, while all other patches remained walls. This looked good at first sight, but then the case ran into problems... I think due to inappropriate geometry. So I chose to use waveTransmissive BC for left, right and top. First 200 time steps look good so far. At the moment I'm running this for a longer time just to see, what happens... I tried to clean up the case, translated the comments into (maybe somehow humble) English and packed things up together with the modified solver (mass flux calculation). Here it is, feel free to comment... Ciao Wolle P.S.: I didn't get tar to produce multiple volumes and due to the upload file size restrictions, I packed everything up with 7z, which should be installed on most Linux machines (or can be installed through official repositories). As the file attachment dialogue doesn't accept the file endings, I added ".doc". To unpack simply remove ".doc" from the file names, rightclick and unpack with 7z...
__________________
CAELinux 2010  OpenFOAM 1.7 

March 17, 2011, 10:18 

#186 
Member
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16 
Hi all!
I think, I've got a nice setup now, that will do for my purposes. Now I intend to include heat flux calculation similar to the mass flux calculation. Do I have to include it this way or is there already a feature doing this? As I don't know, where to start and the documentation remains rather cryptic to me... could someone please explain, what the lines Code:
flux = sum(phi.boundaryField()[patchIndex]); Code:
reduce(flux, sumOp<scalar>()); The first line calculates the sum of phi at the boundary field of the processed patch, I think. But so far I couldn't find out, where to look for what the sum() function REALLY does, what arguments it takes, what it gives as return value etc. Please help me to help myself and give a hint, where to look in order to find the solution by myself. I'm totally clueless, what the second line does. But in the end it's the same: I just don't know, WHERE to look in the code... Ciao Wolle
__________________
CAELinux 2010  OpenFOAM 1.7 

March 17, 2011, 17:12 

#187 
Senior Member
Daniele
Join Date: Feb 2010
Posts: 134
Rep Power: 16 
Hi all
Where can i find multiRegionLiquidHeater solver? Thanks 

March 22, 2011, 10:27 

#188 
Member
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16 
Hi all!
I dug in the depths of the "C++ Source Guide"... is that the same as what's known as "Doxygen"? However: it's really confusing. Is there something like a beginners guide to that? In order to calculate heat flux at the borders, I thought about this a little. With respect to my setup (fluid with solid heater of constant temperature), I think at first I'd like to sum up the heat flux at the boundaries. At the moment, I'm not even sure, which variables I can use and how to do this in the end. All I write from now on, refers to the chtMultiRegionFoam solver as of OF1.7. From reading the code (and trying hard to understand), some questions arise. The fields "gh" and "ghf" seem to only calculate the inner product of g and the position of the cell/face centre, returning a scalar. What are those fields for? Now, what's even more interesting, is the thermoFluid stuff. In createFluidFields.H, line 22, it says: Code:
Info<< " Adding to thermoFluid\n" << endl; thermoFluid.set ( i, basicPsiThermo::New(fluidRegions[i]).ptr() ); The basicThermo class also has other interesting properties/functions: * rho Density [kg/m^3]. * h Total enthalpy [J/kg]. * hs Sensible enthalpy [J/kg]. * e Internal energy [J/kg]. * T Temperature [K]. * Cp Heat capacity at constant pressure for patch [J/kg/K]. Now for some of those, there is a further distinction, let's take h for example: * virtual volScalarField & h () = Total enthalpy [J/kg]. * virtual const volScalarField & h () const = Total enthalpy [J/kg]. * virtual tmp< scalarField > h (const scalarField &T, const labelList &cells) const = Total enthalpy for cellset [J/kg]. * virtual tmp< scalarField > h (const scalarField &T, const label patchi) const = Total enthalpy for patch [J/kg]. Does that mean, that refering to some basicThermoObject.h(const scalarField &T, const label patchi), which returns a scalarField, gives all the h values at the patch? What patch label to use can be figured out from the calculateMassFlux.H as mentioned above... but what (and how?!!!) to use as T scalar field? Would something like this be correct? Code:
{ scalar netHeatFlux = 0; forAll (globalBoundaryList, patchI) { scalar heatFlux = 0; label patchIndex = mesh.boundaryMesh().findPatchID(globalBoundaryList[patchI]); scalarField totalEnthalpyOfPatchField = h(T, patchIndex); // I know, this variable is not further used... if (patchIndex >= 0) { heatFlux = sum(h.boundaryField()[patchIndex]); } reduce(heatFlux, sumOp<scalar>()); Info<< "Heat flux at " << globalBoundaryList[patchI] << " = " << heatFlux << endl; netHeatFlux += heatFlux; } Info<< "Net heat flux = " << netHeatFlux << endl; cumulativeHeatFlux += netHeatFlux; Info<< "Cumulative heat flux = " << cumulativeHeatFlux << endl << endl; } http://foam.sourceforge.net/docs/cpp...rce.php#l00271 Not implemented?!?! Well, after all it seems, that I have to refer to hPsiThermo class, as this one is specified in my thermophysicalProperties dictionary. hPsiThermo seems to have cp as well as h. It took me hours to realize that, as I can see no statement in the code, that performs the lookup of that dictionary until now... where can I find that? Ciao Wolle EDIT: Of course h is always positive, so I guess, I would have to calculate h*phi? How to do that?
__________________
CAELinux 2010  OpenFOAM 1.7 Last edited by Wolle; March 22, 2011 at 10:46. 

March 22, 2011, 11:49 

#189 
Member
Wolfram Kretzschmar
Join Date: Dec 2009
Posts: 71
Rep Power: 16 
Hi all!
Now... in order to get the dimensions right, I think I've got to multiply with deltaT. Code:
{ scalar netMassFlux = 0; scalar netHeatFlux = 0; scalar netHEATFlux = 0; forAll (globalBoundaryList, patchI) { scalar massFlux = 0; scalar heatFlux = 0; label patchIndex = mesh.boundaryMesh().findPatchID(globalBoundaryList[patchI]); if (patchIndex >= 0) { massFlux = sum(phi.boundaryField()[patchIndex]); heatFlux = sum(h.boundaryField()[patchIndex]); } reduce(massFlux, sumOp<scalar>()); reduce(heatFlux, sumOp<scalar>()); scalar HEATFlux = heatFlux * massFlux * runTime.deltaT().value(); Info<< "Mass flux at " << globalBoundaryList[patchI] << " = " << massFlux << endl; netMassFlux += massFlux; Info<< "Heat flux at " << globalBoundaryList[patchI] << " = " << heatFlux << endl; netHeatFlux += heatFlux; Info<< "HEAT flux at " << globalBoundaryList[patchI] << " = " << HEATFlux << endl; netHEATFlux += HEATFlux; } Info<< "Net mass flux = " << netMassFlux << endl; cumulativeMassFlux += netMassFlux; Info<< "Cumulative mass flux = " << cumulativeMassFlux << endl; Info<< "Net heat flux = " << netHeatFlux << endl; cumulativeHeatFlux += netHeatFlux; Info<< "Cumulative HEAT flux = " << cumulativeHEATFlux << endl; Info<< "Net HEAT flux = " << netHEATFlux << endl; cumulativeHEATFlux += netHEATFlux; Info<< "Cumulative HEAT flux = " << cumulativeHEATFlux << endl; } So I guess, I should multiply by rho. As phi and h are summed up for each patch, I think an average rho of the respective patch would be good. How to obtain that? Yes, I know it's rather ugly code.... please note, that I'm a beginner. By the way... I still don't know, what the reduce function does? Ciao Wolle
__________________
CAELinux 2010  OpenFOAM 1.7 

April 19, 2011, 10:08 

#191  
Senior Member
Mirko Vukovic
Join Date: Mar 2009
Posts: 159
Rep Power: 17 
Quote:
On the other hand, I've seen tutorials where these are set in system/Region/changeDictionaryDict boundary entry. Mirko 

September 22, 2011, 00:19 

#192 
Member
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15 
Hi.. Aram,
I have some confusion in boundary condition in chtMultiRegionFoam.. you explain as below... _solidWallTemperatureCoupledFvPatchScalarField.C: Foam::tmp<foam::scalarfield> Foam::solidWallTemperatureCoupledFvPatchScalarFiel d::flux() const { const fvPatchScalarField& Kw = patch().lookupPatchField<volscalarfield,>(KName_); const fvPatchScalarField& Tw = *this; return Tw.snGrad()*patch().magSf()*Kw; } in this condition, mathematical equestion is K1*T1=K2*T2 ? I am not sure.. please correct me if I am wrong.. if this is correct, How can Implement below boundary condition? K1*(normal component of gradient (T1))=K2*(normal component of gradient(T2))? where, K1 and K2 are scalarvolume for different filed respectevely, and T1 and T2 are also scalar for different fields.. actually I want to use for electrostatic problem for multiregion.. in that, K used as permitivitty and T used as electric potential (Volt). thank you in advance for any help... kind regards alpesh 

September 22, 2011, 00:23 

#193  
Member
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15 
Quote:
I have some confusion in boundary condition in chtMultiRegionFoam.. you explain as below... _solidWallTemperatureCoupledFvPatchScalarField.C: Foam::tmp<foam::scalarfield> Foam::solidWallTemperatureCoupledFvPatchScalarFiel d::flux() const { const fvPatchScalarField& Kw = patch().lookupPatchField<volscalarfield,>(KName_); const fvPatchScalarField& Tw = *this; return Tw.snGrad()*patch().magSf()*Kw; } in this condition, mathematical equestion is K1*T1=K2*T2 ? I am not sure.. please correct me if I am wrong.. if this is correct, How can Implement below boundary condition? K1*(normal component of gradient (T1))=K2*(normal component of gradient(T2))? where, K1 and K2 are scalarvolume for different filed respectevely, and T1 and T2 are also scalar for different fields.. actually I want to use for electrostatic problem for multiregion.. in that, K used as permitivitty and T used as electric potential (Volt). thank you in advance for any help... kind regards alpesh 

September 22, 2011, 03:21 

#194 
Senior Member
Aram Amouzandeh
Join Date: Mar 2009
Location: Vienna, Vienna, Austria
Posts: 190
Rep Power: 17 
hi alpesh,
in the solidWallTemperatureCoupledMixed BC the common interface temperature between two regions "0" and "1"is calculated from the energy balance Code:
diffusiveFlux[region0] = diffusiveFlux[region1] Code:
Tw = (K0*intField0/Dx0+K1*intField1/Dx1)/(K0*/Dx0+K1*/Dx1) hope that helps! cheers, aram 

September 22, 2011, 08:40 

#195 
Member
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15 
Hello Aram,
Thank you very much for reply.. Kind Regards Alepsh 

February 6, 2012, 10:49 
Boundary condition in chtmultiregionfoam

#196 
Member
Alpesh
Join Date: Jan 2011
Location: Germany
Posts: 52
Rep Power: 15 
Hello friends,
I am using chtmultiregionFoam for my case.. my case consists two regions (solid and fluid).. one sphere subjected to under external electric field.. hence, I made geometry in gmsh, one sphere in box, and sphere define as solid and surrounding air region in box defined as fluid, air. I transfer gmshToFoam and made set up. I don't need NS equation in fluid region and also don't need heat equation in fluid region. Hence, I removed all equation and implement my own equation for both region... I succeed in that.. I run simulation and it's work.. But, I am not sure about boundary condition.. because I used "SolidWallMixedTemperatureCoupled" boundary condition.. My equations (problem) need boundary condition at interface as below: e1*d/dn(Voltage1)=e2*d/dn(Volatage2) or e1*(En1)=e2*(En2) where, e1 & e2 is permittivity of solid and fluid, respectively. En is the normal component of electric field strength. electric field strength is also define as : 1*grad(Voltage). I used "swmtc" boundary condition with K define as "e" and neighbour field define as "voltage".. because in solver code, variable is voltage in both regions.. solver solving equation is: divergence(e*gradient(Voltage))=0 The question is: is it correct boundary condition for above case? or can you tell me that the "SolidWallMixesTemperatureCoupled" b.c. solves which condition at interface? is it solving following condition for temperature.. k1*d/dn(T1)=k2*d/dn(T2) ? where, K is thermal conductivity and T is temperature.. I also tried to read the code file "SolidWallMixedTemperatureCOupledFvPatchScalarFiel d.C" and also ".H".. But, I didn't get completely.. I didn't get: this>refValue() = nbrIntFld; this>refGrad()=0.0; this>valueFraction()=nbrKDelta / (nbrKDelta + myKDelta ()); Can anyone help me to understand these, please? Kind regards and thanks in advance Alpesh 

June 9, 2015, 20:48 
Axial pump simulation

#197 
New Member
Felipe Condo
Join Date: Jun 2015
Posts: 3
Rep Power: 10 
HI
I'm Felipe a mechanical student from ESPOL, Ecuador. I have to work on the simulation of axial flow pump in Fluent, but i don't even have the geometry does anyone can please help me with this?Please Thanks Felipe 

June 10, 2015, 03:02 

#198 
Senior Member

Hi Felipe,
This is a Forum for OpenFOAM users you will find Fluent User discussing http://www.cfdonline.com/Forums/fluent/ and someone might be able to share a case there For OpenFOAM there is Special Interest Group Turbomachinery that provides some Validation test cases see>The DARPA HIREP (High Reynolds Number Pump) axial flow pump http://openfoamwiki.net/index.php/Si...ion_test_cases if you want to convert that case to fluent there is a tool foamMeshToFluent that writes out the OPENFOAMŪ mesh in Fluent mesh format , but you have to install OF to use that tool. My guess among the Fluent users someone might have a case for you that need no converting 

Thread Tools  Search this Thread 
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Tutorial help  mech  FLUENT  4  May 16, 2007 02:43 
tutorial 6 in Fluent 6.2 tutorial and Mesh  pilli4u  FLUENT  2  April 2, 2007 05:09 
3D Tutorial  MJ  FLUENT  0  January 16, 2007 08:45 
tutorial  masood yooceframandi  FLUENT  1  January 25, 2005 12:28 
tutorial  adil  FLUENT  0  March 8, 2004 03:48 