# OpenFOAM 1D solver

 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 18, 2012, 16:40 OpenFOAM 1D solver #1 Senior Member   Vishal Nandigana Join Date: Mar 2009 Location: Champaign, Illinois, U.S.A Posts: 206 Rep Power: 9 Dear Foamers, I would like to solve a poisson equation in a simple 1D domain (6 units) using OpenFOAM. I have created a blockmesh file and ensured the XY and XZ patches are defined as empty. See below convertToMeters 1e3; vertices ( (0 0 0) //0 (6 0 0) //1 (6 0.1 0) //2 (0 0.1 0) //3 (0 0 0.1) //4 (6 0 0.1) //5 (6 0.1 0.1) //6 (0 0.1 0.1) //7 ); blocks ( hex (0 1 2 3 4 5 6 7) (600 1 1) simpleGrading (1 1 1) ); edges ( ); patches ( patch inlet ( (0 4 7 3) ) patch outlet ( (1 5 6 2) ) empty frontAndBack ( (0 1 5 4) (3 2 6 7) (0 1 2 3) (4 5 6 7) ) ); mergePatchPairs ( ); Now I would like to solve poisson equation with different source terms at different regions in the 1D domain. For instance for the aforementioned example I would like to solve d^2T/dx^2 = a/R for 0<= x<2000 d^2T/dx^2 = a+b/R for 2000<= x <=4000 d^2T/dx^2 = a/R for 4000< x<=6000 I have looked at know how to implement the laplacian solver and define the source terms. But I would like to know how to define the source term by considering the domain. Kindly let me know. Thanks for the help. Regards Vishal Nandigana

 April 19, 2012, 01:22 #2 Senior Member   Nima Sam Join Date: Sep 2009 Location: Tehran, Iran Posts: 1,123 Blog Entries: 1 Rep Power: 14 it seems easy! your general equation is laplacian(T) = Q and your source temr (Q) is non-uniform! then you just need to define this non-uniform volScalarField Q some like this: forAll (Q, celli){ if (Q[celli].x() < 2000){ Q[celli] =a/R } if ( 2000

 April 19, 2012, 11:29 #3 Senior Member   Vishal Nandigana Join Date: Mar 2009 Location: Champaign, Illinois, U.S.A Posts: 206 Rep Power: 9 Thanks for the reply. It works. Vishal

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post qinmaple OpenFOAM Announcements from Other Sources 4 August 10, 2012 11:00 Luiz CFX 4 March 6, 2011 21:02 cfd_staruser OpenFOAM 5 August 14, 2009 02:28 pete Site News & Announcements 0 June 29, 2009 05:56 hjasak OpenFOAM 1 February 2, 2006 22:07

All times are GMT -4. The time now is 09:35.