CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

groovyBC for tractionDisplacement BC

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

Reply
 
LinkBack Thread Tools Display Modes
Old   March 8, 2011, 23:49
Question groovyBC for tractionDisplacement BC
  #1
Member
 
carowjp's Avatar
 
Jim Carow
Join Date: Apr 2010
Location: Michigan, USA
Posts: 40
Rep Power: 7
carowjp is on a distinguished road
Hello FOAMers,

Can anyone please tell me if it is possible to apply groovyBC to the traction in the tractionDisplacement boundary condition used in stress solvers?

The BC is specified as:

type tractionDisplacement;
traction uniform ( 0 0 0 );
pressure uniform 0;
value uniform (0 0 0);

I would like to change the value of the traction as a function of time.

There is a nice example 'Wobbler' in the wiki (http://openfoamwiki.net/index.php/Co...oovyBC#wobbler) but that shows how to change the displacement value, not the traction or the pressure.

thanks for any input...
carowjp is online now   Reply With Quote

Old   March 10, 2011, 11:19
Default
  #2
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by carowjp View Post
Hello FOAMers,

Can anyone please tell me if it is possible to apply groovyBC to the traction in the tractionDisplacement boundary condition used in stress solvers?

The BC is specified as:

type tractionDisplacement;
traction uniform ( 0 0 0 );
pressure uniform 0;
value uniform (0 0 0);

I would like to change the value of the traction as a function of time.

There is a nice example 'Wobbler' in the wiki (http://openfoamwiki.net/index.php/Co...oovyBC#wobbler) but that shows how to change the displacement value, not the traction or the pressure.

thanks for any input...
Not out of the box I'm afraid. The solution would be to write a boundary condition groovyTractionDisplacement that is a subclass of tractionDisplacement. That class would add parameters tractionExpression and pressureExpression. In the method updateCoeffs these expressions would be evaluated, assigned to traction and pressure and the updateCoeffs of the superclass would be called.

There is a library groovyStandardBCs where this is demonstrated for the totalPressure. The library is currently only present in the development version that is in the Mercurial (not in the svn). Adapting this for tractionDiscplacement shouldn't be too hard if you know some C++.

Bernhard

PS: I don't plan to groovyify all existing boundary condtions. Only on a "as I need them" basis. But of course if somebody groovyified a boundary condition I will gladly include it (or you can push it yourself to the hg)
gschaider is offline   Reply With Quote

Old   March 10, 2011, 20:02
Default
  #3
Member
 
carowjp's Avatar
 
Jim Carow
Join Date: Apr 2010
Location: Michigan, USA
Posts: 40
Rep Power: 7
carowjp is on a distinguished road
Quote:
Originally Posted by gschaider View Post
Not out of the box I'm afraid. The solution would be to write a boundary condition groovyTractionDisplacement that is a subclass of tractionDisplacement. That class would add parameters tractionExpression and pressureExpression. In the method updateCoeffs these expressions would be evaluated, assigned to traction and pressure and the updateCoeffs of the superclass would be called.

There is a library groovyStandardBCs where this is demonstrated for the totalPressure. The library is currently only present in the development version that is in the Mercurial (not in the svn). Adapting this for tractionDiscplacement shouldn't be too hard if you know some C++.

Bernhard

PS: I don't plan to groovyify all existing boundary condtions. Only on a "as I need them" basis. But of course if somebody groovyified a boundary condition I will gladly include it (or you can push it yourself to the hg)
Thank you for pointing me in the right direction Bernhard...
carowjp is online now   Reply With Quote

Old   March 20, 2011, 18:41
Question
  #4
Member
 
carowjp's Avatar
 
Jim Carow
Join Date: Apr 2010
Location: Michigan, USA
Posts: 40
Rep Power: 7
carowjp is on a distinguished road
Bernhard,

I have used the groovyTotalPressureFvPatchScalarField code from the Hg debug version of swak4Foam as a guide to groovify the solidTractionDisplacement BC.

Unfortunately it is not working properly as the BC isn't applied & I receive the following warning:

Code:
Reading field DU
--> FOAM Warning : 
    From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(const fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
    in file groovyBCFvPatchField.C at line 123
    No value defined for DU on traction therefore using 2{(0 0 0)}
The /0/DU file boundaryField has the following entry:

Code:
    traction
    {
        type groovyBC;
        tractionExpression "(time()<20e-6) ? vector(0,1e+06,0) : vector(0,0,0)";
        pressureExpression "0";
        valueExpression "vector(0,0,0)";
    }
Any hints on what I likely missed?

thx,

Jim
carowjp is online now   Reply With Quote

Old   March 21, 2011, 05:46
Default
  #5
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by carowjp View Post
Bernhard,

I have used the groovyTotalPressureFvPatchScalarField code from the Hg debug version of swak4Foam as a guide to groovify the solidTractionDisplacement BC.

Unfortunately it is not working properly as the BC isn't applied & I receive the following warning:

Code:
Reading field DU
--> FOAM Warning : 
    From function groovyBCFvPatchField<Type>::groovyBCFvPatchField(const fvPatch& p,const DimensionedField<Type, volMesh>& iF,const dictionary& dict)
    in file groovyBCFvPatchField.C at line 123
    No value defined for DU on traction therefore using 2{(0 0 0)}
The /0/DU file boundaryField has the following entry:

Code:
    traction
    {
        type groovyBC;
        tractionExpression "(time()<20e-6) ? vector(0,1e+06,0) : vector(0,0,0)";
        pressureExpression "0";
        valueExpression "vector(0,0,0)";
    }
Any hints on what I likely missed?

thx,

Jim
At first you'll want to change the type of your BC from groovyBC to groovySolidTraction (or whatever it is that is is called in the TypeName-macro in the header of your class). The warning is not the problem. You can make it go away with "value uniform (0 0 0);"

Bernhard
gschaider is offline   Reply With Quote

Old   March 21, 2011, 12:04
Question
  #6
Member
 
carowjp's Avatar
 
Jim Carow
Join Date: Apr 2010
Location: Michigan, USA
Posts: 40
Rep Power: 7
carowjp is on a distinguished road
Quote:
Originally Posted by gschaider View Post
At first you'll want to change the type of your BC from groovyBC to groovySolidTraction (or whatever it is that is is called in the TypeName-macro in the header of your class). The warning is not the problem. You can make it go away with "value uniform (0 0 0);"
Bernhard,

I have added this to the controlDict file:
libs( "libOpenFOAM.so" "libgroovyBC.so" "libgroovyStandardBCs");

is this correct?
I have also changed the name of the BC in the field file to match the type-name I created.

It seems that the BC is still not being recognized.

thanks for your help,

Jim
carowjp is online now   Reply With Quote

Old   March 21, 2011, 13:43
Default
  #7
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by carowjp View Post
Bernhard,

I have added this to the controlDict file:
libs( "libOpenFOAM.so" "libgroovyBC.so" "libgroovyStandardBCs");

is this correct?
I have also changed the name of the BC in the field file to match the type-name I created.

It seems that the BC is still not being recognized.

thanks for your help,

Jim
The libs entry is correct. Otherwise its hard to tell without the source

I'd suggest the following steps to check whether your BC is used:

1. Check the solver output for a warning about a generic-BC (that's an indication that an unknown BC is used)
1a. Set in the system-wide controlDict the disallowGeneric*-switches to 1
2. Add syntax errors to the expressions. If the simulation fails then your BC is used
3. Add an Info << traction() after the expression-evaluation in the updateCoeffs of your BC
4. Make sure that the updateCoeffs of the superclass is called in the end
gschaider is offline   Reply With Quote

Old   June 11, 2011, 21:57
Smile
  #8
Member
 
carowjp's Avatar
 
Jim Carow
Join Date: Apr 2010
Location: Michigan, USA
Posts: 40
Rep Power: 7
carowjp is on a distinguished road
Hi Bernhard,

I see you will be presenting at OF6.. I will be there and hope to meet you.

best regards

James
carowjp is online now   Reply With Quote

Old   July 21, 2011, 16:20
Default update libraries
  #9
New Member
 
Thomas Walsh
Join Date: Nov 2010
Posts: 17
Rep Power: 6
thomasnwalshiii is on a distinguished road
Hi,

I am also trying to accomplish this with groovyTractionDisplacement. I have attached my .C and .H files. I used the groovyFlowRateInletVelocityFvPatchVectorField for the example files. I am not quite sure what to do next however. How do I get these file referenced by one of the boundary condition libraries? I noticed that there is also a .dep file for the other groovyStandardBCs. Do I have to re-make swak4Foam in order for this file to link up properly?
thomasnwalshiii is offline   Reply With Quote

Old   July 22, 2011, 14:56
Default wmake lib....
  #10
New Member
 
Thomas Walsh
Join Date: Nov 2010
Posts: 17
Rep Power: 6
thomasnwalshiii is on a distinguished road
I have figured out how to add my new groovyBC to the standard BCs library. I simply added my file's name, "groovyTractionDisplamentFvPatchVectorField.C" , to the Libraries->groovyStandardBCs->Make->files script and ran

>> wmake libso groovyStandardBCs/

This made the dependency files, but I ran into an error with the wmake process:

In file included from groovyTractionDisplacementFvPatchVectorField.C:33:
groovyTractionDisplacementFvPatchVectorField.H:44: 52: error: tractionDisplacementFvPatchVectorField.H: No such file or directory

Is there somewhere that I should be specifying the location of the original tractionDisplacementFvPatchVectorField.H? There is a lot of other errors reported after this one, but I have a feeling that they are caused from this one.

Thanks for any help,
Tom
thomasnwalshiii is offline   Reply With Quote

Old   July 25, 2011, 04:51
Default
  #11
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by thomasnwalshiii View Post
I have figured out how to add my new groovyBC to the standard BCs library. I simply added my file's name, "groovyTractionDisplamentFvPatchVectorField.C" , to the Libraries->groovyStandardBCs->Make->files script and ran

>> wmake libso groovyStandardBCs/

This made the dependency files, but I ran into an error with the wmake process:

In file included from groovyTractionDisplacementFvPatchVectorField.C:33:
groovyTractionDisplacementFvPatchVectorField.H:44: 52: error: tractionDisplacementFvPatchVectorField.H: No such file or directory

Is there somewhere that I should be specifying the location of the original tractionDisplacementFvPatchVectorField.H? There is a lot of other errors reported after this one, but I have a feeling that they are caused from this one.

Thanks for any help,
Tom
The original tractionDisplacement is found somewhere in $FOAM_SOLVERS/stressAnanlysis. You'll have to add the exact location to Make/options
gschaider is offline   Reply With Quote

Old   July 25, 2011, 12:52
Default compiling successful
  #12
New Member
 
Thomas Walsh
Join Date: Nov 2010
Posts: 17
Rep Power: 6
thomasnwalshiii is on a distinguished road
Bernhard,

Thanks for the reply! I've successfully compiled groovyTractionDisplacement using the following additions to the make->files & options scrips:

For files:

groovyTotalPressureFvPatchScalarField.C
groovyFlowRateInletVelocityFvPatchVectorField.C
groovyTractionDisplacementFvPatchVectorField.C

LIB = $(FOAM_USER_LIBBIN)/libgroovyStandardBCs

For options:

ifdef FOAM_DEV
FOAM_DEV_OPTION = -DFOAM_DEV
endif


EXE_INC =-I$(OBJECTS_DIR) \
$(FOAM_DEV_OPTION) \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I../groovyBC/lnInclude/ \
-I../swak4FoamParsers/lnInclude/ \
-I$(FOAM_SOLVERS)/stressAnalysis/solidDisplacementFoam/tractionDisplacement/


LIB_LIBS = -lfiniteVolume \
-lOpenFOAM \
-lsampling \
-L$(FOAM_USER_LIBBIN) \
-lgroovyBC \
-lswak4FoamParsers

I'll now have to see if my groovified boundary condition actually works. I'm making a case which will simulate the effects that a gasket has on a cover (how much it deforms). By using this new groovified boundary condition I am planing on adjusting the pressure applied to each face depending on its current (or last iteration) deformation. I will submit my case example if it is a success. If anyone has any alternative solutions or solvers that already can accomplish this goal please let me know. The pressure vs deformation for my current case has a non-linear relation.

Tom
thomasnwalshiii is offline   Reply With Quote

Old   July 26, 2011, 11:19
Default Compilation Error
  #13
New Member
 
Thomas Walsh
Join Date: Nov 2010
Posts: 17
Rep Power: 6
thomasnwalshiii is on a distinguished road
It seems that I have not successfully compile groovyTractionDisplacement or that I have an error within my code. When attempting to run a simulation with the groovyTract... BC I get the following error:

--> FOAM Warning :
From function dlLibraryTable:pen(const fileName& functionLibName)
in file db/dlLibraryTable/dlLibraryTable.C at line 78
could not load /home/twalsh/OpenFOAM/twalsh-1.7.0/lib/linux64GccDPOpt/libgroovyStandardBCs.so: undefined symbol: _ZN4Foam38tractionDisplacementFvPatchVectorField7a utoMapERKNS_18fvPatchFieldMapperE
Create mesh for time = 0

I also noticed that I get an error message while compiling the dependent files, below shows the last two lines of text written during the wmake libso groovyStandardBCs:

collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

I'm not sure what this Error 1 is or where it comes from. I have attached the log file, but can't seem to see what this error references. Any assistance would be appreciated.

Tom
Attached Files
File Type: txt wmake_log_file_A.txt (55.0 KB, 1 views)
thomasnwalshiii is offline   Reply With Quote

Old   July 27, 2011, 10:45
Default
  #14
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by thomasnwalshiii View Post
It seems that I have not successfully compile groovyTractionDisplacement or that I have an error within my code. When attempting to run a simulation with the groovyTract... BC I get the following error:

--> FOAM Warning :
From function dlLibraryTable:pen(const fileName& functionLibName)
in file db/dlLibraryTable/dlLibraryTable.C at line 78
could not load /home/twalsh/OpenFOAM/twalsh-1.7.0/lib/linux64GccDPOpt/libgroovyStandardBCs.so: undefined symbol: _ZN4Foam38tractionDisplacementFvPatchVectorField7a utoMapERKNS_18fvPatchFieldMapperE
Create mesh for time = 0

I also noticed that I get an error message while compiling the dependent files, below shows the last two lines of text written during the wmake libso groovyStandardBCs:

collect2: ld returned 1 exit status
make: *** [OpenFOAM.out] Error 1

I'm not sure what this Error 1 is or where it comes from. I have attached the log file, but can't seem to see what this error references. Any assistance would be appreciated.

Tom
By adding the include you only said "that is what your parent class will look like" (the declaration) but no actual code was added (that definition is in tractionDisplacementFvPatchFields.o or so). Usually that .o file is linked into the solidDisplacement-Solvers. Are you using one of those? If not is the corresponding .C-file specified in your custom solver?

Linking the .o-file into the library is not a good idea because if that gets loaded by a stock-solver then there are two definitions of the class and the loading will fail also.

If the definition of the parent class IS in the used solver (make sure by grepping the solver-binary for the symbol that was reported missing) then something strange is going on.

Bernhard
gschaider is offline   Reply With Quote

Old   August 1, 2011, 03:27
Thumbs up This is what I did...
  #15
Member
 
carowjp's Avatar
 
Jim Carow
Join Date: Apr 2010
Location: Michigan, USA
Posts: 40
Rep Power: 7
carowjp is on a distinguished road
Have a look at the attachment...there is a README file, make folder, and groovyTractionDisplacement .H and .C files.

cheers,

James
Attached Files
File Type: gz tDFvPatchVectorField.tar.gz (2.4 KB, 28 views)
carowjp is online now   Reply With Quote

Old   April 8, 2014, 10:24
Default tractionDisplacement groovybc
  #16
New Member
 
Join Date: Mar 2014
Posts: 23
Rep Power: 3
Brayanashel is on a distinguished road
Hi,

Is there a groovybc for tractionDisplacement, please?
Brayanashel is offline   Reply With Quote

Old   April 8, 2014, 10:36
Default tractionDisplacement groovybc
  #17
Member
 
carowjp's Avatar
 
Jim Carow
Join Date: Apr 2010
Location: Michigan, USA
Posts: 40
Rep Power: 7
carowjp is on a distinguished road
Please have a look at the attachment in my previous post. It contains the boundary condition you are looking for.

regards,

James
carowjp is online now   Reply With Quote

Old   April 9, 2014, 10:48
Default
  #18
New Member
 
Join Date: Mar 2014
Posts: 23
Rep Power: 3
Brayanashel is on a distinguished road
Could you please let me know how to compile the code for OF-1.6-ext?

Regards
Brayanashel is offline   Reply With Quote

Old   April 9, 2014, 13:25
Default Compiling Custom Boundary
  #19
New Member
 
Thomas Walsh
Join Date: Nov 2010
Posts: 17
Rep Power: 6
thomasnwalshiii is on a distinguished road
Hi,

Its been a while since I compiled a custom boundary condition, but if you read through this post you should be able to get it working. Looks like Jim Carow also added a text file in his attachment that tells you how to, so check that out.
thomasnwalshiii is offline   Reply With Quote

Reply

Tags
boundary condition, groovybc, traction, tractiondisplacement

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
groovyBC and funkySetFields married and got a kid named swak4Foam gschaider OpenFOAM 164 January 13, 2015 03:52
Wall heat transfer using groovyBC (XiFoam solver) usergk OpenFOAM 7 February 4, 2011 14:36
Non-normal inflow with groovyBC bjr OpenFOAM 9 January 17, 2011 11:35
Scale discrete inlet velocity profile with groovyBC cboss OpenFOAM 1 June 20, 2010 13:02
groovyBC tamsilian OpenFOAM Programming & Development 1 May 27, 2010 03:15


All times are GMT -4. The time now is 10:19.