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

adjoint solver in OpenFOAM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 13, 2014, 04:40
Default adjoint solver in OpenFOAM
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
Dear All,

I am trying to implement an adjoint solver for external flow.

I have implemented the sensitivity. Now I would need to implement the normals to a certain patch, but - while coding - I get an error. My idea is to write something like

Code:
	forAll(mesh.boundary(), patchi)
	{
	     if(mesh.boundary()[patchi].name() == "ciao")
	     {
	         normal.setSize(mesh.boundary()[patchi].size());
	
	         forAll(normal, i)
	         {
	             normal[i] = mesh.boundary()[patchi].nf();
	         }
	     }
	}
What's wrong with this code?

Thanks for help,
Samuele
samiam1000 is offline   Reply With Quote

Old   May 13, 2014, 15:08
Default
  #2
ngj
Senior Member
 
Niels Gjoel Jacobsen
Join Date: Mar 2009
Location: Copenhagen, Denmark
Posts: 1,900
Rep Power: 37
ngj will become famous soon enoughngj will become famous soon enough
Hallo,

It is more difficult, when you are not telling, what the compiler complains about. But, the problem at least lies in line 9, where you assign a vector field to a single element in a vector field.

Cheers,

Niels
__________________
Please note that I do not use the Friend-feature, so do not be offended, if I do not accept a request.
ngj 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
Can't get data from OpenFoam to external solver using externalCoupled perry OpenFOAM Running, Solving & CFD 4 May 26, 2014 08:09
FSI solver for openFoam 1.6 ext Whyman OpenFOAM 4 October 26, 2013 06:11
error compiling solver in OpenFOAM 1.6-ext: pimpleDymFoam tupe OpenFOAM 0 October 3, 2011 05:55
Working directory via command line Luiz CFX 4 March 6, 2011 20:02
Modified OpenFOAM Forum Structure and New Mailing-List pete Site News & Announcements 0 June 29, 2009 05:56


All times are GMT -4. The time now is 00:11.