CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   problem implementing parabolic profile in oscillatingFixedValue (https://www.cfd-online.com/Forums/openfoam-programming-development/103031-problem-implementing-parabolic-profile-oscillatingfixedvalue.html)

shash June 8, 2012 16:06

problem implementing parabolic profile in oscillatingFixedValue
 
2 Attachment(s)
Hi openfoamers ,

i was trying to create a parabolic velocity profile in oscillationFixedValue , as i require to generate v(y,t) where its parabolic in space and oscillating in time.i am new to openfoam ,just tried modifying the oscillatingfixedvalue code but its giving errors.can somebody suggest if my modifications r correct i hav attached my header and source. :(
[ATTACH][ATTACH]13684[/ATTACH][/ATTACH]

gschaider June 9, 2012 12:21

Quote:

Originally Posted by shash (Post 365506)
Hi openfoamers ,

i was trying to create a parabolic velocity profile in oscillationFixedValue , as i require to generate v(y,t) where its parabolic in space and oscillating in time.i am new to openfoam ,just tried modifying the oscillatingfixedvalue code but its giving errors.can somebody suggest if my modifications r correct i hav attached my header and source. :(
[ATTACH][ATTACH]13684[/ATTACH][/ATTACH]

if your main interest is getting the boundary condition and not learning C++ then you might be interested in groovyBC.

Or, if you don't want to install 3rd-party software, have a look at the coded-boundary condition. There you only have to program a small C++-code-snipplet that sets the boundary condition but not the whole bunch of constructors and other methods.

The advantage of both methods is that the definition is where it belongs: in the case and not some extra library.

shash June 10, 2012 07:16

hi gschaider,
i implemented the codedfixedvalue bc with:
inlet
{
type codedFixedValue;
value uniform (0 0 0); //$internalField;
redirectType awsum_bc;
code
#{
fixedValueFvPatchVectorField myPatch (*this);
forAll(myPatch, celli)
{
myPatch[celli] =(.1*(1-(this->patch().Cf()[celli](2)*this->patch().Cf()[celli](2)/.01))*(1 + sin(this->db().time().value())));
}
operator==(myPatch);
#};
}

but its giving errors, can you suggest what is wrong ,my velocity profile is v=v0(1+ sin(t)) ;v0 being parabolic f(y).

gschaider June 10, 2012 17:52

Quote:

Originally Posted by shash (Post 365667)
hi gschaider,
i implemented the codedfixedvalue bc with:
inlet
{
type codedFixedValue;
value uniform (0 0 0); //$internalField;
redirectType awsum_bc;
code
#{
fixedValueFvPatchVectorField myPatch (*this);
forAll(myPatch, celli)
{
myPatch[celli] =(.1*(1-(this->patch().Cf()[celli](2)*this->patch().Cf()[celli](2)/.01))*(1 + sin(this->db().time().value())));
}
operator==(myPatch);
#};
}

but its giving errors, can you suggest what is wrong ,my velocity profile is v=v0(1+ sin(t)) ;v0 being parabolic f(y).

Sorry. My time is limited. I support "my" stuff (groovyBC) but I don't do C++-lectures

shash June 10, 2012 18:06

i already solved my problem , thank you for all ur help.

vitors December 14, 2012 11:20

How shash? I'm interested in your solution.

shash June 11, 2013 13:28

hi vitor,

read this thread http://www.cfd-online.com/Forums/ope...condition.html , sorry for such late reply.


All times are GMT -4. The time now is 15:43.