CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

coordinate depending source term

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 10, 2009, 07:54
Default coordinate depending source term
  #1
Member
 
Jagmohan Meena
Join Date: May 2009
Posts: 30
Rep Power: 17
jmmeena is on a distinguished road
Dear Sir/Madam,

I am doing a heat transfer problem with source term. Source term itself depends on the x,y,z, coordinates. I have tried following :

Teqn:

{
fvScalarMatrix TEqn
(
(rho)*(Cp)*fvm::ddt(T)
+ fvm::div(phi, T)
- (rho)*(Cp)*fvm::laplacian(DT, T)
==
Q
);

TEqn.relax();

eqnResidual = TEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);

}


Q is source term which is defined as:

Info<< "Reading sourceProperties\n" << endl;

IOdictionary sourceProperties
(
IOobject
(
"sourceProperties",
runTime.constant(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);

dimensionedScalar Acos
(
sourceProperties.lookup("Acos")
);

dimensionedScalar Rcos
(
sourceProperties.lookup("Rcos")
);

dimensionedScalar Zcos
(
sourceProperties.lookup("Zcos")
);

dimensionedScalar Q("Q", Acos*cos(0.5*3.14*(sqrt((x[0]*x[0])+(x[1]*x[1])))/Rcos)*cos(0.5*3.14*x[2]/Zcos));

if (Q < 0.)
{
Q = 0.0;
}



Error:
readSourceProperties.H: In function ‘int main(int, char**)’:
readSourceProperties.H:30: erreur: ‘x’ was not declared in this scope
readSourceProperties.H:32: erreur: no match for ‘operator<’ in ‘Q < 0.0’
make: *** [Make/linux64GccDPOpt/sourceBuoyantSimpleFoam.o] Erreur 1


I thought to use x[0] for x, x[1] for y and x[2] for z ! but OpenFOAM reports error in this. Hence my question is: How to input coordinates for Q so that it OpenFOAM will understand it ?

thankyou in advance !!

regards,
JM
jmmeena is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
momentum source term zwdi FLUENT 14 June 27, 2017 16:40
coordinate depending source term jmmeena OpenFOAM 6 July 15, 2009 06:18
DxFoam reader update hjasak OpenFOAM Post-Processing 69 April 24, 2008 02:24
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 18:51
UDFs for Scalar Eqn - Fluid/Solid HT Greg Perkins FLUENT 0 October 14, 2000 00:03


All times are GMT -4. The time now is 14:01.