Hi,
I am looking for an example regarding sorption with script so I modfy and run through linux. I tried to use the code from the sorption box but it is not complete so I can call it and run it. Here is what I got which does not have the original document and also all the parameters so set up.
my \\\$sorptionAdsorptionIsotherm = Modules->Sorption->AdsorptionIsotherm;
my \\\$component1 = \\\$Documents{"H2.xsd"};
\\\$sorptionAdsorptionIsotherm->AddComponent(\\\$component1);
\\\$sorptionAdsorptionIsotherm->FugacityStart(\\\$component1) = 100;
\\\$sorptionAdsorptionIsotherm->FugacityEnd(\\\$component1) = 1000;
my \\\$results = \\\$sorptionAdsorptionIsotherm->Run(\\\$doc, Settings(
CurrentForcefield => "COMPASS",
GridQuality => "Fine",
UseFugacityLogScale => "Yes",
BoxOrientation => "A"));
Any help or example for scriot for sorrption would be appreciated.

Hi
I don't have any examples scripts, but if you wanted to run the above script, you need to add
#!perl
use strict;
use MaterialsScript qw(:all);
at the start to bring in Material Studio APIs
following that add a line to import your base document. e.g.
my $doc = $Documents{"ABW.xsd"};
I have used ABW.xsd as the structure document, but choose whatever structure you want. You will need to make it P1.
This all needs to be added to a .pl script via the script viewer in Materials Studio. You should then be able to run this via the scripting icon on the toolbar. Use the Job Control dialog on the scripting toolbar to specify the server to run on.
Regards
Simon
Hi,
This is one of my sorption scripts in simplified form. Depending of your framework for adsorption, from my expirience, COMPASS is not good force field for that kind of job.
# * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
use strict;
use Getopt::Long;
use MaterialsScript qw(:all);
my $sorbate = $Documents{"H2.xsd"};
my $framework = $Documents{"LTA.xsd"};
my $temp = 298;
my $FugacityStart = 100;
my $FugacityEnd = 1000;
my $name = $framework->Name;
my $doc = $framework->SaveAs("$name-$temp.xsd");
$doc->MakeP1;
my $sorption = Modules->Sorption;
my $task = Modules->Sorption->AdsorptionIsotherm;
$sorption->ChangeSettings([
CurrentForcefield => "COMPASS",
AssignForcefieldTypes => "No",
Quality => "Fine",
Temperature => "$temp",
NumFugacitySteps => "5",
UseFugacityLogScale => "Yes",
"3DPeriodicElectrostaticSummationMethod" => "Ewald",
"ChargeAssignment" => "Use current",
#NumEquilibrationSteps => "200000",
#NumProductionSteps => "2000000",
"3DPeriodicvdWAtomCubicSplineCutOff" => "13",
#UseFieldToDefineRegion => "No",
]);
$task->AddComponent($sorbate);
$task->FugacityStart($sorbate) = $FugacityStart;
$task->FugacityEnd($sorbate) = $FugacityEnd;
$task->Run($doc);
$task->RemoveComponent($sorbate);
Best regards,
B.
Hi
Just a quick note about the above script. mkhademi - if you use it then make sure that you have already assigned forcefieldTypes and charges to all the input structures as the AssignForcefieldTypes is set to "No" which means that forcefieldTypes will not automatically be assigned and ChargeAssignment is set to "Use Current".
Regards
Simon
Hey
which Material Studios Version do you use? I tried to execute this wonderful script on Material Studios 5.5.3 with the warning that modules doesn't include the methode Sorption. I expect a too old version of mine, am I right?
Thank you
Phillip
Hi Phillip,
I'm using 7.0, but originally that script was written for 6.1 version.
I have no idea does it work in your version. Anyhow, do you have a Sorption module in MS 5.5?
Best,
Bojan
Hi Bojan
strange by say, I have this module, i calculate every day work with it, but
it's not easy to use in a script. I have no idea why.
Best regards
Phillip
2014-11-05 16:17 GMT+01:00 Bojan:
Hi
The Sorption module may exist but it does not mean that it is scriptable in the version you have. Scripting was added after modules were created. I can't remember which version it was made scriptable, but the documentation should tell you. The other way to find out, is to load the above script into Materials Studio and press F1 with the cursor in AdsorptionIsotherm or Sorption in the following line
my $task = Modules->Sorption->AdsorptionIsotherm;
If sorption is scriptable in your version it should take you the appropriate help page.
Regards
Simon
Hi Simon
Thank you very much. In my version it is not scriptable, I tried your
suggestion.
Best regards
Phillip